diff options
author | yosin@chromium.org <yosin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-28 08:12:42 +0000 |
---|---|---|
committer | yosin@chromium.org <yosin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-28 08:12:42 +0000 |
commit | 09e14d69cad45e0a11720793ad110545592f85ae (patch) | |
tree | 22c11a51cef32b725d1c6b3097d90e9c50413e8b /chrome/browser | |
parent | 1cf92d0f4fdd32481a23b3813ccaab2bd8221f39 (diff) | |
download | chromium_src-09e14d69cad45e0a11720793ad110545592f85ae.zip chromium_src-09e14d69cad45e0a11720793ad110545592f85ae.tar.gz chromium_src-09e14d69cad45e0a11720793ad110545592f85ae.tar.bz2 |
Change std::wstring to string16 on WidgetDelegate::GetWindowTitle.
BUG=68267
TEST=No visible changes
Review URL: http://codereview.chromium.org/7972009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
67 files changed, 275 insertions, 244 deletions
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index 3097018..95a0f38 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc @@ -93,7 +93,7 @@ void RecordBrowserStartupTime() { int AskForUninstallConfirmation() { int ret = content::RESULT_CODE_NORMAL_EXIT; - views::Widget::CreateWindow(new UninstallView(ret))->Show(); + views::Widget::CreateWindow(new UninstallView(&ret))->Show(); views::AcceleratorHandler accelerator_handler; MessageLoopForUI::current()->Run(&accelerator_handler); return ret; diff --git a/chrome/browser/chromeos/external_protocol_dialog.cc b/chrome/browser/chromeos/external_protocol_dialog.cc index 6d29e75..40650eb 100644 --- a/chrome/browser/chromeos/external_protocol_dialog.cc +++ b/chrome/browser/chromeos/external_protocol_dialog.cc @@ -58,8 +58,8 @@ std::wstring ExternalProtocolDialog::GetDialogButtonLabel( l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_OK_BUTTON_TEXT)); } -std::wstring ExternalProtocolDialog::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_TITLE)); +string16 ExternalProtocolDialog::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_TITLE); } void ExternalProtocolDialog::DeleteDelegate() { diff --git a/chrome/browser/chromeos/external_protocol_dialog.h b/chrome/browser/chromeos/external_protocol_dialog.h index 9043caa..d726b3b 100644 --- a/chrome/browser/chromeos/external_protocol_dialog.h +++ b/chrome/browser/chromeos/external_protocol_dialog.h @@ -6,6 +6,9 @@ #define CHROME_BROWSER_CHROMEOS_EXTERNAL_PROTOCOL_DIALOG_H_ #pragma once +#include <string> + +#include "base/string16.h" #include "base/time.h" #include "views/window/dialog_delegate.h" @@ -30,7 +33,7 @@ class ExternalProtocolDialog : public views::DialogDelegate { virtual int GetDialogButtons() const OVERRIDE; virtual std::wstring GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool Accept() OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; diff --git a/chrome/browser/chromeos/frame/bubble_frame_view.cc b/chrome/browser/chromeos/frame/bubble_frame_view.cc index 3efca019..fd5f0ed 100644 --- a/chrome/browser/chromeos/frame/bubble_frame_view.cc +++ b/chrome/browser/chromeos/frame/bubble_frame_view.cc @@ -4,6 +4,8 @@ #include "chrome/browser/chromeos/frame/bubble_frame_view.h" +#include <algorithm> + #include "chrome/browser/chromeos/frame/bubble_window.h" #include "chrome/browser/chromeos/login/helper.h" #include "grit/theme_resources_standard.h" @@ -54,7 +56,8 @@ BubbleFrameView::BubbleFrameView(views::Widget* frame, set_border(views::Border::CreateSolidBorder(kBorderThickness, kBorderColor)); if (widget_delegate->ShouldShowWindowTitle()) { - title_ = new views::Label(widget_delegate->GetWindowTitle()); + title_ = new views::Label( + UTF16ToWideHack(widget_delegate->GetWindowTitle())); title_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); title_->SetFont(title_->font().DeriveFont(kFontSizeCorrectionDelta, gfx::Font::BOLD)); @@ -93,7 +96,8 @@ void BubbleFrameView::StopThrobber() { DCHECK(throbber_ != NULL); throbber_->Stop(); if (title_) - title_->SetText(frame_->widget_delegate()->GetWindowTitle()); + title_->SetText( + UTF16ToWideHack(frame_->widget_delegate()->GetWindowTitle())); } gfx::Rect BubbleFrameView::GetBoundsForClientView() const { diff --git a/chrome/browser/chromeos/login/captcha_view.cc b/chrome/browser/chromeos/login/captcha_view.cc index 19b4e20..20f24cf 100644 --- a/chrome/browser/chromeos/login/captcha_view.cc +++ b/chrome/browser/chromeos/login/captcha_view.cc @@ -96,8 +96,8 @@ views::View* CaptchaView::GetContentsView() { return this; } -std::wstring CaptchaView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_LOGIN_CAPTCHA_DIALOG_TITLE)); +string16 CaptchaView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_LOGIN_CAPTCHA_DIALOG_TITLE); } void CaptchaView::SetCaptchaURL(const GURL& captcha_url) { diff --git a/chrome/browser/chromeos/login/captcha_view.h b/chrome/browser/chromeos/login/captcha_view.h index 764abde..3a901ce 100644 --- a/chrome/browser/chromeos/login/captcha_view.h +++ b/chrome/browser/chromeos/login/captcha_view.h @@ -43,10 +43,10 @@ class CaptchaView : public views::DialogDelegateView, virtual ~CaptchaView() {} // views::DialogDelegate: - virtual bool Accept(); - virtual bool IsModal() const; - virtual views::View* GetContentsView(); - virtual std::wstring GetWindowTitle() const; + virtual bool Accept() OVERRIDE; + virtual bool IsModal() const OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; // views::TextfieldController: virtual void ContentsChanged(views::Textfield* sender, diff --git a/chrome/browser/chromeos/login/eula_view.cc b/chrome/browser/chromeos/login/eula_view.cc index b28640e..ba74444 100644 --- a/chrome/browser/chromeos/login/eula_view.cc +++ b/chrome/browser/chromeos/login/eula_view.cc @@ -94,17 +94,16 @@ class TpmInfoView : public views::DialogDelegateView { protected: // views::DialogDelegateView overrides: - virtual bool Accept() { return true; } - virtual bool IsModal() const { return true; } - virtual views::View* GetContentsView() { return this; } - virtual int GetDialogButtons() const { + virtual bool Accept() OVERRIDE { return true; } + virtual bool IsModal() const OVERRIDE { return true; } + virtual views::View* GetContentsView() OVERRIDE { return this; } + virtual int GetDialogButtons() const OVERRIDE { return MessageBoxFlags::DIALOGBUTTON_OK; } // views::View overrides: - virtual std::wstring GetWindowTitle() const { - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_EULA_SYSTEM_SECURITY_SETTING)); + virtual string16 GetWindowTitle() const OVERRIDE { + return l10n_util::GetStringUTF16(IDS_EULA_SYSTEM_SECURITY_SETTING); } gfx::Size GetPreferredSize() { diff --git a/chrome/browser/chromeos/login/password_changed_view.cc b/chrome/browser/chromeos/login/password_changed_view.cc index f2328e2..131c3c2 100644 --- a/chrome/browser/chromeos/login/password_changed_view.cc +++ b/chrome/browser/chromeos/login/password_changed_view.cc @@ -48,7 +48,7 @@ bool PasswordChangedView::Accept() { } int PasswordChangedView::GetDialogButtons() const { - return MessageBoxFlags::DIALOGBUTTON_OK; + return MessageBoxFlags::DIALOGBUTTON_OK; } views::View* PasswordChangedView::GetInitiallyFocusedView() { @@ -68,9 +68,9 @@ views::View* PasswordChangedView::GetContentsView() { return this; } -std::wstring PasswordChangedView::GetWindowTitle() const { - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_LOGIN_PASSWORD_CHANGED_DIALOG_BOX_TITLE)); +string16 PasswordChangedView::GetWindowTitle() const { + return l10n_util::GetStringUTF16( + IDS_LOGIN_PASSWORD_CHANGED_DIALOG_BOX_TITLE); } gfx::Size PasswordChangedView::GetPreferredSize() { @@ -171,7 +171,6 @@ void PasswordChangedView::Init() { delta_sync_radio_->SetChecked(true); old_password_field_->SetEnabled(true); } - } bool PasswordChangedView::ExitDialog() { diff --git a/chrome/browser/chromeos/login/password_changed_view.h b/chrome/browser/chromeos/login/password_changed_view.h index c0bff39..ae135cf 100644 --- a/chrome/browser/chromeos/login/password_changed_view.h +++ b/chrome/browser/chromeos/login/password_changed_view.h @@ -45,26 +45,26 @@ class PasswordChangedView : public views::DialogDelegateView, virtual ~PasswordChangedView() {} // views::DialogDelegate: - virtual bool Accept(); - virtual int GetDialogButtons() const; + virtual bool Accept() OVERRIDE; + virtual int GetDialogButtons() const OVERRIDE; // views::WidgetDelegate: - virtual View* GetInitiallyFocusedView(); - virtual bool IsModal() const; - virtual views::View* GetContentsView(); + virtual View* GetInitiallyFocusedView() OVERRIDE; + virtual bool IsModal() const OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; // views::View: - virtual std::wstring GetWindowTitle() const; + virtual string16 GetWindowTitle() const OVERRIDE; // views::ButtonListener: virtual void ButtonPressed(views::Button* sender, - const views::Event& event); + const views::Event& event) OVERRIDE; // views::TextfieldController: virtual bool HandleKeyEvent(views::Textfield* sender, - const views::KeyEvent& keystroke); + const views::KeyEvent& keystroke) OVERRIDE; virtual void ContentsChanged(views::Textfield* sender, - const string16& new_contents) {} + const string16& new_contents) OVERRIDE {} protected: // views::View: diff --git a/chrome/browser/chromeos/native_dialog_window.cc b/chrome/browser/chromeos/native_dialog_window.cc index f068649..b6ca24b 100644 --- a/chrome/browser/chromeos/native_dialog_window.cc +++ b/chrome/browser/chromeos/native_dialog_window.cc @@ -59,12 +59,13 @@ class NativeDialogHost : public views::DialogDelegateView { ~NativeDialogHost(); // views::DialogDelegate implementation: - virtual bool CanResize() const { return flags_ & DIALOG_FLAG_RESIZEABLE; } - virtual int GetDialogButtons() const { return 0; } - virtual std::wstring GetWindowTitle() const { return title_; } - virtual views::View* GetContentsView() { return this; } - virtual bool IsModal() const { return flags_ & DIALOG_FLAG_MODAL; } - virtual void WindowClosing(); + virtual bool CanResize() const OVERRIDE + { return flags_ & DIALOG_FLAG_RESIZEABLE; } + virtual int GetDialogButtons() const OVERRIDE { return 0; } + virtual string16 GetWindowTitle() const OVERRIDE { return title_; } + virtual views::View* GetContentsView() OVERRIDE { return this; } + virtual bool IsModal() const OVERRIDE { return flags_ & DIALOG_FLAG_MODAL; } + virtual void WindowClosing() OVERRIDE; protected: CHROMEGTK_CALLBACK_0(NativeDialogHost, void, OnCheckResize); @@ -72,11 +73,12 @@ class NativeDialogHost : public views::DialogDelegateView { CHROMEGTK_CALLBACK_1(NativeDialogHost, gboolean, OnGtkKeyPressed, GdkEvent*); // views::View implementation: - virtual gfx::Size GetPreferredSize(); - virtual void Layout(); + virtual gfx::Size GetPreferredSize() OVERRIDE; + virtual void Layout() OVERRIDE; virtual void ViewHierarchyChanged(bool is_add, views::View* parent, - views::View* child); + views::View* child) OVERRIDE; + private: // Init and attach to native dialog. void Init(); @@ -93,7 +95,7 @@ class NativeDialogHost : public views::DialogDelegateView { // NativeViewHost for the dialog's contents. views::NativeViewHost* contents_view_; - std::wstring title_; + string16 title_; int flags_; gfx::Size size_; gfx::Size preferred_size_; @@ -120,7 +122,7 @@ NativeDialogHost::NativeDialogHost(gfx::NativeView native_dialog, destroy_signal_id_(0) { const char* title = gtk_window_get_title(GTK_WINDOW(dialog_)); if (title) - UTF8ToWide(title, strlen(title), &title_); + UTF8ToUTF16(title, strlen(title), &title_); destroy_signal_id_ = g_signal_connect(dialog_, "destroy", G_CALLBACK(&OnDialogDestroyThunk), this); diff --git a/chrome/browser/chromeos/options/network_config_view.cc b/chrome/browser/chromeos/options/network_config_view.cc index 50034d58..bfe04b5 100644 --- a/chrome/browser/chromeos/options/network_config_view.cc +++ b/chrome/browser/chromeos/options/network_config_view.cc @@ -105,8 +105,8 @@ views::View* NetworkConfigView::GetContentsView() { return this; } -std::wstring NetworkConfigView::GetWindowTitle() const { - return UTF16ToWide(child_config_view_->GetTitle()); +string16 NetworkConfigView::GetWindowTitle() const { + return child_config_view_->GetTitle(); } void NetworkConfigView::GetAccessibleState(ui::AccessibleViewState* state) { diff --git a/chrome/browser/chromeos/options/network_config_view.h b/chrome/browser/chromeos/options/network_config_view.h index da5a427..672b83e 100644 --- a/chrome/browser/chromeos/options/network_config_view.h +++ b/chrome/browser/chromeos/options/network_config_view.h @@ -6,6 +6,9 @@ #define CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ #pragma once +#include <string> + +#include "base/string16.h" #include "chrome/browser/chromeos/cros/network_library.h" #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow #include "views/controls/button/button.h" // views::ButtonListener @@ -57,7 +60,7 @@ class NetworkConfigView : public views::DialogDelegateView, // views::WidgetDelegate methods. virtual bool IsModal() const OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; // views::View overrides. virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; diff --git a/chrome/browser/ui/input_window_dialog_win.cc b/chrome/browser/ui/input_window_dialog_win.cc index 06fd3a8..f6d716b 100644 --- a/chrome/browser/ui/input_window_dialog_win.cc +++ b/chrome/browser/ui/input_window_dialog_win.cc @@ -70,13 +70,13 @@ class ContentView : public views::DialogDelegateView, virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; virtual void DeleteDelegate() OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual bool IsModal() const OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; // views::TextfieldController: virtual void ContentsChanged(views::Textfield* sender, - const std::wstring& new_contents) OVERRIDE; + const string16& new_contents) OVERRIDE; virtual bool HandleKeyEvent(views::Textfield*, const views::KeyEvent&) OVERRIDE; @@ -140,8 +140,8 @@ void ContentView::DeleteDelegate() { delete delegate_; } -std::wstring ContentView::GetWindowTitle() const { - return UTF16ToWideHack(delegate_->window_title()); +string16 ContentView::GetWindowTitle() const { + return delegate_->window_title(); } bool ContentView::IsModal() const { @@ -156,7 +156,7 @@ views::View* ContentView::GetContentsView() { // ContentView, views::TextfieldController implementation: void ContentView::ContentsChanged(views::Textfield* sender, - const std::wstring& new_contents) { + const string16& new_contents) { GetDialogClientView()->UpdateDialogButtons(); } diff --git a/chrome/browser/ui/login/login_prompt_win.cc b/chrome/browser/ui/login/login_prompt_win.cc index fc91ade..1a9a449 100644 --- a/chrome/browser/ui/login/login_prompt_win.cc +++ b/chrome/browser/ui/login/login_prompt_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -49,7 +49,7 @@ class LoginHandlerWin : public LoginHandler, return DialogDelegate::GetDialogButtonLabel(button); } - virtual std::wstring GetWindowTitle() const OVERRIDE { + virtual string16 GetWindowTitle() const OVERRIDE { return l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_TITLE); } diff --git a/chrome/browser/ui/panels/panel_browser_frame_view.cc b/chrome/browser/ui/panels/panel_browser_frame_view.cc index b28bc59..154f375 100644 --- a/chrome/browser/ui/panels/panel_browser_frame_view.cc +++ b/chrome/browser/ui/panels/panel_browser_frame_view.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/panels/panel_browser_frame_view.h" +#include <algorithm> + #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/ui/panels/panel.h" #include "chrome/browser/ui/panels/panel_browser_view.h" @@ -143,7 +145,7 @@ void EnsureResourcesInitialized() { LoadImageResources(); } -} // namespace +} // namespace // PanelBrowserFrameView::MouseWatcher ----------------------------------------- @@ -630,7 +632,8 @@ void PanelBrowserFrameView::PaintClientEdge(gfx::Canvas* canvas) { } void PanelBrowserFrameView::UpdateTitleBar() { - title_label_->SetText(frame_->widget_delegate()->GetWindowTitle()); + title_label_->SetText( + UTF16ToWideHack(frame_->widget_delegate()->GetWindowTitle())); } void PanelBrowserFrameView::OnFocusChanged(bool focused) { diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc index 2bf41d6..a36802a 100644 --- a/chrome/browser/ui/views/about_chrome_view.cc +++ b/chrome/browser/ui/views/about_chrome_view.cc @@ -517,8 +517,8 @@ std::wstring AboutChromeView::GetDialogButtonLabel( return L""; } -std::wstring AboutChromeView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE)); +string16 AboutChromeView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_ABOUT_CHROME_TITLE); } bool AboutChromeView::IsDialogButtonEnabled( @@ -591,7 +591,7 @@ void AboutChromeView::LinkClicked(views::Link* source, int event_flags) { void AboutChromeView::OnReportResults(GoogleUpdateUpgradeResult result, GoogleUpdateErrorCode error_code, - const std::wstring& version) { + const string16& version) { // Drop the last reference to the object so that it gets cleaned up here. google_updater_ = NULL; diff --git a/chrome/browser/ui/views/about_chrome_view.h b/chrome/browser/ui/views/about_chrome_view.h index e28b8e7..2bb2467 100644 --- a/chrome/browser/ui/views/about_chrome_view.h +++ b/chrome/browser/ui/views/about_chrome_view.h @@ -66,7 +66,7 @@ class AboutChromeView : public views::DialogDelegateView, virtual bool CanResize() const OVERRIDE; virtual bool CanMaximize() const OVERRIDE; virtual bool IsModal() const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual bool Accept() OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; diff --git a/chrome/browser/ui/views/about_ipc_dialog.cc b/chrome/browser/ui/views/about_ipc_dialog.cc index 266a989..a0a0bfb 100644 --- a/chrome/browser/ui/views/about_ipc_dialog.cc +++ b/chrome/browser/ui/views/about_ipc_dialog.cc @@ -265,8 +265,8 @@ int AboutIPCDialog::GetDialogButtons() const { return 0; } -std::wstring AboutIPCDialog::GetWindowTitle() const { - return L"about:ipc"; +string16 AboutIPCDialog::GetWindowTitle() const { + return ASCIIToUTF16("about:ipc"); } void AboutIPCDialog::Layout() { diff --git a/chrome/browser/ui/views/about_ipc_dialog.h b/chrome/browser/ui/views/about_ipc_dialog.h index f405e52..2906fcd 100644 --- a/chrome/browser/ui/views/about_ipc_dialog.h +++ b/chrome/browser/ui/views/about_ipc_dialog.h @@ -45,20 +45,21 @@ class AboutIPCDialog : public views::DialogDelegateView, void SetupControls(); // views::View overrides. - virtual gfx::Size GetPreferredSize(); - virtual views::View* GetContentsView(); - virtual int GetDialogButtons() const; - virtual std::wstring GetWindowTitle() const; - virtual void Layout(); + virtual gfx::Size GetPreferredSize() OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; + virtual int GetDialogButtons() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; + virtual void Layout() OVERRIDE; // IPC::Logging::Consumer implementation. - virtual void Log(const IPC::LogData& data); + virtual void Log(const IPC::LogData& data) OVERRIDE; // views::WidgetDelegate (via views::DialogDelegateView). - virtual bool CanResize() const; + virtual bool CanResize() const OVERRIDE; // views::ButtonListener. - virtual void ButtonPressed(views::Button* button, const views::Event& event); + virtual void ButtonPressed(views::Button* button, + const views::Event& event) OVERRIDE; WTL::CListViewCtrl message_list_; diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc index fd3fead..5899988 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h" +#include <string> + #include "base/basictypes.h" #include "base/logging.h" #include "base/string_util.h" @@ -105,8 +107,8 @@ bool BookmarkEditorView::CanResize() const { return true; } -std::wstring BookmarkEditorView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_TITLE)); +string16 BookmarkEditorView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_TITLE); } bool BookmarkEditorView::Accept() { @@ -183,7 +185,7 @@ bool BookmarkEditorView::CanEdit(views::TreeView* tree_view, } void BookmarkEditorView::ContentsChanged(views::Textfield* sender, - const std::wstring& new_contents) { + const string16& new_contents) { UserInputChanged(); } diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h index b5a07e3..bf2e152 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h @@ -6,6 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_EDITOR_VIEW_H_ #pragma once +#include <vector> + #include "base/compiler_specific.h" #include "base/string16.h" #include "chrome/browser/bookmarks/bookmark_editor.h" @@ -80,42 +82,47 @@ class BookmarkEditorView : public BookmarkEditor, // DialogDelegate methods: virtual bool IsDialogButtonEnabled( - MessageBoxFlags::DialogButton button) const; - virtual bool IsModal() const; - virtual bool CanResize() const; - virtual std::wstring GetWindowTitle() const; - virtual bool Accept(); - virtual bool AreAcceleratorsEnabled(MessageBoxFlags::DialogButton button); - virtual views::View* GetContentsView(); + MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual bool IsModal() const OVERRIDE; + virtual bool CanResize() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; + virtual bool Accept() OVERRIDE; + virtual bool AreAcceleratorsEnabled( + MessageBoxFlags::DialogButton button) OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; // views::View. - virtual void Layout(); - virtual gfx::Size GetPreferredSize(); + virtual void Layout() OVERRIDE; + virtual gfx::Size GetPreferredSize() OVERRIDE; virtual void ViewHierarchyChanged(bool is_add, views::View* parent, - views::View* child); + views::View* child) OVERRIDE; // views::TreeViewObserver. - virtual void OnTreeViewSelectionChanged(views::TreeView* tree_view); - virtual bool CanEdit(views::TreeView* tree_view, ui::TreeModelNode* node); + virtual void OnTreeViewSelectionChanged( + views::TreeView* tree_view) OVERRIDE; + virtual bool CanEdit(views::TreeView* tree_view, + ui::TreeModelNode* node) OVERRIDE; // views::TextfieldController: virtual void ContentsChanged(views::Textfield* sender, - const std::wstring& new_contents); + const string16& new_contents) OVERRIDE; virtual bool HandleKeyEvent(views::Textfield* sender, - const views::KeyEvent& key_event) { + const views::KeyEvent& key_event) OVERRIDE { return false; } // views::ButtonListener: - virtual void ButtonPressed(views::Button* sender, const views::Event& event); + virtual void ButtonPressed(views::Button* sender, + const views::Event& event) OVERRIDE; // ui::SimpleMenuModel::Delegate: - virtual bool IsCommandIdChecked(int command_id) const; - virtual bool IsCommandIdEnabled(int command_id) const; - virtual bool GetAcceleratorForCommandId(int command_id, - ui::Accelerator* accelerator); - virtual void ExecuteCommand(int command_id); + virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; + virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; + virtual bool GetAcceleratorForCommandId( + int command_id, + ui::Accelerator* accelerator) OVERRIDE; + virtual void ExecuteCommand(int command_id) OVERRIDE; // Creates a Window and adds the BookmarkEditorView to it. When the window is // closed the BookmarkEditorView is deleted. diff --git a/chrome/browser/ui/views/collected_cookies_win.cc b/chrome/browser/ui/views/collected_cookies_win.cc index 7aee53b..67d2987 100644 --- a/chrome/browser/ui/views/collected_cookies_win.cc +++ b/chrome/browser/ui/views/collected_cookies_win.cc @@ -353,9 +353,8 @@ views::View* CollectedCookiesWin::CreateBlockedPane() { /////////////////////////////////////////////////////////////////////////////// // views::DialogDelegate implementation. -std::wstring CollectedCookiesWin::GetWindowTitle() const { - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_DIALOG_TITLE)); +string16 CollectedCookiesWin::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_DIALOG_TITLE); } int CollectedCookiesWin::GetDialogButtons() const { diff --git a/chrome/browser/ui/views/collected_cookies_win.h b/chrome/browser/ui/views/collected_cookies_win.h index 713222e..6a3202a 100644 --- a/chrome/browser/ui/views/collected_cookies_win.h +++ b/chrome/browser/ui/views/collected_cookies_win.h @@ -45,7 +45,7 @@ class CollectedCookiesWin : public views::DialogDelegate, TabContentsWrapper* wrapper); // views::DialogDelegate: - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual int GetDialogButtons() const OVERRIDE; virtual std::wstring GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const OVERRIDE; diff --git a/chrome/browser/ui/views/constrained_html_delegate_views.cc b/chrome/browser/ui/views/constrained_html_delegate_views.cc index 3c9b5d2..74c2dbe2 100644 --- a/chrome/browser/ui/views/constrained_html_delegate_views.cc +++ b/chrome/browser/ui/views/constrained_html_delegate_views.cc @@ -45,8 +45,8 @@ class ConstrainedHtmlDelegateViews : public TabContentsContainer, return View::GetWidget(); } - virtual std::wstring GetWindowTitle() const OVERRIDE { - return UTF16ToWideHack(html_delegate_->GetDialogTitle()); + virtual string16 GetWindowTitle() const OVERRIDE { + return html_delegate_->GetDialogTitle(); } // HtmlDialogTabContentsDelegate interface. diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc index 0589557..9c6c252 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.cc +++ b/chrome/browser/ui/views/create_application_shortcut_view.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/create_application_shortcut_view.h" +#include <algorithm> + #include "base/callback.h" #include "base/utf_string_conversions.h" #include "base/win/windows_version.h" @@ -150,7 +152,7 @@ void AppInfoView::SetupLayout() { void AppInfoView::UpdateText(const string16& title, const string16& description) { - title_->SetText(UTF16ToWide(title)); + title_->SetText(UTF16ToWideHack(title)); PrepareDescriptionLabel(description); SetupLayout(); @@ -354,8 +356,8 @@ bool CreateApplicationShortcutView::IsModal() const { return true; } -std::wstring CreateApplicationShortcutView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_TITLE)); +string16 CreateApplicationShortcutView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_TITLE); } bool CreateApplicationShortcutView::Accept() { @@ -482,7 +484,6 @@ CreateChromeApplicationShortcutView::CreateChromeApplicationShortcutView( CreateApplicationShortcutView(profile), app_(app), ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) { - shortcut_info_.extension_id = app_->id(); shortcut_info_.url = GURL(app_->launch_web_url()); shortcut_info_.title = UTF8ToUTF16(app_->name()); @@ -517,7 +518,6 @@ CreateChromeApplicationShortcutView::CreateChromeApplicationShortcutView( icon_resource, max_size, ImageLoadingTracker::DONT_CACHE); - } CreateChromeApplicationShortcutView::~CreateChromeApplicationShortcutView() {} diff --git a/chrome/browser/ui/views/create_application_shortcut_view.h b/chrome/browser/ui/views/create_application_shortcut_view.h index 17ca482..a019545 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.h +++ b/chrome/browser/ui/views/create_application_shortcut_view.h @@ -40,22 +40,23 @@ class CreateApplicationShortcutView : public views::DialogDelegateView, void InitControls(); // Overridden from views::View: - virtual gfx::Size GetPreferredSize(); + virtual gfx::Size GetPreferredSize() OVERRIDE; // Overridden from views::DialogDelegate: virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const; + MessageBoxFlags::DialogButton button) const OVERRIDE; virtual bool IsDialogButtonEnabled( - MessageBoxFlags::DialogButton button) const; - virtual bool CanResize() const; - virtual bool CanMaximize() const; - virtual bool IsModal() const; - virtual std::wstring GetWindowTitle() const; - virtual bool Accept(); - virtual views::View* GetContentsView(); + MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual bool CanResize() const OVERRIDE; + virtual bool CanMaximize() const OVERRIDE; + virtual bool IsModal() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; + virtual bool Accept() OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; // Overridden from views::ButtonListener: - virtual void ButtonPressed(views::Button* sender, const views::Event& event); + virtual void ButtonPressed(views::Button* sender, + const views::Event& event) OVERRIDE; protected: // Adds a new check-box as a child to the view. @@ -108,7 +109,7 @@ class CreateUrlApplicationShortcutView : public CreateApplicationShortcutView { // Create an application shortcut pointing to a chrome application. class CreateChromeApplicationShortcutView - : public CreateApplicationShortcutView, + : public CreateApplicationShortcutView, public ImageLoadingTracker::Observer { public: CreateChromeApplicationShortcutView(Profile* profile, const Extension* app); diff --git a/chrome/browser/ui/views/default_search_view.cc b/chrome/browser/ui/views/default_search_view.cc index 6f7e30c..098564b 100644 --- a/chrome/browser/ui/views/default_search_view.cc +++ b/chrome/browser/ui/views/default_search_view.cc @@ -144,8 +144,8 @@ void DefaultSearchView::ButtonPressed(views::Button* sender, client->CancelWindow(); } -std::wstring DefaultSearchView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_DEFAULT_SEARCH_TITLE)); +string16 DefaultSearchView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_DEFAULT_SEARCH_TITLE); } views::View* DefaultSearchView::GetInitiallyFocusedView() { diff --git a/chrome/browser/ui/views/default_search_view.h b/chrome/browser/ui/views/default_search_view.h index f99e37a..aaa96f2 100644 --- a/chrome/browser/ui/views/default_search_view.h +++ b/chrome/browser/ui/views/default_search_view.h @@ -57,13 +57,13 @@ class DefaultSearchView // views::DialogDelegate: // TODO(beng): Figure out why adding OVERRIDE to these methods annoys Clang. - virtual std::wstring GetWindowTitle() const; - virtual views::View* GetInitiallyFocusedView(); - virtual views::View* GetContentsView(); - virtual int GetDialogButtons() const; - virtual bool Accept(); - virtual views::Widget* GetWidget(); - virtual const views::Widget* GetWidget() const; + virtual string16 GetWindowTitle() const OVERRIDE; + virtual views::View* GetInitiallyFocusedView() OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; + virtual int GetDialogButtons() const OVERRIDE; + virtual bool Accept() OVERRIDE; + virtual views::Widget* GetWidget() OVERRIDE; + virtual const views::Widget* GetWidget() const OVERRIDE; private: // Takes ownership of |proposed_default_turl|. diff --git a/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc b/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc index e3ba82a..4cadace 100644 --- a/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc +++ b/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" +#include <algorithm> + #include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/profiles/profile.h" @@ -122,8 +124,8 @@ bool DownloadInProgressDialogView::IsModal() const { return true; } -std::wstring DownloadInProgressDialogView::GetWindowTitle() const { - return UTF16ToWideHack(product_name_); +string16 DownloadInProgressDialogView::GetWindowTitle() const { + return product_name_; } views::View* DownloadInProgressDialogView::GetContentsView() { diff --git a/chrome/browser/ui/views/download/download_in_progress_dialog_view.h b/chrome/browser/ui/views/download/download_in_progress_dialog_view.h index 4d51f74..c65d06a 100644 --- a/chrome/browser/ui/views/download/download_in_progress_dialog_view.h +++ b/chrome/browser/ui/views/download/download_in_progress_dialog_view.h @@ -40,7 +40,7 @@ class DownloadInProgressDialogView : public views::DialogDelegateView { virtual bool Cancel() OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool IsModal() const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; Browser* browser_; diff --git a/chrome/browser/ui/views/edit_search_engine_dialog.cc b/chrome/browser/ui/views/edit_search_engine_dialog.cc index 13e596c..9d75625 100644 --- a/chrome/browser/ui/views/edit_search_engine_dialog.cc +++ b/chrome/browser/ui/views/edit_search_engine_dialog.cc @@ -77,10 +77,10 @@ bool EditSearchEngineDialog::IsModal() const { return true; } -std::wstring EditSearchEngineDialog::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(controller_->template_url() ? +string16 EditSearchEngineDialog::GetWindowTitle() const { + return l10n_util::GetStringUTF16(controller_->template_url() ? IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE : - IDS_SEARCH_ENGINES_EDITOR_NEW_WINDOW_TITLE)); + IDS_SEARCH_ENGINES_EDITOR_NEW_WINDOW_TITLE); } bool EditSearchEngineDialog::IsDialogButtonEnabled( @@ -260,7 +260,7 @@ void EditSearchEngineDialog::UpdateImageView(ImageView* image_view, ResourceBundle::GetSharedInstance().GetBitmapNamed( IDR_INPUT_GOOD)); } else { - image_view->SetTooltipText(l10n_util::GetStringUTF16(invalid_message_id)) ; + image_view->SetTooltipText(l10n_util::GetStringUTF16(invalid_message_id)); image_view->SetImage( ResourceBundle::GetSharedInstance().GetBitmapNamed( IDR_INPUT_ALERT)); diff --git a/chrome/browser/ui/views/edit_search_engine_dialog.h b/chrome/browser/ui/views/edit_search_engine_dialog.h index b944fac..9307936 100644 --- a/chrome/browser/ui/views/edit_search_engine_dialog.h +++ b/chrome/browser/ui/views/edit_search_engine_dialog.h @@ -43,13 +43,13 @@ class EditSearchEngineDialog : public views::TextfieldController, Profile* profile); // views::DialogDelegate: - virtual bool IsModal() const; - virtual std::wstring GetWindowTitle() const; + virtual bool IsModal() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual bool IsDialogButtonEnabled( - MessageBoxFlags::DialogButton button) const; - virtual bool Cancel(); - virtual bool Accept(); - virtual views::View* GetContentsView(); + MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual bool Cancel() OVERRIDE; + virtual bool Accept() OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; // views::TextfieldController: // Updates whether the user can accept the dialog as well as updating image diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc index 58b4551..45a27f6 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc @@ -79,7 +79,7 @@ class ExtensionInstallDialogView : public views::DialogDelegateView, // views::WidgetDelegate: virtual bool IsModal() const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; // views::LinkListener: @@ -148,16 +148,16 @@ ExtensionInstallDialogView::ExtensionInstallDialogView( column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, - 0, // no resizing + 0, // no resizing GridLayout::USE_PREF, - 0, // no fixed with + 0, // no fixed with left_column_width); column_set->AddPaddingColumn(0, views::kPanelHorizMargin); column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, - 0, // no resizing + 0, // no resizing GridLayout::USE_PREF, - 0, // no fixed width + 0, // no fixed width kIconSize); layout->StartRow(0, column_set_id); @@ -289,8 +289,8 @@ bool ExtensionInstallDialogView::IsModal() const { return true; } -std::wstring ExtensionInstallDialogView::GetWindowTitle() const { - return UTF16ToWide(prompt_.GetDialogTitle()); +string16 ExtensionInstallDialogView::GetWindowTitle() const { + return prompt_.GetDialogTitle(); } views::View* ExtensionInstallDialogView::GetContentsView() { diff --git a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc index 6af6ff5..0e196e3 100644 --- a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc @@ -79,7 +79,7 @@ class ExtensionUninstallDialogDelegateView : public views::DialogDelegateView { // views::WidgetDelegate: virtual bool IsModal() const OVERRIDE { return true; } virtual views::View* GetContentsView() OVERRIDE { return this; } - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; // views::View: virtual gfx::Size GetPreferredSize() OVERRIDE; @@ -185,9 +185,8 @@ bool ExtensionUninstallDialogDelegateView::Cancel() { return true; } -std::wstring ExtensionUninstallDialogDelegateView::GetWindowTitle() const { - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_EXTENSION_UNINSTALL_PROMPT_TITLE)); +string16 ExtensionUninstallDialogDelegateView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_EXTENSION_UNINSTALL_PROMPT_TITLE); } diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc index 8f738c0..b542612 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.cc +++ b/chrome/browser/ui/views/external_protocol_dialog.cc @@ -69,8 +69,8 @@ std::wstring ExternalProtocolDialog::GetDialogButtonLabel( l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CANCEL_BUTTON_TEXT)); } -std::wstring ExternalProtocolDialog::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_TITLE)); +string16 ExternalProtocolDialog::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_TITLE); } void ExternalProtocolDialog::DeleteDelegate() { diff --git a/chrome/browser/ui/views/external_protocol_dialog.h b/chrome/browser/ui/views/external_protocol_dialog.h index d4bf035..1abc502 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.h +++ b/chrome/browser/ui/views/external_protocol_dialog.h @@ -35,7 +35,7 @@ class ExternalProtocolDialog : public views::DialogDelegate { virtual int GetDefaultDialogButton() const OVERRIDE; virtual std::wstring GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool Cancel() OVERRIDE; virtual bool Accept() OVERRIDE; diff --git a/chrome/browser/ui/views/first_run_search_engine_view.cc b/chrome/browser/ui/views/first_run_search_engine_view.cc index 443cbbc..f3a9005 100644 --- a/chrome/browser/ui/views/first_run_search_engine_view.cc +++ b/chrome/browser/ui/views/first_run_search_engine_view.cc @@ -166,8 +166,8 @@ FirstRunSearchEngineView::~FirstRunSearchEngineView() { search_engines_model_->RemoveObserver(this); } -std::wstring FirstRunSearchEngineView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_FIRSTRUN_DLG_TITLE)); +string16 FirstRunSearchEngineView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_FIRSTRUN_DLG_TITLE); } void FirstRunSearchEngineView::ButtonPressed(views::Button* sender, diff --git a/chrome/browser/ui/views/first_run_search_engine_view.h b/chrome/browser/ui/views/first_run_search_engine_view.h index 5b59531..f160aed 100644 --- a/chrome/browser/ui/views/first_run_search_engine_view.h +++ b/chrome/browser/ui/views/first_run_search_engine_view.h @@ -84,7 +84,7 @@ class FirstRunSearchEngineView : public views::WidgetDelegateView, virtual ~FirstRunSearchEngineView(); // Overridden from views::WidgetDelegateView: - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual views::View* GetContentsView() OVERRIDE { return this; } // Overridden from views::ButtonListener: diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 9b35e6c..374305a 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -8,6 +8,8 @@ #include <gtk/gtk.h> #endif +#include <algorithm> + #include "base/auto_reset.h" #include "base/command_line.h" #include "base/i18n/rtl.h" @@ -1525,15 +1527,15 @@ bool BrowserView::IsModal() const { return false; } -std::wstring BrowserView::GetWindowTitle() const { - return UTF16ToWideHack(browser_->GetWindowTitleForCurrentTab()); +string16 BrowserView::GetWindowTitle() const { + return browser_->GetWindowTitleForCurrentTab(); } -std::wstring BrowserView::GetAccessibleWindowTitle() const { +string16 BrowserView::GetAccessibleWindowTitle() const { if (IsOffTheRecord()) { - return UTF16ToWide(l10n_util::GetStringFUTF16( + return l10n_util::GetStringFUTF16( IDS_ACCESSIBLE_INCOGNITO_WINDOW_TITLE_FORMAT, - WideToUTF16(GetWindowTitle()))); + GetWindowTitle()); } return GetWindowTitle(); } diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h index 5268299..713333e 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -362,8 +362,8 @@ class BrowserView : public BrowserBubbleHost, virtual bool CanMaximize() const OVERRIDE; virtual bool CanActivate() const OVERRIDE; virtual bool IsModal() const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; - virtual std::wstring GetAccessibleWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; + virtual string16 GetAccessibleWindowTitle() const OVERRIDE; virtual views::View* GetInitiallyFocusedView() OVERRIDE; virtual bool ShouldShowWindowTitle() const OVERRIDE; virtual SkBitmap GetWindowAppIcon() OVERRIDE; diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc index 7db639e..b52d671 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc @@ -4,6 +4,9 @@ #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" +#include <algorithm> +#include <string> + #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/utf_string_conversions.h" @@ -112,7 +115,6 @@ bool ConvertedContainsCheck(gfx::Rect bounds, const views::View* src, bounds.set_origin(origin); return bounds.Contains(pt); } - } /////////////////////////////////////////////////////////////////////////////// @@ -742,7 +744,7 @@ void OpaqueBrowserFrameView::PaintTitleBar(gfx::Canvas* canvas) { return; } if (delegate->ShouldShowWindowTitle()) { - canvas->DrawStringInt(WideToUTF16Hack(delegate->GetWindowTitle()), + canvas->DrawStringInt(delegate->GetWindowTitle(), BrowserFrame::GetTitleFont(), SK_ColorWHITE, GetMirroredXForRect(title_bounds_), title_bounds_.y(), title_bounds_.width(), title_bounds_.height()); diff --git a/chrome/browser/ui/views/html_dialog_view.cc b/chrome/browser/ui/views/html_dialog_view.cc index b4a50a8..54493c9 100644 --- a/chrome/browser/ui/views/html_dialog_view.cc +++ b/chrome/browser/ui/views/html_dialog_view.cc @@ -98,10 +98,10 @@ bool HtmlDialogView::IsModal() const { return false; } -std::wstring HtmlDialogView::GetWindowTitle() const { +string16 HtmlDialogView::GetWindowTitle() const { if (delegate_) - return UTF16ToWideHack(delegate_->GetDialogTitle()); - return std::wstring(); + return delegate_->GetDialogTitle(); + return string16(); } void HtmlDialogView::WindowClosing() { @@ -140,7 +140,7 @@ bool HtmlDialogView::IsDialogModal() const { } string16 HtmlDialogView::GetDialogTitle() const { - return WideToUTF16Hack(GetWindowTitle()); + return GetWindowTitle(); } GURL HtmlDialogView::GetDialogContentURL() const { diff --git a/chrome/browser/ui/views/html_dialog_view.h b/chrome/browser/ui/views/html_dialog_view.h index 59ab06b..f75e0dd 100644 --- a/chrome/browser/ui/views/html_dialog_view.h +++ b/chrome/browser/ui/views/html_dialog_view.h @@ -7,6 +7,7 @@ #pragma once #include <string> +#include <vector> #include "base/gtest_prod_util.h" #include "chrome/browser/ui/views/dom_view.h" @@ -55,7 +56,7 @@ class HtmlDialogView // Overridden from views::WidgetDelegate: virtual bool CanResize() const OVERRIDE; virtual bool IsModal() const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual void WindowClosing() OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; virtual views::View* GetInitiallyFocusedView() OVERRIDE; diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index aa05ac8..b4be66c 100644 --- a/chrome/browser/ui/views/hung_renderer_view.cc +++ b/chrome/browser/ui/views/hung_renderer_view.cc @@ -235,7 +235,7 @@ class HungRendererDialogView : public views::DialogDelegateView, void EndForTabContents(TabContents* contents); // views::DialogDelegateView overrides: - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual void WindowClosing() OVERRIDE; virtual int GetDialogButtons() const OVERRIDE; virtual std::wstring GetDialogButtonLabel( @@ -367,9 +367,8 @@ void HungRendererDialogView::EndForTabContents(TabContents* contents) { /////////////////////////////////////////////////////////////////////////////// // HungRendererDialogView, views::DialogDelegate implementation: -std::wstring HungRendererDialogView::GetWindowTitle() const { - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_BROWSER_HANGMONITOR_RENDERER_TITLE)); +string16 HungRendererDialogView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_BROWSER_HANGMONITOR_RENDERER_TITLE); } void HungRendererDialogView::WindowClosing() { diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc index 7e0a2f5..afd2661 100644 --- a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc +++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc @@ -78,8 +78,8 @@ bool ImportLockDialogView::IsModal() const { return false; } -std::wstring ImportLockDialogView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_TITLE)); +string16 ImportLockDialogView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_TITLE); } bool ImportLockDialogView::Accept() { diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view.h b/chrome/browser/ui/views/importer/import_lock_dialog_view.h index b77a082..d5d6735 100644 --- a/chrome/browser/ui/views/importer/import_lock_dialog_view.h +++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.h @@ -36,7 +36,7 @@ class ImportLockDialogView : public views::DialogDelegateView { virtual std::wstring GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const OVERRIDE; virtual bool IsModal() const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; diff --git a/chrome/browser/ui/views/importer/import_progress_dialog_view.cc b/chrome/browser/ui/views/importer/import_progress_dialog_view.cc index 0e28a12..e4ff5a1 100644 --- a/chrome/browser/ui/views/importer/import_progress_dialog_view.cc +++ b/chrome/browser/ui/views/importer/import_progress_dialog_view.cc @@ -125,8 +125,8 @@ bool ImportProgressDialogView::IsModal() const { return parent_window_ != NULL; } -std::wstring ImportProgressDialogView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_TITLE)); +string16 ImportProgressDialogView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_TITLE); } bool ImportProgressDialogView::Cancel() { diff --git a/chrome/browser/ui/views/importer/import_progress_dialog_view.h b/chrome/browser/ui/views/importer/import_progress_dialog_view.h index cbd23e5..59a780b 100644 --- a/chrome/browser/ui/views/importer/import_progress_dialog_view.h +++ b/chrome/browser/ui/views/importer/import_progress_dialog_view.h @@ -49,7 +49,7 @@ class ImportProgressDialogView : public views::DialogDelegateView, virtual std::wstring GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const OVERRIDE; virtual bool IsModal() const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual bool Cancel() OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; diff --git a/chrome/browser/ui/views/instant_confirm_view.cc b/chrome/browser/ui/views/instant_confirm_view.cc index 4f5f02b..673dfe9 100644 --- a/chrome/browser/ui/views/instant_confirm_view.cc +++ b/chrome/browser/ui/views/instant_confirm_view.cc @@ -61,8 +61,8 @@ views::View* InstantConfirmView::GetContentsView() { return this; } -std::wstring InstantConfirmView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_INSTANT_OPT_IN_TITLE)); +string16 InstantConfirmView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_INSTANT_OPT_IN_TITLE); } gfx::Size InstantConfirmView::GetPreferredSize() { diff --git a/chrome/browser/ui/views/instant_confirm_view.h b/chrome/browser/ui/views/instant_confirm_view.h index 6f859f3..1ecc058 100644 --- a/chrome/browser/ui/views/instant_confirm_view.h +++ b/chrome/browser/ui/views/instant_confirm_view.h @@ -21,13 +21,13 @@ class InstantConfirmView : public views::DialogDelegateView, explicit InstantConfirmView(Profile* profile); // views::DialogDelegate overrides: - virtual bool Accept(bool window_closing); - virtual bool Accept(); - virtual bool Cancel(); - virtual views::View* GetContentsView(); - virtual std::wstring GetWindowTitle() const; - virtual gfx::Size GetPreferredSize(); - virtual bool IsModal() const; + virtual bool Accept(bool window_closing) OVERRIDE; + virtual bool Accept() OVERRIDE; + virtual bool Cancel() OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; + virtual gfx::Size GetPreferredSize() OVERRIDE; + virtual bool IsModal() const OVERRIDE; // views::LinkListener overrides: virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; diff --git a/chrome/browser/ui/views/js_modal_dialog_views.cc b/chrome/browser/ui/views/js_modal_dialog_views.cc index 62fbc39..e35f2fb 100644 --- a/chrome/browser/ui/views/js_modal_dialog_views.cc +++ b/chrome/browser/ui/views/js_modal_dialog_views.cc @@ -90,8 +90,8 @@ int JSModalDialogViews::GetDialogButtons() const { return dialog_buttons; } -std::wstring JSModalDialogViews::GetWindowTitle() const { - return UTF16ToWideHack(parent_->title()); +string16 JSModalDialogViews::GetWindowTitle() const { + return parent_->title(); } diff --git a/chrome/browser/ui/views/js_modal_dialog_views.h b/chrome/browser/ui/views/js_modal_dialog_views.h index 9cc3733..789f136 100644 --- a/chrome/browser/ui/views/js_modal_dialog_views.h +++ b/chrome/browser/ui/views/js_modal_dialog_views.h @@ -35,7 +35,7 @@ class JSModalDialogViews : public NativeAppModalDialog, // Overridden from views::DialogDelegate: virtual int GetDefaultDialogButton() const OVERRIDE; virtual int GetDialogButtons() const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual void WindowClosing() OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool Cancel() OVERRIDE; diff --git a/chrome/browser/ui/views/repost_form_warning_view.cc b/chrome/browser/ui/views/repost_form_warning_view.cc index 100d87d..b9a5c4f 100644 --- a/chrome/browser/ui/views/repost_form_warning_view.cc +++ b/chrome/browser/ui/views/repost_form_warning_view.cc @@ -47,8 +47,8 @@ RepostFormWarningView::~RepostFormWarningView() { ////////////////////////////////////////////////////////////////////////////// // RepostFormWarningView, views::DialogDelegate implementation: -std::wstring RepostFormWarningView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE)); +string16 RepostFormWarningView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE); } std::wstring RepostFormWarningView::GetDialogButtonLabel( diff --git a/chrome/browser/ui/views/repost_form_warning_view.h b/chrome/browser/ui/views/repost_form_warning_view.h index b2e10d9..ed1de4b 100644 --- a/chrome/browser/ui/views/repost_form_warning_view.h +++ b/chrome/browser/ui/views/repost_form_warning_view.h @@ -30,7 +30,7 @@ class RepostFormWarningView : public views::DialogDelegate { TabContents* tab_contents); // views::DialogDelegate Methods: - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual std::wstring GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; diff --git a/chrome/browser/ui/views/restart_message_box.cc b/chrome/browser/ui/views/restart_message_box.cc index 57077ad..b2b27eef 100644 --- a/chrome/browser/ui/views/restart_message_box.cc +++ b/chrome/browser/ui/views/restart_message_box.cc @@ -31,8 +31,8 @@ std::wstring RestartMessageBox::GetDialogButtonLabel( return UTF16ToWide(l10n_util::GetStringUTF16(IDS_OK)); } -std::wstring RestartMessageBox::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); +string16 RestartMessageBox::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); } void RestartMessageBox::DeleteDelegate() { diff --git a/chrome/browser/ui/views/restart_message_box.h b/chrome/browser/ui/views/restart_message_box.h index 510f778..3b08326 100644 --- a/chrome/browser/ui/views/restart_message_box.h +++ b/chrome/browser/ui/views/restart_message_box.h @@ -26,7 +26,7 @@ class RestartMessageBox : public views::DialogDelegate { virtual int GetDialogButtons() const OVERRIDE; virtual std::wstring GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; // views::WidgetDelegate: virtual void DeleteDelegate() OVERRIDE; diff --git a/chrome/browser/ui/views/simple_message_box_views.cc b/chrome/browser/ui/views/simple_message_box_views.cc index 4d36cdb..f8e3076 100644 --- a/chrome/browser/ui/views/simple_message_box_views.cc +++ b/chrome/browser/ui/views/simple_message_box_views.cc @@ -102,7 +102,7 @@ bool SimpleMessageBoxViews::ShouldShowWindowTitle() const { return true; } -std::wstring SimpleMessageBoxViews::GetWindowTitle() const { +string16 SimpleMessageBoxViews::GetWindowTitle() const { return message_box_title_; } @@ -135,7 +135,7 @@ SimpleMessageBoxViews::SimpleMessageBoxViews(gfx::NativeWindow parent_window, const string16& message) : dialog_flags_(dialog_flags), disposition_(DISPOSITION_UNKNOWN) { - message_box_title_ = UTF16ToWide(title); + message_box_title_ = title; message_box_view_ = new views::MessageBoxView( dialog_flags, UTF16ToWide(message), diff --git a/chrome/browser/ui/views/simple_message_box_views.h b/chrome/browser/ui/views/simple_message_box_views.h index af7f949..37c8ace 100644 --- a/chrome/browser/ui/views/simple_message_box_views.h +++ b/chrome/browser/ui/views/simple_message_box_views.h @@ -55,7 +55,7 @@ class SimpleMessageBoxViews : public views::DialogDelegate, // Overridden from views::WidgetDelegate: virtual bool ShouldShowWindowTitle() const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool IsModal() const OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; @@ -82,7 +82,7 @@ class SimpleMessageBoxViews : public views::DialogDelegate, #endif int dialog_flags_; - std::wstring message_box_title_; + string16 message_box_title_; views::MessageBoxView* message_box_view_; DispositionType disposition_; diff --git a/chrome/browser/ui/views/ssl_client_certificate_selector.cc b/chrome/browser/ui/views/ssl_client_certificate_selector.cc index e80f8a6..134e5d9 100644 --- a/chrome/browser/ui/views/ssl_client_certificate_selector.cc +++ b/chrome/browser/ui/views/ssl_client_certificate_selector.cc @@ -165,8 +165,8 @@ bool SSLClientCertificateSelector::CanResize() const { return true; } -std::wstring SSLClientCertificateSelector::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_CLIENT_CERT_DIALOG_TITLE)); +string16 SSLClientCertificateSelector::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_CLIENT_CERT_DIALOG_TITLE); } void SSLClientCertificateSelector::DeleteDelegate() { diff --git a/chrome/browser/ui/views/ssl_client_certificate_selector.h b/chrome/browser/ui/views/ssl_client_certificate_selector.h index c6e4d1b..9082226 100644 --- a/chrome/browser/ui/views/ssl_client_certificate_selector.h +++ b/chrome/browser/ui/views/ssl_client_certificate_selector.h @@ -52,7 +52,7 @@ class SSLClientCertificateSelector : public SSLClientAuthObserver, // DialogDelegateView: virtual bool CanResize() const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool IsDialogButtonEnabled( ui::MessageBoxFlags::DialogButton button) const OVERRIDE; diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc index 9038d31..9bbe01f 100644 --- a/chrome/browser/ui/views/task_manager_view.cc +++ b/chrome/browser/ui/views/task_manager_view.cc @@ -42,7 +42,7 @@ static const int kDefaultHeight = 270; // Yellow highlight used when highlighting background resources. static const SkColor kBackgroundResourceHighlight = - SkColorSetRGB(0xff,0xf1,0xcd); + SkColorSetRGB(0xff, 0xf1, 0xcd); namespace { @@ -276,28 +276,29 @@ class TaskManagerView : public views::ButtonListener, static void Show(bool highlight_background_resources); // views::View - virtual void Layout(); - virtual gfx::Size GetPreferredSize(); + virtual void Layout() OVERRIDE; + virtual gfx::Size GetPreferredSize() OVERRIDE; virtual void ViewHierarchyChanged(bool is_add, views::View* parent, - views::View* child); + views::View* child) OVERRIDE; // ButtonListener implementation. - virtual void ButtonPressed(views::Button* sender, const views::Event& event); + virtual void ButtonPressed(views::Button* sender, + const views::Event& event) OVERRIDE; // views::DialogDelegate - virtual bool CanResize() const; - virtual bool CanMaximize() const; - virtual bool ExecuteWindowsCommand(int command_id); - virtual std::wstring GetWindowTitle() const; - virtual std::string GetWindowName() const; - virtual int GetDialogButtons() const; - virtual void WindowClosing(); - virtual views::View* GetContentsView(); + virtual bool CanResize() const OVERRIDE; + virtual bool CanMaximize() const OVERRIDE; + virtual bool ExecuteWindowsCommand(int command_id) OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; + virtual std::string GetWindowName() const OVERRIDE; + virtual int GetDialogButtons() const OVERRIDE; + virtual void WindowClosing() OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; // views::TableViewObserver implementation. - virtual void OnSelectionChanged(); - virtual void OnDoubleClick(); - virtual void OnKeyDown(ui::KeyboardCode keycode); + virtual void OnSelectionChanged() OVERRIDE; + virtual void OnDoubleClick() OVERRIDE; + virtual void OnKeyDown(ui::KeyboardCode keycode) OVERRIDE; // views::LinkListener implementation. virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; @@ -651,8 +652,8 @@ bool TaskManagerView::ExecuteWindowsCommand(int command_id) { return false; } -std::wstring TaskManagerView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_TASK_MANAGER_TITLE)); +string16 TaskManagerView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_TITLE); } std::string TaskManagerView::GetWindowName() const { diff --git a/chrome/browser/ui/views/uninstall_view.cc b/chrome/browser/ui/views/uninstall_view.cc index e00d6d2..c83440e 100644 --- a/chrome/browser/ui/views/uninstall_view.cc +++ b/chrome/browser/ui/views/uninstall_view.cc @@ -19,13 +19,13 @@ #include "views/layout/grid_layout.h" #include "views/layout/layout_constants.h" -UninstallView::UninstallView(int& user_selection) +UninstallView::UninstallView(int* user_selection) : confirm_label_(NULL), delete_profile_(NULL), change_default_browser_(NULL), browsers_combo_(NULL), browsers_(NULL), - user_selection_(user_selection) { + user_selection_(*user_selection) { SetupControls(); } @@ -135,8 +135,8 @@ void UninstallView::ButtonPressed( } } -std::wstring UninstallView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_UNINSTALL_CHROME)); +string16 UninstallView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_UNINSTALL_CHROME); } views::View* UninstallView::GetContentsView() { @@ -149,7 +149,7 @@ int UninstallView::GetItemCount() { } string16 UninstallView::GetItemAt(int index) { - DCHECK(index < (int) browsers_->size()); + DCHECK_LT(index, static_cast<int>(browsers_->size())); BrowsersMap::const_iterator it = browsers_->begin(); std::advance(it, index); return WideToUTF16Hack((*it).first); diff --git a/chrome/browser/ui/views/uninstall_view.h b/chrome/browser/ui/views/uninstall_view.h index 39821de..eeead81 100644 --- a/chrome/browser/ui/views/uninstall_view.h +++ b/chrome/browser/ui/views/uninstall_view.h @@ -6,6 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_UNINSTALL_VIEW_H_ #pragma once +#include <map> + #include "base/string16.h" #include "ui/base/models/combobox_model.h" #include "views/controls/combobox/combobox.h" @@ -23,25 +25,26 @@ class UninstallView : public views::ButtonListener, public views::DialogDelegateView, public ui::ComboboxModel { public: - explicit UninstallView(int& user_selection); + explicit UninstallView(int* user_selection); virtual ~UninstallView(); // Overridden form views::ButtonListener. - virtual void ButtonPressed(views::Button* sender, const views::Event& event); + virtual void ButtonPressed(views::Button* sender, + const views::Event& event) OVERRIDE; // Overridden from views::DialogDelegateView: - virtual bool Accept(); - virtual bool Cancel(); + virtual bool Accept() OVERRIDE; + virtual bool Cancel() OVERRIDE; virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const; + MessageBoxFlags::DialogButton button) const OVERRIDE; // Overridden from views::WidgetDelegate: - virtual std::wstring GetWindowTitle() const; - virtual views::View* GetContentsView(); + virtual string16 GetWindowTitle() const OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; // Overridden from ui::ComboboxModel: - virtual int GetItemCount(); - virtual string16 GetItemAt(int index); + virtual int GetItemCount() OVERRIDE; + virtual string16 GetItemAt(int index) OVERRIDE; private: // Initializes the controls on the dialog. diff --git a/chrome/browser/ui/views/update_recommended_message_box.cc b/chrome/browser/ui/views/update_recommended_message_box.cc index 06cde82..5b60389 100644 --- a/chrome/browser/ui/views/update_recommended_message_box.cc +++ b/chrome/browser/ui/views/update_recommended_message_box.cc @@ -61,8 +61,8 @@ bool UpdateRecommendedMessageBox::ShouldShowWindowTitle() const { #endif } -std::wstring UpdateRecommendedMessageBox::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); +string16 UpdateRecommendedMessageBox::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); } void UpdateRecommendedMessageBox::DeleteDelegate() { @@ -101,8 +101,8 @@ UpdateRecommendedMessageBox::UpdateRecommendedMessageBox( message_box_view_ = new views::MessageBoxView( ui::MessageBoxFlags::kFlagHasMessage | ui::MessageBoxFlags::kFlagHasOKButton, - UTF16ToWide(l10n_util::GetStringFUTF16(IDS_UPDATE_RECOMMENDED, - product_name)), + UTF16ToWideHack(l10n_util::GetStringFUTF16(IDS_UPDATE_RECOMMENDED, + product_name)), std::wstring(), kDialogWidth); browser::CreateViewsWindow(parent_window, this)->Show(); diff --git a/chrome/browser/ui/views/update_recommended_message_box.h b/chrome/browser/ui/views/update_recommended_message_box.h index 72a045d..371323b 100644 --- a/chrome/browser/ui/views/update_recommended_message_box.h +++ b/chrome/browser/ui/views/update_recommended_message_box.h @@ -32,7 +32,7 @@ class UpdateRecommendedMessageBox : public views::DialogDelegate { // Overridden from views::WidgetDelegate: virtual bool ShouldShowWindowTitle() const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool IsModal() const OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; diff --git a/chrome/browser/ui/views/user_data_dir_dialog.cc b/chrome/browser/ui/views/user_data_dir_dialog.cc index 25c0cea..891635b 100644 --- a/chrome/browser/ui/views/user_data_dir_dialog.cc +++ b/chrome/browser/ui/views/user_data_dir_dialog.cc @@ -57,9 +57,8 @@ std::wstring UserDataDirDialog::GetDialogButtonLabel( return std::wstring(); } -std::wstring UserDataDirDialog::GetWindowTitle() const { - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_CANT_WRITE_USER_DIRECTORY_TITLE)); +string16 UserDataDirDialog::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_CANT_WRITE_USER_DIRECTORY_TITLE); } void UserDataDirDialog::DeleteDelegate() { diff --git a/chrome/browser/ui/views/user_data_dir_dialog.h b/chrome/browser/ui/views/user_data_dir_dialog.h index f351aa0..b51d1ab 100644 --- a/chrome/browser/ui/views/user_data_dir_dialog.h +++ b/chrome/browser/ui/views/user_data_dir_dialog.h @@ -36,7 +36,7 @@ class UserDataDirDialog : public views::DialogDelegate, // views::DialogDelegate methods: virtual std::wstring GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; |