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/browser/views | |
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/browser/views')
-rw-r--r-- | chrome/browser/views/blocked_popup_container.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/bug_report_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/hung_renderer_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/location_bar_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/sad_tab_view.h | 3 | ||||
-rw-r--r-- | chrome/browser/views/star_toggle.h | 7 | ||||
-rw-r--r-- | chrome/browser/views/tab_icon_view.h | 9 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_renderer.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/toolbar_view.cc | 3 |
9 files changed, 19 insertions, 19 deletions
diff --git a/chrome/browser/views/blocked_popup_container.cc b/chrome/browser/views/blocked_popup_container.cc index 8dc96d6..8edf71e 100644 --- a/chrome/browser/views/blocked_popup_container.cc +++ b/chrome/browser/views/blocked_popup_container.cc @@ -298,10 +298,10 @@ int BlockedPopupContainer::GetTabContentsCount() const { std::wstring BlockedPopupContainer::GetDisplayStringForItem(int index) { const GURL& url = blocked_popups_[index].first->GetURL().GetOrigin(); - std::wstring label = - l10n_util::GetStringF(IDS_POPUP_TITLE_FORMAT, - UTF8ToWide(url.possibly_invalid_spec()), - blocked_popups_[index].first->GetTitle()); + std::wstring label = l10n_util::GetStringF( + IDS_POPUP_TITLE_FORMAT, + UTF8ToWide(url.possibly_invalid_spec()), + UTF16ToWideHack(blocked_popups_[index].first->GetTitle())); return label; } diff --git a/chrome/browser/views/bug_report_view.cc b/chrome/browser/views/bug_report_view.cc index 4b3a5fa..e1375f9 100644 --- a/chrome/browser/views/bug_report_view.cc +++ b/chrome/browser/views/bug_report_view.cc @@ -154,7 +154,7 @@ void BugReportView::SetupControl() { page_title_label_ = new views::Label( l10n_util::GetString(IDS_BUGREPORT_REPORT_PAGE_TITLE)); - page_title_text_ = new views::Label(tab_->GetTitle()); + page_title_text_ = new views::Label(UTF16ToWideHack(tab_->GetTitle())); page_url_label_ = new views::Label( l10n_util::GetString(IDS_BUGREPORT_REPORT_URL_LABEL)); // page_url_text_'s text (if any) is filled in after dialog creation diff --git a/chrome/browser/views/hung_renderer_view.cc b/chrome/browser/views/hung_renderer_view.cc index da026f9..590e8a8 100644 --- a/chrome/browser/views/hung_renderer_view.cc +++ b/chrome/browser/views/hung_renderer_view.cc @@ -82,7 +82,7 @@ int HungPagesTableModel::RowCount() { std::wstring HungPagesTableModel::GetText(int row, int column_id) { DCHECK(row >= 0 && row < RowCount()); - std::wstring title = webcontentses_.at(row)->GetTitle(); + std::wstring title = UTF16ToWideHack(webcontentses_.at(row)->GetTitle()); if (title.empty()) title = l10n_util::GetString(IDS_TAB_UNTITLED_TITLE); // TODO(xji): Consider adding a special case if the title text is a URL, diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index 8290b01..e12f4e2 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -322,7 +322,7 @@ SkBitmap LocationBarView::GetFavIcon() const { std::wstring LocationBarView::GetTitle() const { DCHECK(delegate_); DCHECK(delegate_->GetTabContents()); - return delegate_->GetTabContents()->GetTitle(); + return UTF16ToWideHack(delegate_->GetTabContents()->GetTitle()); } void LocationBarView::DoLayout(const bool force_layout) { diff --git a/chrome/browser/views/sad_tab_view.h b/chrome/browser/views/sad_tab_view.h index 15e7afe..be33df1 100644 --- a/chrome/browser/views/sad_tab_view.h +++ b/chrome/browser/views/sad_tab_view.h @@ -54,4 +54,5 @@ class SadTabView : public views::View { DISALLOW_EVIL_CONSTRUCTORS(SadTabView); }; -#endif // #ifndef CHROME_BROWSER_VIEWS_SAD_TAB_H_ +#endif // CHROME_BROWSER_VIEWS_SAD_TAB_H__ + diff --git a/chrome/browser/views/star_toggle.h b/chrome/browser/views/star_toggle.h index 95f64db..1475ab4 100644 --- a/chrome/browser/views/star_toggle.h +++ b/chrome/browser/views/star_toggle.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_VIEWS_STAR_TOGGLE_H__ -#define CHROME_BROWSER_VIEWS_STAR_TOGGLE_H__ +#ifndef CHROME_BROWSER_VIEWS_STAR_TOGGLE_H_ +#define CHROME_BROWSER_VIEWS_STAR_TOGGLE_H_ #include "chrome/views/view.h" #include "chrome/views/event.h" @@ -66,5 +66,4 @@ class StarToggle : public views::View { DISALLOW_EVIL_CONSTRUCTORS(StarToggle); }; -#endif // CHROME_BROWSER_VIEWS_STAR_TOGGLE_H__ - +#endif // CHROME_BROWSER_VIEWS_STAR_TOGGLE_H_ diff --git a/chrome/browser/views/tab_icon_view.h b/chrome/browser/views/tab_icon_view.h index 3a731fc..d210ba4 100644 --- a/chrome/browser/views/tab_icon_view.h +++ b/chrome/browser/views/tab_icon_view.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_VIEW_TAB_ICON_VIEW_H__ -#define CHROME_BROWSER_VIEW_TAB_ICON_VIEW_H__ +#ifndef CHROME_BROWSER_VIEW_TAB_ICON_VIEW_H_ +#define CHROME_BROWSER_VIEW_TAB_ICON_VIEW_H_ #include "chrome/views/view.h" @@ -66,8 +66,7 @@ class TabIconView : public views::View { // throbber_running_ is true. int throbber_frame_; - DISALLOW_EVIL_CONSTRUCTORS(TabIconView); + DISALLOW_COPY_AND_ASSIGN(TabIconView); }; -#endif // CHROME_BROWSER_VIEW_TAB_ICON_VIEW_H__ - +#endif // CHROME_BROWSER_VIEW_TAB_ICON_VIEW_H_ diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index 1580d05..ede0848 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -281,7 +281,7 @@ TabRenderer::~TabRenderer() { void TabRenderer::UpdateData(TabContents* contents) { DCHECK(contents); data_.favicon = contents->GetFavIcon(); - data_.title = contents->GetTitle(); + data_.title = UTF16ToWideHack(contents->GetTitle()); data_.loading = contents->is_loading(); data_.off_the_record = contents->profile()->IsOffTheRecord(); data_.show_icon = contents->ShouldDisplayFavIcon(); diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index 25c7161..f060135 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -770,7 +770,8 @@ void BrowserToolbarView::WriteDragData(views::View* sender, } } - drag_utils::SetURLAndDragImage(tab_->GetURL(), tab_->GetTitle(), + drag_utils::SetURLAndDragImage(tab_->GetURL(), + UTF16ToWideHack(tab_->GetTitle()), tab_->GetFavIcon(), data); } |