diff options
-rw-r--r-- | chrome/browser/notifications/balloon_host.h | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents_unittest.cc | 2 | ||||
-rw-r--r-- | content/browser/renderer_host/render_view_host.cc | 2 | ||||
-rw-r--r-- | content/browser/renderer_host/render_view_host.h | 2 | ||||
-rw-r--r-- | content/browser/renderer_host/render_view_host_delegate.h | 2 | ||||
-rw-r--r-- | content/browser/tab_contents/interstitial_page.cc | 8 | ||||
-rw-r--r-- | content/browser/tab_contents/interstitial_page.h | 4 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents.cc | 7 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents.h | 4 | ||||
-rw-r--r-- | content/common/view_messages.h | 3 | ||||
-rw-r--r-- | content/renderer/render_view.cc | 4 |
11 files changed, 19 insertions, 21 deletions
diff --git a/chrome/browser/notifications/balloon_host.h b/chrome/browser/notifications/balloon_host.h index 1feabb2..e91cb05 100644 --- a/chrome/browser/notifications/balloon_host.h +++ b/chrome/browser/notifications/balloon_host.h @@ -58,8 +58,6 @@ class BalloonHost : public RenderViewHostDelegate, virtual void RenderViewGone(RenderViewHost* render_view_host, base::TerminationStatus status, int error_code) OVERRIDE; - virtual void UpdateTitle(RenderViewHost* render_view_host, - int32 page_id, const std::wstring& title) OVERRIDE {} virtual ViewType::Type GetRenderViewType() const OVERRIDE; virtual RenderViewHostDelegate::View* GetViewDelegate() OVERRIDE; virtual void HandleMouseDown() OVERRIDE; diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index ef990cd6b..549ced8 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -221,7 +221,7 @@ TEST_F(TabContentsTest, UpdateTitle) { content::LoadCommittedDetails details; controller().RendererDidNavigate(params, &details); - contents()->UpdateTitle(rvh(), 0, L" Lots O' Whitespace\n"); + contents()->UpdateTitle(rvh(), 0, ASCIIToUTF16(" Lots O' Whitespace\n")); EXPECT_EQ(ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle()); } diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc index a3ced11..9b1b954 100644 --- a/content/browser/renderer_host/render_view_host.cc +++ b/content/browser/renderer_host/render_view_host.cc @@ -883,7 +883,7 @@ void RenderViewHost::OnMsgUpdateState(int32 page_id, } void RenderViewHost::OnMsgUpdateTitle(int32 page_id, - const std::wstring& title) { + const string16& title) { if (title.length() > content::kMaxTitleChars) { NOTREACHED() << "Renderer sent too many characters in title."; return; diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h index a20ae50..857a396 100644 --- a/content/browser/renderer_host/render_view_host.h +++ b/content/browser/renderer_host/render_view_host.h @@ -412,7 +412,7 @@ class RenderViewHost : public RenderWidgetHost { void OnMsgNavigate(const IPC::Message& msg); void OnMsgUpdateState(int32 page_id, const std::string& state); - void OnMsgUpdateTitle(int32 page_id, const std::wstring& title); + void OnMsgUpdateTitle(int32 page_id, const string16& title); void OnMsgUpdateEncoding(const std::string& encoding); void OnMsgUpdateTargetURL(int32 page_id, const GURL& url); void OnMsgClose(); diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h index c3c7447..8d4ea10 100644 --- a/content/browser/renderer_host/render_view_host_delegate.h +++ b/content/browser/renderer_host/render_view_host_delegate.h @@ -235,7 +235,7 @@ class RenderViewHostDelegate : public IPC::Channel::Listener { // The page's title was changed and should be updated. virtual void UpdateTitle(RenderViewHost* render_view_host, int32 page_id, - const std::wstring& title) {} + const string16& title) {} // The page's encoding was changed and should be updated. virtual void UpdateEncoding(RenderViewHost* render_view_host, diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc index 6a28800..d4ba3dd 100644 --- a/content/browser/tab_contents/interstitial_page.cc +++ b/content/browser/tab_contents/interstitial_page.cc @@ -255,7 +255,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(WideToUTF16Hack(original_tab_title_)); + entry->set_title(original_tab_title_); tab_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TITLE); } delete this; @@ -375,7 +375,7 @@ void InterstitialPage::DidNavigate( void InterstitialPage::UpdateTitle(RenderViewHost* render_view_host, int32 page_id, - const std::wstring& title) { + const string16& title) { DCHECK(render_view_host == render_view_host_); NavigationEntry* entry = tab_->controller().GetActiveEntry(); if (!entry) { @@ -394,10 +394,10 @@ void InterstitialPage::UpdateTitle(RenderViewHost* render_view_host, // If this interstitial is shown on an existing navigation entry, we'll need // to remember its title so we can revert to it when hidden. if (!new_navigation_ && !should_revert_tab_title_) { - original_tab_title_ = UTF16ToWideHack(entry->title()); + original_tab_title_ = entry->title(); should_revert_tab_title_ = true; } - entry->set_title(WideToUTF16Hack(title)); + entry->set_title(title); tab_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TITLE); } diff --git a/content/browser/tab_contents/interstitial_page.h b/content/browser/tab_contents/interstitial_page.h index a0e6d2a..1c4dec2 100644 --- a/content/browser/tab_contents/interstitial_page.h +++ b/content/browser/tab_contents/interstitial_page.h @@ -126,7 +126,7 @@ class InterstitialPage : public NotificationObserver, const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; virtual void UpdateTitle(RenderViewHost* render_view_host, int32 page_id, - const std::wstring& title) OVERRIDE; + const string16& title) OVERRIDE; virtual RendererPreferences GetRendererPrefs(Profile* profile) const OVERRIDE; // Invoked with the NavigationEntry that is going to be added to the @@ -225,7 +225,7 @@ class InterstitialPage : public NotificationObserver, // The original title of the tab that should be reverted to when the // interstitial is hidden. - std::wstring original_tab_title_; + string16 original_tab_title_; // Our RenderViewHostViewDelegate, necessary for accelerators to work. scoped_ptr<InterstitialPageRVHViewDelegate> rvh_view_delegate_; diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 0981985..090dd08 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -1229,7 +1229,7 @@ void TabContents::UpdateMaxPageIDIfNecessary(SiteInstance* site_instance, } bool TabContents::UpdateTitleForEntry(NavigationEntry* entry, - const std::wstring& title) { + const string16& title) { // For file URLs without a title, use the pathname instead. In the case of a // synthesized title, we don't want the update to count toward the "one set // per page of the title to history." @@ -1239,7 +1239,7 @@ bool TabContents::UpdateTitleForEntry(NavigationEntry* entry, final_title = UTF8ToUTF16(entry->url().ExtractFileName()); explicit_set = false; // Don't count synthetic titles toward the set limit. } else { - TrimWhitespace(WideToUTF16Hack(title), TRIM_ALL, &final_title); + TrimWhitespace(title, TRIM_ALL, &final_title); explicit_set = true; } @@ -1476,7 +1476,8 @@ void TabContents::UpdateState(RenderViewHost* rvh, } void TabContents::UpdateTitle(RenderViewHost* rvh, - int32 page_id, const std::wstring& title) { + int32 page_id, + const string16& title) { // If we have a title, that's a pretty good indication that we've started // getting useful data. SetNotWaitingForResponse(); diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h index 933871f..4e04552 100644 --- a/content/browser/tab_contents/tab_contents.h +++ b/content/browser/tab_contents/tab_contents.h @@ -602,7 +602,7 @@ class TabContents : public PageNavigator, // This is used as the backend for state updates, which include a new title, // or the dedicated set title message. It returns true if the new title is // different and was therefore updated. - bool UpdateTitleForEntry(NavigationEntry* entry, const std::wstring& title); + bool UpdateTitleForEntry(NavigationEntry* entry, const string16& title); // Causes the TabContents to navigate in the right renderer to |entry|, which // must be already part of the entries in the navigation controller. @@ -639,7 +639,7 @@ class TabContents : public PageNavigator, const std::string& state) OVERRIDE; virtual void UpdateTitle(RenderViewHost* render_view_host, int32 page_id, - const std::wstring& title) OVERRIDE; + const string16& title) OVERRIDE; virtual void UpdateEncoding(RenderViewHost* render_view_host, const std::string& encoding) OVERRIDE; virtual void UpdateTargetURL(int32 page_id, const GURL& url) OVERRIDE; diff --git a/content/common/view_messages.h b/content/common/view_messages.h index a5cab5f..0e04b50 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -1362,10 +1362,9 @@ IPC_MESSAGE_ROUTED1(ViewHostMsg_DidFinishLoad, // Changes the title for the page in the UI when the page is navigated or the // title changes. -// TODO(darin): use a UTF-8 string to reduce data size IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateTitle, int32, - std::wstring) + string16) // Changes the icon url for the page in the UI. IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateIconURL, diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc index d8f7be4..27495c4 100644 --- a/content/renderer/render_view.cc +++ b/content/renderer/render_view.cc @@ -1183,8 +1183,8 @@ void RenderView::UpdateTitle(WebFrame* frame, const string16& title) { Send(new ViewHostMsg_UpdateTitle( routing_id_, page_id_, - UTF16ToWideHack(title.length() > content::kMaxTitleChars ? - title.substr(0, content::kMaxTitleChars) : title))); + title.length() > content::kMaxTitleChars ? + title.substr(0, content::kMaxTitleChars) : title)); } } |