diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-04 05:29:27 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-04 05:29:27 +0000 |
commit | 4c4d8d2b8aa8ae394d0f933700ddd9e682b141af (patch) | |
tree | 6e3e10e71c29bb9cc8d221d4de38d9dc603e32cd /chrome/common | |
parent | 39d74d8b3c05faf98935927b68eaebb9a23a76a4 (diff) | |
download | chromium_src-4c4d8d2b8aa8ae394d0f933700ddd9e682b141af.zip chromium_src-4c4d8d2b8aa8ae394d0f933700ddd9e682b141af.tar.gz chromium_src-4c4d8d2b8aa8ae394d0f933700ddd9e682b141af.tar.bz2 |
Convert NavigationEntry title to string16. TabContents::GetTitle no longer needs
to be virtual, either.
This also changes how the display URL is computed. Instead of doing it
preemptively, we now do so lazily. This allows us to do the URL formatting
correctly using the elider so that we can do IDN and unescaping.
I changed string_util's singleton functions. I was worried that other code
might make a singleton of string, which would give you this same value as a
non-const string. This would mean our empty strings might no longer be empty.
Review URL: http://codereview.chromium.org/39022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10872 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc index cd053ff..c8f570b 100644 --- a/chrome/common/temp_scaffolding_stubs.cc +++ b/chrome/common/temp_scaffolding_stubs.cc @@ -285,7 +285,7 @@ const GURL& TabContents::GetURL() const { return entry ? entry->display_url() : GURL::EmptyGURL(); } -const std::wstring& TabContents::GetTitle() const { +const string16& TabContents::GetTitle() const { // We use the title for the last committed entry rather than a pending // navigation entry. For example, when the user types in a URL, we want to // keep the old page's title until the new load has committed and we get a new @@ -294,14 +294,14 @@ const std::wstring& TabContents::GetTitle() const { // their title, as they are not committed. NavigationEntry* entry = controller_->GetTransientEntry(); if (entry) - return entry->GetTitleForDisplay(); + return entry->GetTitleForDisplay(controller_); entry = controller_->GetLastCommittedEntry(); if (entry) - return entry->GetTitleForDisplay(); + return entry->GetTitleForDisplay(controller_); else if (controller_->LoadingURLLazily()) return controller_->GetLazyTitle(); - return EmptyWString(); + return EmptyString16(); } void TabContents::NotifyNavigationStateChanged(unsigned changed_flags) { |