diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 18:03:41 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 18:03:41 +0000 |
commit | bbbc1ef9d160f602aed88ed2eecd6063e5952ca7 (patch) | |
tree | 256e507e11d22bc154edcef45746ee38b8d1a64e /chrome/browser/tab_contents | |
parent | a1ff529fcffcded364926b58c1f2c8afc839adeb (diff) | |
download | chromium_src-bbbc1ef9d160f602aed88ed2eecd6063e5952ca7.zip chromium_src-bbbc1ef9d160f602aed88ed2eecd6063e5952ca7.tar.gz chromium_src-bbbc1ef9d160f602aed88ed2eecd6063e5952ca7.tar.bz2 |
Use TabContents::GetDefaultTitle() everywhere we need a title for an untitled tab/page. This will let us remove a couple of duplicate strings.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/604021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 9 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 6 |
2 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 3d66ebf..2f0dcd9 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -505,6 +505,11 @@ const string16& TabContents::GetTitle() const { return EmptyString16(); } +// static +string16 TabContents::GetDefaultTitle() { + return l10n_util::GetStringUTF16(IDS_DEFAULT_TAB_TITLE); +} + int32 TabContents::GetMaxPageID() { if (GetSiteInstance()) return GetSiteInstance()->max_page_id(); @@ -525,10 +530,6 @@ SiteInstance* TabContents::GetSiteInstance() const { return render_manager_.current_host()->site_instance(); } -const std::wstring TabContents::GetDefaultTitle() const { - return l10n_util::GetString(IDS_DEFAULT_TAB_TITLE); -} - bool TabContents::ShouldDisplayURL() { // Don't hide the url in view source mode and with interstitials. NavigationEntry* entry = controller_.GetActiveEntry(); diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 1744f61..2c7e5be 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -200,6 +200,9 @@ class TabContents : public PageNavigator, virtual const GURL& GetURL() const; virtual const string16& GetTitle() const; + // Initial title assigned to NavigationEntries from Navigate. + static string16 GetDefaultTitle(); + // The max PageID of any page that this TabContents has loaded. PageIDs // increase with each new page that is loaded by a tab. If this is a // TabContents, then the max PageID is kept separately on each SiteInstance. @@ -214,9 +217,6 @@ class TabContents : public PageNavigator, // access to its site instance. virtual SiteInstance* GetSiteInstance() const; - // Initial title assigned to NavigationEntries from Navigate. - const std::wstring GetDefaultTitle() const; - // Defines whether this tab's URL should be displayed in the browser's URL // bar. Normally this is true so you can see the URL. This is set to false // for the new tab page and related pages so that the URL bar is empty and |