summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 06:13:02 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 06:13:02 +0000
commitcee9de4e4af9a1d441a1540c6c7a676c35042994 (patch)
treeac2034b3195281551dde58be9f4b2c32d8b8f8c0 /chrome/browser
parentd01902d70e46a90fc24d3a442805a4a665d373ca (diff)
downloadchromium_src-cee9de4e4af9a1d441a1540c6c7a676c35042994.zip
chromium_src-cee9de4e4af9a1d441a1540c6c7a676c35042994.tar.gz
chromium_src-cee9de4e4af9a1d441a1540c6c7a676c35042994.tar.bz2
Fix the build with some forgotten string conversions on non-Windows.
Review URL: http://codereview.chromium.org/40099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/debugger/debugger_host_impl.cpp2
-rw-r--r--chrome/browser/dom_ui/dom_ui_contents.cc6
-rw-r--r--chrome/browser/dom_ui/dom_ui_contents.h2
-rw-r--r--chrome/browser/navigation_entry_unittest.cc6
-rw-r--r--chrome/browser/sessions/session_types.cc3
-rw-r--r--chrome/browser/site_instance_unittest.cc4
-rw-r--r--chrome/browser/tab_contents/interstitial_page.cc2
-rw-r--r--chrome/browser/tab_contents/web_contents.cc4
8 files changed, 15 insertions, 14 deletions
diff --git a/chrome/browser/debugger/debugger_host_impl.cpp b/chrome/browser/debugger/debugger_host_impl.cpp
index beeb398..0a2bb81 100644
--- a/chrome/browser/debugger/debugger_host_impl.cpp
+++ b/chrome/browser/debugger/debugger_host_impl.cpp
@@ -98,7 +98,7 @@ void DebuggerHostImpl::OnDebugAttach() {
std::wstring title;
const TabContents* t = GetTabContentsBeingDebugged();
if (t) {
- title = UTF16ToWideHack(t->GetTitle());
+ title = t->GetTitle();
}
ListValue* argv = new ListValue;
diff --git a/chrome/browser/dom_ui/dom_ui_contents.cc b/chrome/browser/dom_ui/dom_ui_contents.cc
index 90a2bbb..eb0f60b 100644
--- a/chrome/browser/dom_ui/dom_ui_contents.cc
+++ b/chrome/browser/dom_ui/dom_ui_contents.cc
@@ -197,15 +197,15 @@ void DOMUIContents::SetInitialFocus(bool reverse) {
TabContents::SetInitialFocus(reverse);
}
-const std::wstring& DOMUIContents::GetTitle() const {
+const string16& DOMUIContents::GetTitle() const {
// Workaround for new tab page - we may be asked for a title before
// the content is ready, and we don't even want to display a 'loading...'
// message, so we force it here.
if (controller()->GetActiveEntry() &&
controller()->GetActiveEntry()->url().host() ==
NewTabUI::GetBaseURL().host()) {
- std::wstring* title = new std::wstring(
- l10n_util::GetString(IDS_NEW_TAB_TITLE));
+ string16* title = new string16(WideToUTF16Hack(
+ l10n_util::GetString(IDS_NEW_TAB_TITLE)));
return *title;
}
return WebContents::GetTitle();
diff --git a/chrome/browser/dom_ui/dom_ui_contents.h b/chrome/browser/dom_ui/dom_ui_contents.h
index d7d4d67..241f97f 100644
--- a/chrome/browser/dom_ui/dom_ui_contents.h
+++ b/chrome/browser/dom_ui/dom_ui_contents.h
@@ -110,7 +110,7 @@ class DOMUIContents : public WebContents {
// Whether we want to display the page's URL.
virtual bool ShouldDisplayURL();
// Get the title for this page.
- virtual const std::wstring& GetTitle() const;
+ virtual const string16& GetTitle() const;
// We may wish to control what happens when a URL is opened.
virtual void RequestOpenURL(const GURL& url, const GURL& referrer,
WindowOpenDisposition disposition);
diff --git a/chrome/browser/navigation_entry_unittest.cc b/chrome/browser/navigation_entry_unittest.cc
index ebeeae8..7d4f77a 100644
--- a/chrome/browser/navigation_entry_unittest.cc
+++ b/chrome/browser/navigation_entry_unittest.cc
@@ -60,7 +60,7 @@ TEST_F(NavigationEntryTest, NavigationEntryURLs) {
entry1_.get()->GetTitleForDisplay(NULL));
// Title affects GetTitleForDisplay
- entry1_.get()->set_title(ASCIIToWide("Google"));
+ entry1_.get()->set_title(ASCIIToUTF16("Google"));
EXPECT_EQ(ASCIIToUTF16("Google"), entry1_.get()->GetTitleForDisplay(NULL));
// Setting display_url doesn't affect URL
@@ -146,8 +146,8 @@ TEST_F(NavigationEntryTest, NavigationEntryAccessors) {
EXPECT_EQ(GURL("from2"), entry2_.get()->referrer());
// Title
- EXPECT_EQ(std::wstring(), entry1_.get()->title());
- EXPECT_EQ(L"title", entry2_.get()->title());
+ EXPECT_EQ(string16(), entry1_.get()->title());
+ EXPECT_EQ(ASCIIToUTF16("title"), entry2_.get()->title());
entry2_.get()->set_title(ASCIIToUTF16("title2"));
EXPECT_EQ(ASCIIToUTF16("title2"), entry2_.get()->title());
diff --git a/chrome/browser/sessions/session_types.cc b/chrome/browser/sessions/session_types.cc
index a43f637..a87ea6c 100644
--- a/chrome/browser/sessions/session_types.cc
+++ b/chrome/browser/sessions/session_types.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/sessions/session_types.h"
+#include "base/string_util.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
// TabNavigation --------------------------------------------------------------
@@ -21,7 +22,7 @@ NavigationEntry* TabNavigation::ToNavigationEntry(int page_id) const {
page_id,
real_url,
referrer_,
- title_,
+ WideToUTF16Hack(title_),
// Use a transition type of reload so that we don't incorrectly
// increase the typed count.
PageTransition::RELOAD);
diff --git a/chrome/browser/site_instance_unittest.cc b/chrome/browser/site_instance_unittest.cc
index cbe50dd..d04fff1 100644
--- a/chrome/browser/site_instance_unittest.cc
+++ b/chrome/browser/site_instance_unittest.cc
@@ -89,7 +89,7 @@ TEST_F(SiteInstanceTest, SiteInstanceDestructor) {
// Add a second reference
NavigationEntry* e2 = new NavigationEntry(TAB_CONTENTS_WEB, instance, 0, url,
- GURL(), std::wstring(),
+ GURL(), string16(),
PageTransition::LINK);
// Now delete both entries and be sure the SiteInstance goes away.
@@ -141,7 +141,7 @@ TEST_F(SiteInstanceTest, CloneNavigationEntry) {
NavigationEntry* e1 = new NavigationEntry(TAB_CONTENTS_WEB, instance1, 0,
url, GURL(),
- std::wstring(),
+ string16(),
PageTransition::LINK);
// Clone the entry
NavigationEntry* e2 = new NavigationEntry(*e1);
diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc
index fad7d21..bfaf9bb 100644
--- a/chrome/browser/tab_contents/interstitial_page.cc
+++ b/chrome/browser/tab_contents/interstitial_page.cc
@@ -190,7 +190,7 @@ void InterstitialPage::Hide() {
// Let's revert to the original title if necessary.
NavigationEntry* entry = tab_->controller()->GetActiveEntry();
if (!new_navigation_ && should_revert_tab_title_) {
- entry->set_title(original_tab_title_);
+ entry->set_title(WideToUTF16Hack(original_tab_title_));
tab_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TITLE);
}
delete this;
diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc
index 15b55e4..bd3c1c5 100644
--- a/chrome/browser/tab_contents/web_contents.cc
+++ b/chrome/browser/tab_contents/web_contents.cc
@@ -1728,10 +1728,10 @@ bool WebContents::UpdateTitleForEntry(NavigationEntry* entry,
explicit_set = true;
}
- if (final_title == entry->title())
+ if (final_title == UTF16ToWideHack(entry->title()))
return false; // Nothing changed, don't bother.
- entry->set_title(final_title);
+ entry->set_title(WideToUTF16Hack(final_title));
// Update the history system for this page.
if (!profile()->IsOffTheRecord() && !received_page_title_) {