diff options
author | Xan Lopez <xan@gnome.org> | 2009-06-16 19:15:43 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2009-06-16 19:15:43 +0800 |
commit | 2c51cb761fe6392f136611cb73d6eeda223288fb (patch) | |
tree | 9d41e2e5deae57e15187dada0d5dce30a7d6f366 /embed/ephy-web-view.c | |
parent | ad2fb83740b906a3484faec8bd7934495730931e (diff) | |
download | gsoc2013-epiphany-2c51cb761fe6392f136611cb73d6eeda223288fb.tar gsoc2013-epiphany-2c51cb761fe6392f136611cb73d6eeda223288fb.tar.gz gsoc2013-epiphany-2c51cb761fe6392f136611cb73d6eeda223288fb.tar.bz2 gsoc2013-epiphany-2c51cb761fe6392f136611cb73d6eeda223288fb.tar.lz gsoc2013-epiphany-2c51cb761fe6392f136611cb73d6eeda223288fb.tar.xz gsoc2013-epiphany-2c51cb761fe6392f136611cb73d6eeda223288fb.tar.zst gsoc2013-epiphany-2c51cb761fe6392f136611cb73d6eeda223288fb.zip |
Move the get_title_composite function to EphyWebView.
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r-- | embed/ephy-web-view.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index befd65a6b..5cbaa7c70 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -2015,3 +2015,40 @@ ephy_web_view_get_go_up_list (EphyWebView *view) { return NULL; } + +/** + * ephy_embed_utils_get_title_composite: + * @view: an #EphyView + * + * Returns the title of the web page loaded in @view. + * + * This differs from #ephy_web_view_get_title in that this function + * will return a special title while the page is still loading. + * + * Return value: @view's web page's title. Will never be %NULL. + **/ +const char * +ephy_web_view_get_title_composite (EphyWebView *view) +{ + const char *title = ""; + const char *loading_title; + gboolean is_loading, is_blank; + + g_return_val_if_fail (EPHY_IS_WEB_VIEW (view), NULL); + + is_loading = ephy_web_view_get_load_status (view); + is_blank = ephy_web_view_get_is_blank (view); + loading_title = ephy_web_view_get_loading_title (view); + title = ephy_web_view_get_title (view); + + if (is_blank) + { + if (is_loading) + title = loading_title; + else + title = _("Blank page"); + } + + return title != NULL ? title : ""; +} + |