diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-06 23:58:45 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-06 23:58:45 +0000 |
commit | dcd0249870cc1ead35ce6d3d8295b1c96a83aeb0 (patch) | |
tree | de67c3f98feabf0222a0b82113c4c6d796117c0f | |
parent | 8daeb41bb826c0908d1b5a2132c90a068ecf2c46 (diff) | |
download | chromium_src-dcd0249870cc1ead35ce6d3d8295b1c96a83aeb0.zip chromium_src-dcd0249870cc1ead35ce6d3d8295b1c96a83aeb0.tar.gz chromium_src-dcd0249870cc1ead35ce6d3d8295b1c96a83aeb0.tar.bz2 |
Use base namespace for string16 in chrome/browser.
This converts 200 more files.
TBR=sky
Review URL: https://codereview.chromium.org/108353004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239278 0039d316-1c4b-4281-b951-d872f2087c98
200 files changed, 802 insertions, 760 deletions
diff --git a/chrome/browser/hang_monitor/hung_plugin_action.cc b/chrome/browser/hang_monitor/hung_plugin_action.cc index bc93207..8e248f8 100644 --- a/chrome/browser/hang_monitor/hung_plugin_action.cc +++ b/chrome/browser/hang_monitor/hung_plugin_action.cc @@ -38,7 +38,7 @@ enum GTalkPluginLogVersion { // version format is "major(1 digit).minor(1 digit).sub(1 or 2 digits)", // for example, "2.7.10" and "2.8.1". Converts the string to a number as // 10 * major + minor - kGTalkPluginLogMinVersion. -GTalkPluginLogVersion GetGTalkPluginVersion(const string16& version) { +GTalkPluginLogVersion GetGTalkPluginVersion(const base::string16& version) { int gtalk_plugin_version = GTALK_PLUGIN_VERSION_MIN; Version plugin_version; content::WebPluginInfo::CreateVersionFromString(version, &plugin_version); @@ -81,8 +81,8 @@ bool HungPluginAction::OnHungWindowDetected(HWND hung_window, *action = HungWindowNotification::HUNG_WINDOW_IGNORE; if (top_level_window_process_id != hung_window_process_id) { - string16 plugin_name; - string16 plugin_version; + base::string16 plugin_name; + base::string16 plugin_version; GetPluginNameAndVersion(hung_window, top_level_window_process_id, &plugin_name, @@ -99,9 +99,9 @@ bool HungPluginAction::OnHungWindowDetected(HWND hung_window, NOTREACHED() << "Terminated a hung plugin process."; *action = HungWindowNotification::HUNG_WINDOW_TERMINATE_PROCESS; } else { - const string16 title = l10n_util::GetStringUTF16( + const base::string16 title = l10n_util::GetStringUTF16( IDS_BROWSER_HANGMONITOR_TITLE); - const string16 message = l10n_util::GetStringFUTF16( + const base::string16 message = l10n_util::GetStringFUTF16( IDS_BROWSER_HANGMONITOR, plugin_name); // Before displaying the message box, invoke SendMessageCallback on the // hung window. If the callback ever hits, the window is not hung anymore @@ -162,8 +162,8 @@ void HungPluginAction::OnWindowResponsive(HWND window) { bool HungPluginAction::GetPluginNameAndVersion(HWND plugin_window, DWORD browser_process_id, - string16* plugin_name, - string16* plugin_version) { + base::string16* plugin_name, + base::string16* plugin_version) { DCHECK(plugin_name); DCHECK(plugin_version); HWND window_to_check = plugin_window; @@ -186,7 +186,7 @@ bool HungPluginAction::GetPluginNameAndVersion(HWND plugin_window, // static BOOL CALLBACK HungPluginAction::DismissMessageBox(HWND window, LPARAM ignore) { - string16 class_name = gfx::GetClassName(window); + base::string16 class_name = gfx::GetClassName(window); // #32770 is the dialog window class which is the window class of // the message box being displayed. if (class_name == L"#32770") { diff --git a/chrome/browser/hang_monitor/hung_plugin_action.h b/chrome/browser/hang_monitor/hung_plugin_action.h index 49b0b43..5ad00bb 100644 --- a/chrome/browser/hang_monitor/hung_plugin_action.h +++ b/chrome/browser/hang_monitor/hung_plugin_action.h @@ -39,8 +39,8 @@ class HungPluginAction : public HungWindowDetector::HungWindowNotification { protected: bool GetPluginNameAndVersion(HWND plugin_window, DWORD browser_process_id, - string16* plugin_name, - string16* plugin_version); + base::string16* plugin_name, + base::string16* plugin_version); // The currently hung plugin window that we are prompting the user about HWND current_hung_plugin_window_; }; diff --git a/chrome/browser/mouseleave_browsertest.cc b/chrome/browser/mouseleave_browsertest.cc index 47dd69db..726a651f 100644 --- a/chrome/browser/mouseleave_browsertest.cc +++ b/chrome/browser/mouseleave_browsertest.cc @@ -41,7 +41,7 @@ class MouseLeaveTest : public InProcessBrowserTest { above_content_point.y()); // Navigate to the test html page. - string16 load_expected_title(ASCIIToUTF16("onload")); + base::string16 load_expected_title(ASCIIToUTF16("onload")); content::TitleWatcher load_title_watcher(tab, load_expected_title); ui_test_utils::NavigateToURL(browser(), test_url); // Wait for the onload() handler to complete so we can do the @@ -53,7 +53,7 @@ class MouseLeaveTest : public InProcessBrowserTest { ui_controls::SendMouseMove(in_content_point.x(), in_content_point.y()); // Wait on the correct intermediate title. - string16 entered_expected_title(ASCIIToUTF16("entered")); + base::string16 entered_expected_title(ASCIIToUTF16("entered")); content::TitleWatcher entered_title_watcher(tab, entered_expected_title); EXPECT_EQ(entered_expected_title, entered_title_watcher.WaitAndGetTitle()); @@ -63,7 +63,7 @@ class MouseLeaveTest : public InProcessBrowserTest { above_content_point.y()); // Wait on the correct final value of the cookie. - string16 left_expected_title(ASCIIToUTF16("left")); + base::string16 left_expected_title(ASCIIToUTF16("left")); content::TitleWatcher left_title_watcher(tab, left_expected_title); EXPECT_EQ(left_expected_title, left_title_watcher.WaitAndGetTitle()); } diff --git a/chrome/browser/rlz/rlz.h b/chrome/browser/rlz/rlz.h index d55e05c1..c7ab7989 100644 --- a/chrome/browser/rlz/rlz.h +++ b/chrome/browser/rlz/rlz.h @@ -73,7 +73,8 @@ class RLZTracker : public content::NotificationObserver { // Gets the RLZ value of the access point. // Returns false if the rlz string could not be obtained. In some cases // an empty string can be returned which is not an error. - static bool GetAccessPointRlz(rlz_lib::AccessPoint point, string16* rlz); + static bool GetAccessPointRlz(rlz_lib::AccessPoint point, + base::string16* rlz); // Invoked during shutdown to clean up any state created by RLZTracker. static void CleanupRlz(); @@ -145,7 +146,7 @@ class RLZTracker : public content::NotificationObserver { void RecordFirstSearch(rlz_lib::AccessPoint point); // Implementation called from GetAccessPointRlz() static method. - bool GetAccessPointRlzImpl(rlz_lib::AccessPoint point, string16* rlz); + bool GetAccessPointRlzImpl(rlz_lib::AccessPoint point, base::string16* rlz); // Schedules the delayed initialization. This method is virtual to allow // tests to override how the scheduling is done. @@ -174,8 +175,8 @@ class RLZTracker : public content::NotificationObserver { // Sends the financial ping to the RLZ servers. This method is virtual to // allow tests to override. virtual bool SendFinancialPing(const std::string& brand, - const string16& lang, - const string16& referral); + const base::string16& lang, + const base::string16& referral); #if defined(OS_CHROMEOS) // Implementation called from ClearRlzState static method. @@ -209,7 +210,7 @@ class RLZTracker : public content::NotificationObserver { // The cache must be protected by a lock since it may be accessed from // the UI thread for reading and the IO thread for reading and/or writing. base::Lock cache_lock_; - std::map<rlz_lib::AccessPoint, string16> rlz_cache_; + std::map<rlz_lib::AccessPoint, base::string16> rlz_cache_; // Keeps track of whether the omnibox or host page have been used. bool omnibox_used_; diff --git a/chrome/browser/rlz/rlz_unittest.cc b/chrome/browser/rlz/rlz_unittest.cc index 198c62a..1dd7ba0 100644 --- a/chrome/browser/rlz/rlz_unittest.cc +++ b/chrome/browser/rlz/rlz_unittest.cc @@ -133,8 +133,8 @@ class TestRLZTracker : public RLZTracker { #endif virtual bool SendFinancialPing(const std::string& brand, - const string16& lang, - const string16& referral) OVERRIDE { + const base::string16& lang, + const base::string16& referral) OVERRIDE { // Don't ping the server during tests, just pretend as if we did. EXPECT_FALSE(brand.empty()); pinged_brands_.insert(brand); @@ -212,13 +212,13 @@ void RlzLibTest::SetReactivationBrand(const char* brand) { void RlzLibTest::SetRegistryBrandValue(const wchar_t* name, const char* brand) { BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - string16 reg_path = dist->GetStateKey(); + base::string16 reg_path = dist->GetStateKey(); RegKey key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_SET_VALUE); if (*brand == 0) { LONG result = key.DeleteValue(name); ASSERT_TRUE(ERROR_SUCCESS == result || ERROR_FILE_NOT_FOUND == result); } else { - string16 brand16 = ASCIIToUTF16(brand); + base::string16 brand16 = ASCIIToUTF16(brand); ASSERT_EQ(ERROR_SUCCESS, key.WriteValue(name, brand16.c_str())); } } @@ -583,7 +583,7 @@ TEST_F(RlzLibTest, GetAccessPointRlzOnIoThread) { // Set dummy RLZ string. rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, kOmniboxRlzString); - string16 rlz; + base::string16 rlz; tracker_.set_assume_not_ui_thread(true); EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz)); @@ -594,7 +594,7 @@ TEST_F(RlzLibTest, GetAccessPointRlzNotOnIoThread) { // Set dummy RLZ string. rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, kOmniboxRlzString); - string16 rlz; + base::string16 rlz; tracker_.set_assume_not_ui_thread(false); EXPECT_FALSE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz)); @@ -604,7 +604,7 @@ TEST_F(RlzLibTest, GetAccessPointRlzIsCached) { // Set dummy RLZ string. rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, kOmniboxRlzString); - string16 rlz; + base::string16 rlz; tracker_.set_assume_not_ui_thread(false); EXPECT_FALSE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz)); @@ -623,7 +623,7 @@ TEST_F(RlzLibTest, PingUpdatesRlzCache) { rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, kOmniboxRlzString); rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, kHomepageRlzString); - string16 rlz; + base::string16 rlz; // Prime the cache. tracker_.set_assume_not_ui_thread(true); diff --git a/chrome/browser/ui/app_modal_dialogs/app_modal_dialog.cc b/chrome/browser/ui/app_modal_dialogs/app_modal_dialog.cc index 77e9133..edd9457 100644 --- a/chrome/browser/ui/app_modal_dialogs/app_modal_dialog.cc +++ b/chrome/browser/ui/app_modal_dialogs/app_modal_dialog.cc @@ -14,7 +14,8 @@ using content::WebContents; -AppModalDialog::AppModalDialog(WebContents* web_contents, const string16& title) +AppModalDialog::AppModalDialog(WebContents* web_contents, + const base::string16& title) : title_(title), completed_(false), valid_(true), diff --git a/chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h b/chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h index 2da402f..28cf584 100644 --- a/chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h +++ b/chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h @@ -22,7 +22,8 @@ class AppModalDialog { public: // A union of data necessary to determine the type of message box to // show. - AppModalDialog(content::WebContents* web_contents, const string16& title); + AppModalDialog(content::WebContents* web_contents, + const base::string16& title); virtual ~AppModalDialog(); // Called by the AppModalDialogQueue to show this dialog. @@ -38,7 +39,7 @@ class AppModalDialog { // TODO(beng): Get rid of this method. void CompleteDialog(); - string16 title() const { return title_; } + base::string16 title() const { return title_; } NativeAppModalDialog* native_dialog() const { return native_dialog_; } content::WebContents* web_contents() const { return web_contents_; } @@ -71,7 +72,7 @@ class AppModalDialog { private: // Information about the message box is held in the following variables. - string16 title_; + base::string16 title_; // True if CompleteDialog was called. bool completed_; diff --git a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc index e678ad5..91e35b7 100644 --- a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc +++ b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc @@ -29,11 +29,13 @@ const int kMessageTextMaxRows = 32; const int kMessageTextMaxCols = 132; const int kDefaultPromptMaxRows = 24; const int kDefaultPromptMaxCols = 132; -void EnforceMaxTextSize(const string16& in_string, string16* out_string) { +void EnforceMaxTextSize(const base::string16& in_string, + base::string16* out_string) { gfx::ElideRectangleString(in_string, kMessageTextMaxRows, kMessageTextMaxCols, false, out_string); } -void EnforceMaxPromptSize(const string16& in_string, string16* out_string) { +void EnforceMaxPromptSize(const base::string16& in_string, + base::string16* out_string) { gfx::ElideRectangleString(in_string, kDefaultPromptMaxRows, kDefaultPromptMaxCols, false, out_string); } @@ -42,10 +44,12 @@ void EnforceMaxPromptSize(const string16& in_string, string16* out_string) { // appropriately, but limit its overall length to something reasonable. const int kMessageTextMaxSize = 3000; const int kDefaultPromptMaxSize = 2000; -void EnforceMaxTextSize(const string16& in_string, string16* out_string) { +void EnforceMaxTextSize(const base::string16& in_string, + base::string16* out_string) { gfx::ElideString(in_string, kMessageTextMaxSize, out_string); } -void EnforceMaxPromptSize(const string16& in_string, string16* out_string) { +void EnforceMaxPromptSize(const base::string16& in_string, + base::string16* out_string) { gfx::ElideString(in_string, kDefaultPromptMaxSize, out_string); } #endif @@ -59,10 +63,10 @@ ChromeJavaScriptDialogExtraData::ChromeJavaScriptDialogExtraData() JavaScriptAppModalDialog::JavaScriptAppModalDialog( WebContents* web_contents, ExtraDataMap* extra_data_map, - const string16& title, + const base::string16& title, content::JavaScriptMessageType javascript_message_type, - const string16& message_text, - const string16& default_prompt_text, + const base::string16& message_text, + const base::string16& default_prompt_text, bool display_suppress_checkbox, bool is_before_unload_dialog, bool is_reload, @@ -108,7 +112,7 @@ void JavaScriptAppModalDialog::Invalidate() { AppModalDialog::Invalidate(); if (!callback_.is_null()) { - callback_.Run(false, string16()); + callback_.Run(false, base::string16()); callback_.Reset(); } if (native_dialog()) @@ -124,12 +128,12 @@ void JavaScriptAppModalDialog::OnCancel(bool suppress_js_messages) { // is a temporary workaround. CompleteDialog(); - NotifyDelegate(false, string16(), suppress_js_messages); + NotifyDelegate(false, base::string16(), suppress_js_messages); } -void JavaScriptAppModalDialog::OnAccept(const string16& prompt_text, +void JavaScriptAppModalDialog::OnAccept(const base::string16& prompt_text, bool suppress_js_messages) { - string16 prompt_text_to_use = prompt_text; + base::string16 prompt_text_to_use = prompt_text; // This is only for testing. if (use_override_prompt_text_) prompt_text_to_use = override_prompt_text_; @@ -139,17 +143,17 @@ void JavaScriptAppModalDialog::OnAccept(const string16& prompt_text, } void JavaScriptAppModalDialog::OnClose() { - NotifyDelegate(false, string16(), false); + NotifyDelegate(false, base::string16(), false); } void JavaScriptAppModalDialog::SetOverridePromptText( - const string16& override_prompt_text) { + const base::string16& override_prompt_text) { override_prompt_text_ = override_prompt_text; use_override_prompt_text_ = true; } void JavaScriptAppModalDialog::NotifyDelegate(bool success, - const string16& user_input, + const base::string16& user_input, bool suppress_js_messages) { if (!IsValid()) return; diff --git a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h index 38153fc..bd0dbb8 100644 --- a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h +++ b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h @@ -34,10 +34,10 @@ class JavaScriptAppModalDialog : public AppModalDialog { JavaScriptAppModalDialog( content::WebContents* web_contents, ExtraDataMap* extra_data_map, - const string16& title, + const base::string16& title, content::JavaScriptMessageType javascript_message_type, - const string16& message_text, - const string16& default_prompt_text, + const base::string16& message_text, + const base::string16& default_prompt_text, bool display_suppress_checkbox, bool is_before_unload_dialog, bool is_reload, @@ -51,7 +51,7 @@ class JavaScriptAppModalDialog : public AppModalDialog { // Callbacks from NativeDialog when the user accepts or cancels the dialog. void OnCancel(bool suppress_js_messages); - void OnAccept(const string16& prompt_text, bool suppress_js_messages); + void OnAccept(const base::string16& prompt_text, bool suppress_js_messages); // NOTE: This is only called under Views, and should be removed. Any critical // work should be done in OnCancel or OnAccept. See crbug.com/63732 for more. @@ -59,21 +59,21 @@ class JavaScriptAppModalDialog : public AppModalDialog { // Used only for testing. The dialog will use the given text when notifying // its delegate instead of whatever the UI reports. - void SetOverridePromptText(const string16& prompt_text); + void SetOverridePromptText(const base::string16& prompt_text); // Accessors content::JavaScriptMessageType javascript_message_type() const { return javascript_message_type_; } - string16 message_text() const { return message_text_; } - string16 default_prompt_text() const { return default_prompt_text_; } + base::string16 message_text() const { return message_text_; } + base::string16 default_prompt_text() const { return default_prompt_text_; } bool display_suppress_checkbox() const { return display_suppress_checkbox_; } bool is_before_unload_dialog() const { return is_before_unload_dialog_; } bool is_reload() const { return is_reload_; } private: // Notifies the delegate with the result of the dialog. - void NotifyDelegate(bool success, const string16& prompt_text, + void NotifyDelegate(bool success, const base::string16& prompt_text, bool suppress_js_messages); // A map of extra Chrome-only data associated with the delegate_. @@ -82,8 +82,8 @@ class JavaScriptAppModalDialog : public AppModalDialog { // Information about the message box is held in the following variables. const content::JavaScriptMessageType javascript_message_type_; - string16 message_text_; - string16 default_prompt_text_; + base::string16 message_text_; + base::string16 default_prompt_text_; bool display_suppress_checkbox_; bool is_before_unload_dialog_; bool is_reload_; @@ -92,7 +92,7 @@ class JavaScriptAppModalDialog : public AppModalDialog { // Used only for testing. Specifies alternative prompt text that should be // used when notifying the delegate, if |use_override_prompt_text_| is true. - string16 override_prompt_text_; + base::string16 override_prompt_text_; bool use_override_prompt_text_; DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialog); diff --git a/chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.cc b/chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.cc index 833e194..dc10bcc 100644 --- a/chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.cc +++ b/chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.cc @@ -47,21 +47,21 @@ class ChromeJavaScriptDialogManager : public JavaScriptDialogManager, const GURL& origin_url, const std::string& accept_lang, content::JavaScriptMessageType message_type, - const string16& message_text, - const string16& default_prompt_text, + const base::string16& message_text, + const base::string16& default_prompt_text, const DialogClosedCallback& callback, bool* did_suppress_message) OVERRIDE; virtual void RunBeforeUnloadDialog( WebContents* web_contents, - const string16& message_text, + const base::string16& message_text, bool is_reload, const DialogClosedCallback& callback) OVERRIDE; virtual bool HandleJavaScriptDialog( WebContents* web_contents, bool accept, - const string16* prompt_override) OVERRIDE; + const base::string16* prompt_override) OVERRIDE; virtual void CancelActiveAndPendingDialogs( WebContents* web_contents) OVERRIDE; @@ -78,7 +78,7 @@ class ChromeJavaScriptDialogManager : public JavaScriptDialogManager, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; - string16 GetTitle(const GURL& origin_url, + base::string16 GetTitle(const GURL& origin_url, const std::string& accept_lang, bool is_alert); @@ -86,7 +86,7 @@ class ChromeJavaScriptDialogManager : public JavaScriptDialogManager, // passing it onto the original callback. void OnDialogClosed(DialogClosedCallback callback, bool success, - const string16& user_input); + const base::string16& user_input); // Mapping between the WebContents and their extra data. The key // is a void* because the pointer is just a cookie and is never dereferenced. @@ -132,8 +132,8 @@ void ChromeJavaScriptDialogManager::RunJavaScriptDialog( const GURL& origin_url, const std::string& accept_lang, content::JavaScriptMessageType message_type, - const string16& message_text, - const string16& default_prompt_text, + const base::string16& message_text, + const base::string16& default_prompt_text, const DialogClosedCallback& callback, bool* did_suppress_message) { *did_suppress_message = false; @@ -160,7 +160,7 @@ void ChromeJavaScriptDialogManager::RunJavaScriptDialog( } bool is_alert = message_type == content::JAVASCRIPT_MESSAGE_TYPE_ALERT; - string16 dialog_title = GetTitle(origin_url, accept_lang, is_alert); + base::string16 dialog_title = GetTitle(origin_url, accept_lang, is_alert); if (extension_host_) extension_host_->WillRunJavaScriptDialog(); @@ -181,15 +181,15 @@ void ChromeJavaScriptDialogManager::RunJavaScriptDialog( void ChromeJavaScriptDialogManager::RunBeforeUnloadDialog( WebContents* web_contents, - const string16& message_text, + const base::string16& message_text, bool is_reload, const DialogClosedCallback& callback) { - const string16 title = l10n_util::GetStringUTF16(is_reload ? + const base::string16 title = l10n_util::GetStringUTF16(is_reload ? IDS_BEFORERELOAD_MESSAGEBOX_TITLE : IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE); - const string16 footer = l10n_util::GetStringUTF16(is_reload ? + const base::string16 footer = l10n_util::GetStringUTF16(is_reload ? IDS_BEFORERELOAD_MESSAGEBOX_FOOTER : IDS_BEFOREUNLOAD_MESSAGEBOX_FOOTER); - string16 full_message = message_text + ASCIIToUTF16("\n\n") + footer; + base::string16 full_message = message_text + ASCIIToUTF16("\n\n") + footer; if (extension_host_) extension_host_->WillRunJavaScriptDialog(); @@ -200,7 +200,7 @@ void ChromeJavaScriptDialogManager::RunBeforeUnloadDialog( title, content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, full_message, - string16(), // default_prompt_text + base::string16(), // default_prompt_text false, // display_suppress_checkbox true, // is_before_unload_dialog is_reload, @@ -211,7 +211,7 @@ void ChromeJavaScriptDialogManager::RunBeforeUnloadDialog( bool ChromeJavaScriptDialogManager::HandleJavaScriptDialog( WebContents* web_contents, bool accept, - const string16* prompt_override) { + const base::string16* prompt_override) { AppModalDialogQueue* dialog_queue = AppModalDialogQueue::GetInstance(); if (!dialog_queue->HasActiveDialog() || !dialog_queue->active_dialog()->IsJavaScriptModalDialog() || @@ -268,7 +268,7 @@ string16 ChromeJavaScriptDialogManager::GetTitle(const GURL& origin_url, // Otherwise, return the formatted URL. // In this case, force URL to have LTR directionality. - string16 url_string = net::FormatUrl(origin_url, accept_lang); + base::string16 url_string = net::FormatUrl(origin_url, accept_lang); return l10n_util::GetStringFUTF16( is_alert ? IDS_JAVASCRIPT_ALERT_TITLE : IDS_JAVASCRIPT_MESSAGEBOX_TITLE, @@ -291,7 +291,7 @@ void ChromeJavaScriptDialogManager::CancelActiveAndPendingDialogs( void ChromeJavaScriptDialogManager::OnDialogClosed( DialogClosedCallback callback, bool success, - const string16& user_input) { + const base::string16& user_input) { if (extension_host_) extension_host_->DidCloseJavaScriptDialog(); callback.Run(success, user_input); diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.h b/chrome/browser/ui/ash/chrome_shell_delegate.h index 1fd08b59..ce73296 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.h +++ b/chrome/browser/ui/ash/chrome_shell_delegate.h @@ -60,7 +60,7 @@ class ChromeShellDelegate : public ash::ShellDelegate, virtual void RecordUserMetricsAction(ash::UserMetricsAction action) OVERRIDE; virtual ui::MenuModel* CreateContextMenu(aura::Window* root) OVERRIDE; virtual ash::RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE; - virtual string16 GetProductName() const OVERRIDE; + virtual base::string16 GetProductName() const OVERRIDE; // content::NotificationObserver override: virtual void Observe(int type, diff --git a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc index 4f6ddd3..c3009e4 100644 --- a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc @@ -151,7 +151,7 @@ AppShortcutLauncherItemController::GetApplicationList(int event_flags) { content::WebContents* web_contents = content_list[i]; // Get the icon. gfx::Image app_icon = launcher_controller()->GetAppListIcon(web_contents); - string16 title = launcher_controller()->GetAppListTitle(web_contents); + base::string16 title = launcher_controller()->GetAppListTitle(web_contents); items.push_back(new ChromeLauncherAppMenuItemTab( title, &app_icon, web_contents, i == 0)); } diff --git a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc index 78339ec..31a65fc 100644 --- a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc @@ -180,7 +180,7 @@ BrowserShortcutLauncherItemController::GetApplicationList(int event_flags) { content::WebContents* web_contents = tab_strip->GetWebContentsAt(tab_strip->active_index()); gfx::Image app_icon = GetBrowserListIcon(web_contents); - string16 title = GetBrowserListTitle(web_contents); + base::string16 title = GetBrowserListTitle(web_contents); items.push_back(new ChromeLauncherAppMenuItemBrowser( title, &app_icon, browser, items.size() == 1)); } else { @@ -189,7 +189,8 @@ BrowserShortcutLauncherItemController::GetApplicationList(int event_flags) { tab_strip->GetWebContentsAt(index); gfx::Image app_icon = launcher_controller()->GetAppListIcon(web_contents); - string16 title = launcher_controller()->GetAppListTitle(web_contents); + base::string16 title = + launcher_controller()->GetAppListTitle(web_contents); // Check if we need to insert a separator in front. bool leading_separator = !index; items.push_back(new ChromeLauncherAppMenuItemTab( @@ -260,7 +261,7 @@ gfx::Image BrowserShortcutLauncherItemController::GetBrowserListIcon( string16 BrowserShortcutLauncherItemController::GetBrowserListTitle( content::WebContents* web_contents) const { - string16 title = web_contents->GetTitle(); + base::string16 title = web_contents->GetTitle(); if (!title.empty()) return title; return l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); diff --git a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h index 222bd5e..69fff4a 100644 --- a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h +++ b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h @@ -52,7 +52,7 @@ class BrowserShortcutLauncherItemController : public LauncherItemController { // Get the title for the browser list entry for |web_contents|. // If |web_contents| has not loaded, returns "Net Tab". - string16 GetBrowserListTitle(content::WebContents* web_contents) const; + base::string16 GetBrowserListTitle(content::WebContents* web_contents) const; // Check if the given |web_contents| is in incognito mode. bool IsIncognito(content::WebContents* web_contents) const; diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.cc index a337320..6d2e9c2 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.cc @@ -5,7 +5,7 @@ #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" ChromeLauncherAppMenuItem::ChromeLauncherAppMenuItem( - const string16 title, + const base::string16 title, const gfx::Image* icon, bool has_leading_separator) : title_(title), diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h index 2757a76..0612db3 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h @@ -13,14 +13,14 @@ class ChromeLauncherAppMenuItem { public: // To insert a separator before this item set |has_leading_separator|. - ChromeLauncherAppMenuItem(const string16 title, + ChromeLauncherAppMenuItem(const base::string16 title, const gfx::Image* icon, bool has_leading_separator); virtual ~ChromeLauncherAppMenuItem(); // Retrieves the title for this menu option. - const string16& title() const { return title_; } + const base::string16& title() const { return title_; } // Retrieves the icon for this menu option. const gfx::Image& icon() const { return icon_; } @@ -40,7 +40,7 @@ class ChromeLauncherAppMenuItem { virtual void Execute(int event_flags); private: - const string16 title_; + const base::string16 title_; const gfx::Image icon_; // True if the item has a separator in front of it. diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc index 903d36e..3f38fb4 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc @@ -14,7 +14,7 @@ #include "ui/events/event_constants.h" ChromeLauncherAppMenuItemBrowser::ChromeLauncherAppMenuItemBrowser( - const string16 title, + const base::string16 title, const gfx::Image* icon, Browser* browser, bool has_leading_separator) diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.h b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.h index 0e330ec..3ddd416 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.h +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.h @@ -18,7 +18,7 @@ class Browser; class ChromeLauncherAppMenuItemBrowser : public content::NotificationObserver, public ChromeLauncherAppMenuItem { public: - ChromeLauncherAppMenuItemBrowser(const string16 title, + ChromeLauncherAppMenuItemBrowser(const base::string16 title, const gfx::Image* icon, Browser* browser, bool has_leading_separator); diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc index 3b9864f..b1ce6d6 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc @@ -12,7 +12,7 @@ #include "ui/events/event_constants.h" ChromeLauncherAppMenuItemTab::ChromeLauncherAppMenuItemTab( - const string16 title, + const base::string16 title, const gfx::Image* icon, content::WebContents* content, bool has_leading_separator) diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.h b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.h index 9c0a0f5..c40c52c 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.h +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.h @@ -22,7 +22,7 @@ class ChromeLauncherAppMenuItemTab : public ChromeLauncherAppMenuItem, public content::WebContentsObserver { public: - ChromeLauncherAppMenuItemTab(const string16 title, + ChromeLauncherAppMenuItemTab(const base::string16 title, const gfx::Image* icon, content::WebContents* content, bool has_leading_separator); diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.cc index fe6546c..8c812d6 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.cc @@ -7,7 +7,7 @@ #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" ChromeLauncherAppMenuItemV2App::ChromeLauncherAppMenuItemV2App( - const string16 title, + const base::string16 title, const gfx::Image* icon, const std::string& app_id, ChromeLauncherController* launcher_controller, diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h index c195b0e..775bc43 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h @@ -21,7 +21,7 @@ class ChromeLauncherController; class ChromeLauncherAppMenuItemV2App : public ChromeLauncherAppMenuItem { public: ChromeLauncherAppMenuItemV2App( - const string16 title, + const base::string16 title, const gfx::Image* icon, const std::string& app_id, ChromeLauncherController* launcher_controller, diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index 9c7a2ed..b91bd0da8 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc @@ -1350,7 +1350,7 @@ gfx::Image ChromeLauncherController::GetAppListIcon( string16 ChromeLauncherController::GetAppListTitle( content::WebContents* web_contents) const { - string16 title = web_contents->GetTitle(); + base::string16 title = web_contents->GetTitle(); if (!title.empty()) return title; WebContentsToAppIDMap::const_iterator iter = diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h index 35d93aa3..2873da4 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h @@ -375,7 +375,7 @@ class ChromeLauncherController : public ash::LauncherDelegate, // Get the title for the applicatoin list entry for |web_contents|. // If |web_contents| has not loaded, returns "Net Tab". - string16 GetAppListTitle(content::WebContents* web_contents) const; + base::string16 GetAppListTitle(content::WebContents* web_contents) const; // Returns the LauncherItemController of BrowserShortcut. BrowserShortcutLauncherItemController* diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc index 75b6e6d..f8dcd69 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc @@ -233,7 +233,7 @@ class TestV2AppLauncherItemController : public LauncherItemController { virtual bool Activate(ash::LaunchSource source) OVERRIDE { return false; } virtual void Close() OVERRIDE {} virtual bool ItemSelected(const ui::Event& event) OVERRIDE { return false; } - virtual string16 GetTitle() OVERRIDE { return string16(); } + virtual base::string16 GetTitle() OVERRIDE { return base::string16(); } virtual ChromeLauncherAppMenuItems GetApplicationList( int event_flags) OVERRIDE { ChromeLauncherAppMenuItems items; @@ -2055,7 +2055,7 @@ TEST_F(ChromeLauncherControllerTest, PendingInsertionOrder) { bool CheckMenuCreation(ChromeLauncherController* controller, const ash::LauncherItem& item, size_t expected_items, - string16 title[], + base::string16 title[], bool is_browser) { ChromeLauncherAppMenuItems items = controller->GetApplicationList(item, 0); // A new behavior has been added: Only show menus if there is at least one @@ -2111,9 +2111,9 @@ TEST_F(ChromeLauncherControllerTest, BrowserMenuGeneration) { // Now make the created browser() visible by adding it to the active browser // list. BrowserList::SetLastActive(browser()); - string16 title1 = ASCIIToUTF16("Test1"); + base::string16 title1 = ASCIIToUTF16("Test1"); NavigateAndCommitActiveTabWithTitle(browser(), GURL("http://test1"), title1); - string16 one_menu_item[] = { title1 }; + base::string16 one_menu_item[] = { title1 }; EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_browser, 1, one_menu_item, true)); @@ -2124,13 +2124,13 @@ TEST_F(ChromeLauncherControllerTest, BrowserMenuGeneration) { chrome::CreateBrowserWithTestWindowForParams(&ash_params)); chrome::NewTab(browser2.get()); BrowserList::SetLastActive(browser2.get()); - string16 title2 = ASCIIToUTF16("Test2"); + base::string16 title2 = ASCIIToUTF16("Test2"); NavigateAndCommitActiveTabWithTitle(browser2.get(), GURL("http://test2"), title2); // Check that the list contains now two entries - make furthermore sure that // the active item is the first entry. - string16 two_menu_items[] = {title1, title2}; + base::string16 two_menu_items[] = {title1, title2}; EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_browser, 2, two_menu_items, true)); @@ -2158,9 +2158,9 @@ TEST_F(MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest, // Show the created |browser()| by adding it to the active browser list. BrowserList::SetLastActive(browser()); - string16 title1 = ASCIIToUTF16("Test1"); + base::string16 title1 = ASCIIToUTF16("Test1"); NavigateAndCommitActiveTabWithTitle(browser(), GURL("http://test1"), title1); - string16 one_menu_item1[] = { title1 }; + base::string16 one_menu_item1[] = { title1 }; EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_browser, 1, one_menu_item1, true)); @@ -2170,7 +2170,7 @@ TEST_F(MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest, TestingProfile* profile2 = CreateMultiUserProfile(user2); scoped_ptr<Browser> browser2( CreateBrowserAndTabWithProfile(profile2, user2, "http://test2")); - string16 one_menu_item2[] = { ASCIIToUTF16(user2) }; + base::string16 one_menu_item2[] = { ASCIIToUTF16(user2) }; EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_browser, 1, one_menu_item1, true)); @@ -2227,16 +2227,16 @@ TEST_F(ChromeLauncherControllerTest, V1AppMenuGeneration) { launcher_controller_.get(), item_gmail, 0, NULL, false)); // Set the gmail URL to a new tab. - string16 title1 = ASCIIToUTF16("Test1"); + base::string16 title1 = ASCIIToUTF16("Test1"); NavigateAndCommitActiveTabWithTitle(browser(), GURL(gmail_url), title1); - string16 one_menu_item[] = { title1 }; + base::string16 one_menu_item[] = { title1 }; EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_gmail, 1, one_menu_item, false)); // Create one empty tab. chrome::NewTab(browser()); - string16 title2 = ASCIIToUTF16("Test2"); + base::string16 title2 = ASCIIToUTF16("Test2"); NavigateAndCommitActiveTabWithTitle( browser(), GURL("https://bla"), @@ -2244,15 +2244,15 @@ TEST_F(ChromeLauncherControllerTest, V1AppMenuGeneration) { // and another one with another gmail instance. chrome::NewTab(browser()); - string16 title3 = ASCIIToUTF16("Test3"); + base::string16 title3 = ASCIIToUTF16("Test3"); NavigateAndCommitActiveTabWithTitle(browser(), GURL(gmail_url), title3); - string16 two_menu_items[] = {title1, title3}; + base::string16 two_menu_items[] = {title1, title3}; EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_gmail, 2, two_menu_items, false)); // Even though the item is in the V1 app list, it should also be in the // browser list. - string16 browser_menu_item[] = {title3}; + base::string16 browser_menu_item[] = {title3}; EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_browser, 1, browser_menu_item, false)); @@ -2262,7 +2262,7 @@ TEST_F(ChromeLauncherControllerTest, V1AppMenuGeneration) { EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_gmail, 0, NULL, false)); - string16 browser_menu_item2[] = { title2 }; + base::string16 browser_menu_item2[] = { title2 }; EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_browser, 1, browser_menu_item2, false)); } @@ -2297,10 +2297,10 @@ TEST_F(MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest, launcher_controller_.get(), item_gmail, 0, NULL, false)); // Set the gmail URL to a new tab. - string16 title1 = ASCIIToUTF16("Test1"); + base::string16 title1 = ASCIIToUTF16("Test1"); NavigateAndCommitActiveTabWithTitle(browser(), GURL(gmail_url), title1); - string16 one_menu_item[] = { title1 }; + base::string16 one_menu_item[] = { title1 }; EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_gmail, 1, one_menu_item, false)); @@ -2405,17 +2405,17 @@ TEST_F(ChromeLauncherControllerTest, V1AppMenuExecution) { ash::LauncherID gmail_id = model_->next_id(); extension_service_->AddExtension(extension3_.get()); launcher_controller_->SetRefocusURLPatternForTest(gmail_id, GURL(gmail_url)); - string16 title1 = ASCIIToUTF16("Test1"); + base::string16 title1 = ASCIIToUTF16("Test1"); NavigateAndCommitActiveTabWithTitle(browser(), GURL(gmail_url), title1); chrome::NewTab(browser()); - string16 title2 = ASCIIToUTF16("Test2"); + base::string16 title2 = ASCIIToUTF16("Test2"); NavigateAndCommitActiveTabWithTitle(browser(), GURL(gmail_url), title2); // Check that the menu is properly set. ash::LauncherItem item_gmail; item_gmail.type = ash::TYPE_APP_SHORTCUT; item_gmail.id = gmail_id; - string16 two_menu_items[] = {title1, title2}; + base::string16 two_menu_items[] = {title1, title2}; EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_gmail, 2, two_menu_items, false)); EXPECT_EQ(1, browser()->tab_strip_model()->active_index()); @@ -2454,17 +2454,17 @@ TEST_F(ChromeLauncherControllerTest, V1AppMenuDeletionExecution) { ash::LauncherID gmail_id = model_->next_id(); extension_service_->AddExtension(extension3_.get()); launcher_controller_->SetRefocusURLPatternForTest(gmail_id, GURL(gmail_url)); - string16 title1 = ASCIIToUTF16("Test1"); + base::string16 title1 = ASCIIToUTF16("Test1"); NavigateAndCommitActiveTabWithTitle(browser(), GURL(gmail_url), title1); chrome::NewTab(browser()); - string16 title2 = ASCIIToUTF16("Test2"); + base::string16 title2 = ASCIIToUTF16("Test2"); NavigateAndCommitActiveTabWithTitle(browser(), GURL(gmail_url), title2); // Check that the menu is properly set. ash::LauncherItem item_gmail; item_gmail.type = ash::TYPE_APP_SHORTCUT; item_gmail.id = gmail_id; - string16 two_menu_items[] = {title1, title2}; + base::string16 two_menu_items[] = {title1, title2}; EXPECT_TRUE(CheckMenuCreation( launcher_controller_.get(), item_gmail, 2, two_menu_items, false)); @@ -2548,7 +2548,7 @@ TEST_F(ChromeLauncherControllerTest, GmailMatching) { // Create a Gmail browser tab. chrome::NewTab(browser()); - string16 title = ASCIIToUTF16("Test"); + base::string16 title = ASCIIToUTF16("Test"); NavigateAndCommitActiveTabWithTitle(browser(), GURL(gmail_url), title); content::WebContents* content = browser()->tab_strip_model()->GetActiveWebContents(); @@ -2580,7 +2580,7 @@ TEST_F(ChromeLauncherControllerTest, GmailOfflineMatching) { // Create a Gmail browser tab. chrome::NewTab(browser()); - string16 title = ASCIIToUTF16("Test"); + base::string16 title = ASCIIToUTF16("Test"); NavigateAndCommitActiveTabWithTitle(browser(), GURL(offline_gmail_url), title); diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc index 620ca95..ea15a95 100644 --- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc +++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc @@ -73,7 +73,7 @@ void LauncherContextMenu::Init() { item_.type == ash::TYPE_WINDOWED_APP) { // V1 apps can be started from the menu - but V2 apps should not. if (!controller_->IsPlatformApp(item_.id)) { - AddItem(MENU_OPEN_NEW, string16()); + AddItem(MENU_OPEN_NEW, base::string16()); AddSeparator(ui::NORMAL_SEPARATOR); } AddItem( @@ -129,7 +129,7 @@ void LauncherContextMenu::Init() { if (!app_id.empty()) { int index = 0; extension_items_->AppendExtensionItems( - app_id, string16(), &index); + app_id, base::string16(), &index); AddSeparator(ui::NORMAL_SEPARATOR); } } @@ -175,7 +175,7 @@ string16 LauncherContextMenu::GetLabelForCommandId(int command_id) const { } } NOTREACHED(); - return string16(); + return base::string16(); } bool LauncherContextMenu::IsCommandIdChecked(int command_id) const { diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.h b/chrome/browser/ui/ash/launcher/launcher_context_menu.h index 5b89dfb..bf73f1f 100644 --- a/chrome/browser/ui/ash/launcher/launcher_context_menu.h +++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.h @@ -43,7 +43,7 @@ class LauncherContextMenu : public ui::SimpleMenuModel, // ui::SimpleMenuModel::Delegate overrides: virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE; - virtual string16 GetLabelForCommandId(int command_id) const OVERRIDE; + virtual base::string16 GetLabelForCommandId(int command_id) const OVERRIDE; virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; virtual bool GetAcceleratorForCommandId( diff --git a/chrome/browser/ui/ash/launcher/launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/launcher_item_controller.cc index e97b9c6..b205cdb 100644 --- a/chrome/browser/ui/ash/launcher/launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/launcher_item_controller.cc @@ -32,11 +32,11 @@ const std::string& LauncherItemController::app_id() const { string16 LauncherItemController::GetAppTitle() const { if (app_id_.empty()) - return string16(); + return base::string16(); const extensions::Extension* extension = launcher_controller_->profile()->GetExtensionService()-> GetInstalledExtension(app_id_); - return extension ? UTF8ToUTF16(extension->name()) : string16(); + return extension ? UTF8ToUTF16(extension->name()) : base::string16(); } ash::LauncherItemType LauncherItemController::GetLauncherItemType() const { diff --git a/chrome/browser/ui/ash/launcher/launcher_item_controller.h b/chrome/browser/ui/ash/launcher/launcher_item_controller.h index 9654461..633440f 100644 --- a/chrome/browser/ui/ash/launcher/launcher_item_controller.h +++ b/chrome/browser/ui/ash/launcher/launcher_item_controller.h @@ -90,7 +90,7 @@ class LauncherItemController : public ash::ShelfItemDelegate { protected: // Helper function to return the title associated with |app_id_|. // Returns an empty title if no matching extension can be found. - string16 GetAppTitle() const; + base::string16 GetAppTitle() const; private: const Type type_; diff --git a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc index 07ce41a..4a0ca09 100644 --- a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc @@ -214,7 +214,7 @@ base::string16 ShellWindowLauncherItemController::GetTitle() { if (type() == TYPE_APP_PANEL && !shell_windows_.empty()) { ShellWindow* shell_window = shell_windows_.front(); if (shell_window->web_contents()) { - string16 title = shell_window->web_contents()->GetTitle(); + base::string16 title = shell_window->web_contents()->GetTitle(); if (!title.empty()) return title; } diff --git a/chrome/browser/ui/ash/screenshot_taker.cc b/chrome/browser/ui/ash/screenshot_taker.cc index 55fc14a..0828f87 100644 --- a/chrome/browser/ui/ash/screenshot_taker.cc +++ b/chrome/browser/ui/ash/screenshot_taker.cc @@ -513,12 +513,12 @@ Notification* ScreenshotTaker::CreateNotification( // We cancel a previous screenshot notification, if any, to ensure we get // a fresh notification pop-up. g_browser_process->notification_ui_manager()->CancelById(notification_id); - const string16 replace_id(UTF8ToUTF16(notification_id)); + const base::string16 replace_id(UTF8ToUTF16(notification_id)); bool success = (screenshot_result == ScreenshotTakerObserver::SCREENSHOT_SUCCESS); message_center::RichNotificationData optional_field; if (success) { - const string16 label = l10n_util::GetStringUTF16( + const base::string16 label = l10n_util::GetStringUTF16( IDS_MESSAGE_CENTER_NOTIFICATION_BUTTON_COPY_SCREENSHOT_TO_CLIPBOARD); optional_field.buttons.push_back(message_center::ButtonInfo(label)); } diff --git a/chrome/browser/ui/ash/system_tray_delegate_win.cc b/chrome/browser/ui/ash/system_tray_delegate_win.cc index 31a09a2..90069ca 100644 --- a/chrome/browser/ui/ash/system_tray_delegate_win.cc +++ b/chrome/browser/ui/ash/system_tray_delegate_win.cc @@ -72,20 +72,21 @@ class SystemTrayDelegateWin : public ash::SystemTrayDelegate, return std::string(); } - virtual const string16 GetEnterpriseMessage() const OVERRIDE { - return string16(); + virtual const base::string16 GetEnterpriseMessage() const OVERRIDE { + return base::string16(); } virtual const std::string GetLocallyManagedUserManager() const OVERRIDE { return std::string(); } - virtual const string16 GetLocallyManagedUserManagerName() const OVERRIDE { - return string16(); + virtual const base::string16 GetLocallyManagedUserManagerName() const + OVERRIDE { + return base::string16(); } - virtual const string16 GetLocallyManagedUserMessage() const OVERRIDE { - return string16(); + virtual const base::string16 GetLocallyManagedUserMessage() const OVERRIDE { + return base::string16(); } virtual bool SystemShouldUpgrade() const OVERRIDE { diff --git a/chrome/browser/ui/auto_login_infobar_delegate.h b/chrome/browser/ui/auto_login_infobar_delegate.h index db47dae..f2481a2 100644 --- a/chrome/browser/ui/auto_login_infobar_delegate.h +++ b/chrome/browser/ui/auto_login_infobar_delegate.h @@ -58,8 +58,8 @@ class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate, virtual int GetIconID() const OVERRIDE; virtual Type GetInfoBarType() const OVERRIDE; virtual AutoLoginInfoBarDelegate* AsAutoLoginInfoBarDelegate() OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; diff --git a/chrome/browser/ui/autofill/autofill_dialog_common.cc b/chrome/browser/ui/autofill/autofill_dialog_common.cc index 753104e..0015896 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_common.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_common.cc @@ -213,7 +213,7 @@ string16 GetHardcodedValueForType(ServerFieldType type) { return country.name(); } - return string16(); + return base::string16(); } } // namespace common diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc index e36e4f4..a6af2b0 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc @@ -123,12 +123,12 @@ class TestAutofillDialogController : public AutofillDialogControllerImpl { AutofillDialogControllerImpl::ViewClosed(); } - virtual string16 InputValidityMessage( + virtual base::string16 InputValidityMessage( DialogSection section, ServerFieldType type, - const string16& value) OVERRIDE { + const base::string16& value) OVERRIDE { if (!use_validation_) - return string16(); + return base::string16(); return AutofillDialogControllerImpl::InputValidityMessage( section, type, value); } @@ -505,7 +505,7 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, FillInputFromAutofill) { const DetailInputs& inputs = controller()->RequestedFieldsForSection(SECTION_SHIPPING); const DetailInput& triggering_input = inputs[0]; - string16 value = full_profile.GetRawInfo(triggering_input.type); + base::string16 value = full_profile.GetRawInfo(triggering_input.type); TestableAutofillDialogView* view = controller()->GetTestableView(); view->SetTextContentsOfInput(triggering_input, value.substr(0, value.size() / 2)); @@ -524,10 +524,11 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, FillInputFromAutofill) { // Now simulate some user edits and try again. std::vector<string16> expectations; for (size_t i = 0; i < inputs.size(); ++i) { - string16 users_input = i % 2 == 0 ? string16() : ASCIIToUTF16("dummy"); + base::string16 users_input = i % 2 == 0 ? base::string16() + : ASCIIToUTF16("dummy"); view->SetTextContentsOfInput(inputs[i], users_input); // Empty inputs should be filled, others should be left alone. - string16 expectation = + base::string16 expectation = &inputs[i] == &triggering_input || users_input.empty() ? wrapper.GetInfo(AutofillType(inputs[i].type)) : users_input; @@ -557,7 +558,7 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, const DetailInputs& inputs = controller()->RequestedFieldsForSection(SECTION_SHIPPING); const DetailInput& triggering_input = inputs[0]; - string16 value = full_profile.GetRawInfo(triggering_input.type); + base::string16 value = full_profile.GetRawInfo(triggering_input.type); TestableAutofillDialogView* view = controller()->GetTestableView(); view->SetTextContentsOfInput(triggering_input, value.substr(0, value.size() / 2)); @@ -569,7 +570,7 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, // All inputs should be filled. AutofillProfileWrapper wrapper(&full_profile); for (size_t i = 0; i < inputs.size(); ++i) { - string16 expectation = + base::string16 expectation = AutofillType(inputs[i].type).GetStorableType() == ADDRESS_HOME_COUNTRY ? ASCIIToUTF16("United States") : wrapper.GetInfo(AutofillType(inputs[i].type)); @@ -579,10 +580,11 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, // Now simulate some user edits and try again. std::vector<string16> expectations; for (size_t i = 0; i < inputs.size(); ++i) { - string16 users_input = i % 2 == 0 ? string16() : ASCIIToUTF16("dummy"); + base::string16 users_input = i % 2 == 0 ? base::string16() + : ASCIIToUTF16("dummy"); view->SetTextContentsOfInput(inputs[i], users_input); // Empty inputs should be filled, others should be left alone. - string16 expectation = + base::string16 expectation = &inputs[i] == &triggering_input || users_input.empty() ? wrapper.GetInfo(AutofillType(inputs[i].type)) : users_input; @@ -669,7 +671,7 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, const DetailInputs& inputs = controller()->RequestedFieldsForSection(SECTION_CC); const DetailInput& triggering_input = inputs[0]; - string16 value = card1.GetRawInfo(triggering_input.type); + base::string16 value = card1.GetRawInfo(triggering_input.type); TestableAutofillDialogView* view = controller()->GetTestableView(); view->SetTextContentsOfInput(triggering_input, value.substr(0, value.size() / 2)); diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc index 127706e..f682dce 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc @@ -319,7 +319,7 @@ const wallet::Address* FindDuplicateAddress( return NULL; } -bool IsCardHolderNameValidForWallet(const string16& name) { +bool IsCardHolderNameValidForWallet(const base::string16& name) { base::string16 whitespace_collapsed_name = CollapseWhitespace(name, true); std::vector<base::string16> split_name; base::SplitString(whitespace_collapsed_name, ' ', &split_name); @@ -660,14 +660,14 @@ TestableAutofillDialogView* AutofillDialogControllerImpl::GetTestableView() { //////////////////////////////////////////////////////////////////////////////// // AutofillDialogViewDelegate implementation. -string16 AutofillDialogControllerImpl::DialogTitle() const { +base::string16 AutofillDialogControllerImpl::DialogTitle() const { if (ShouldShowSpinner()) - return string16(); + return base::string16(); return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_TITLE); } -string16 AutofillDialogControllerImpl::AccountChooserText() const { +base::string16 AutofillDialogControllerImpl::AccountChooserText() const { if (!account_chooser_model_.WalletIsSelected()) return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PAYING_WITHOUT_WALLET); @@ -675,10 +675,10 @@ string16 AutofillDialogControllerImpl::AccountChooserText() const { return account_chooser_model_.GetActiveWalletAccountName(); // In this case, the account chooser should be showing the signin link. - return string16(); + return base::string16(); } -string16 AutofillDialogControllerImpl::SignInLinkText() const { +base::string16 AutofillDialogControllerImpl::SignInLinkText() const { int ids = SignedInState() == NOT_CHECKED ? IDS_AUTOFILL_DIALOG_USE_WALLET_LINK : ShouldShowSignInWebView() ? IDS_AUTOFILL_DIALOG_CANCEL_SIGN_IN : @@ -687,34 +687,34 @@ string16 AutofillDialogControllerImpl::SignInLinkText() const { return l10n_util::GetStringUTF16(ids); } -string16 AutofillDialogControllerImpl::SpinnerText() const { +base::string16 AutofillDialogControllerImpl::SpinnerText() const { return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_LOADING); } -string16 AutofillDialogControllerImpl::EditSuggestionText() const { +base::string16 AutofillDialogControllerImpl::EditSuggestionText() const { return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_EDIT); } -string16 AutofillDialogControllerImpl::CancelButtonText() const { +base::string16 AutofillDialogControllerImpl::CancelButtonText() const { return l10n_util::GetStringUTF16(IDS_CANCEL); } -string16 AutofillDialogControllerImpl::ConfirmButtonText() const { +base::string16 AutofillDialogControllerImpl::ConfirmButtonText() const { return l10n_util::GetStringUTF16(IsSubmitPausedOn(wallet::VERIFY_CVV) ? IDS_AUTOFILL_DIALOG_VERIFY_BUTTON : IDS_AUTOFILL_DIALOG_SUBMIT_BUTTON); } -string16 AutofillDialogControllerImpl::SaveLocallyText() const { +base::string16 AutofillDialogControllerImpl::SaveLocallyText() const { return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SAVE_LOCALLY_CHECKBOX); } -string16 AutofillDialogControllerImpl::SaveLocallyTooltip() const { +base::string16 AutofillDialogControllerImpl::SaveLocallyTooltip() const { return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SAVE_LOCALLY_TOOLTIP); } -string16 AutofillDialogControllerImpl::LegalDocumentsText() { +base::string16 AutofillDialogControllerImpl::LegalDocumentsText() { if (!IsPayingWithWallet() || ShouldShowSignInWebView()) - return string16(); + return base::string16(); return legal_documents_text_; } @@ -795,7 +795,7 @@ DialogOverlayState AutofillDialogControllerImpl::GetDialogOverlay() { card_scrambling_delay_.Stop(); card_scrambling_refresher_.Stop(); - string16 cc_number = + base::string16 cc_number = full_wallet_->GetInfo(AutofillType(CREDIT_CARD_NUMBER)); DCHECK_GE(cc_number.size(), 4U); state.image = GetGeneratedCardImage( @@ -1070,7 +1070,8 @@ void AutofillDialogControllerImpl::ConstructLegalDocumentsText() { } std::vector<size_t> offsets; - string16 text = l10n_util::GetStringFUTF16(resource_id, link_names, &offsets); + base::string16 text = + l10n_util::GetStringFUTF16(resource_id, link_names,&offsets); // Tack on the location string if need be. size_t base_offset = 0; @@ -1107,7 +1108,7 @@ void AutofillDialogControllerImpl::ShowEditUiIfBadSuggestion( // If the chosen item in |model| yields an empty suggestion text, it is // invalid. In this case, show the edit UI and highlight invalid fields. SuggestionsMenuModel* model = SuggestionsMenuModelForSection(section); - string16 unused, unused2; + base::string16 unused, unused2; if (IsASuggestionItemKey(model->GetItemKeyForCheckedItem()) && !SuggestionTextForSection(section, &unused, &unused2)) { SetEditingExistingData(section, true); @@ -1355,8 +1356,8 @@ gfx::Image AutofillDialogControllerImpl::ButtonStripImage() const { return gfx::Image(); } -string16 AutofillDialogControllerImpl::LabelForSection(DialogSection section) - const { +base::string16 AutofillDialogControllerImpl::LabelForSection( + DialogSection section) const { switch (section) { case SECTION_CC: return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECTION_CC); @@ -1367,12 +1368,12 @@ string16 AutofillDialogControllerImpl::LabelForSection(DialogSection section) return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECTION_SHIPPING); } NOTREACHED(); - return string16(); + return base::string16(); } SuggestionState AutofillDialogControllerImpl::SuggestionStateForSection( DialogSection section) { - string16 vertically_compact, horizontally_compact; + base::string16 vertically_compact, horizontally_compact; bool show_suggestion = SuggestionTextForSection(section, &vertically_compact, &horizontally_compact); @@ -1415,7 +1416,7 @@ bool AutofillDialogControllerImpl::SuggestionTextForSection( return wrapper->GetDisplayText(vertically_compact, horizontally_compact); } -string16 AutofillDialogControllerImpl::RequiredActionTextForSection( +base::string16 AutofillDialogControllerImpl::RequiredActionTextForSection( DialogSection section) const { if (section == SECTION_CC_BILLING && IsSubmitPausedOn(wallet::VERIFY_CVV)) { const wallet::WalletItems::MaskedInstrument* current_instrument = @@ -1430,17 +1431,17 @@ string16 AutofillDialogControllerImpl::RequiredActionTextForSection( return card.TypeAndLastFourDigits(); } - return string16(); + return base::string16(); } -string16 AutofillDialogControllerImpl::ExtraSuggestionTextForSection( +base::string16 AutofillDialogControllerImpl::ExtraSuggestionTextForSection( DialogSection section) const { if (section == SECTION_CC || (section == SECTION_CC_BILLING && IsSubmitPausedOn(wallet::VERIFY_CVV))) { return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PLACEHOLDER_CVC); } - return string16(); + return base::string16(); } const wallet::WalletItems::MaskedInstrument* AutofillDialogControllerImpl:: @@ -1565,7 +1566,7 @@ FieldIconMap AutofillDialogControllerImpl::IconsForFields( FieldValueMap::const_iterator credit_card_iter = user_inputs.find(CREDIT_CARD_NUMBER); if (credit_card_iter != user_inputs.end()) { - const string16& number = credit_card_iter->second; + const base::string16& number = credit_card_iter->second; const std::string type = CreditCard::GetCreditCardType(number); credit_card_type = CreditCard::TypeForDisplay(type); result[CREDIT_CARD_NUMBER] = CreditCardIconForType(type); @@ -1585,12 +1586,12 @@ bool AutofillDialogControllerImpl::FieldControlsIcons( return type == CREDIT_CARD_NUMBER; } -string16 AutofillDialogControllerImpl::TooltipForField(ServerFieldType type) - const { +base::string16 AutofillDialogControllerImpl::TooltipForField( + ServerFieldType type) const { if (type == PHONE_HOME_WHOLE_NUMBER || type == PHONE_BILLING_WHOLE_NUMBER) return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_TOOLTIP_PHONE_NUMBER); - return string16(); + return base::string16(); } bool AutofillDialogControllerImpl::InputIsEditable( @@ -1629,10 +1630,10 @@ bool AutofillDialogControllerImpl::InputIsEditable( } // TODO(groby): Add more tests. -string16 AutofillDialogControllerImpl::InputValidityMessage( +base::string16 AutofillDialogControllerImpl::InputValidityMessage( DialogSection section, ServerFieldType type, - const string16& value) { + const base::string16& value) { // If the field is edited, clear any Wallet errors. if (IsPayingWithWallet()) { WalletValidationErrors::iterator it = wallet_errors_.find(section); @@ -1739,7 +1740,7 @@ ValidityMessages AutofillDialogControllerImpl::InputsAreValid( DialogSection section, const FieldValueMap& inputs) { ValidityMessages messages; - std::map<ServerFieldType, string16> field_values; + std::map<ServerFieldType, base::string16> field_values; for (FieldValueMap::const_iterator iter = inputs.begin(); iter != inputs.end(); ++iter) { const ServerFieldType type = iter->first; @@ -1843,7 +1844,7 @@ void AutofillDialogControllerImpl::UserEditedOrActivatedInput( ServerFieldType type, gfx::NativeView parent_view, const gfx::Rect& content_bounds, - const string16& field_contents, + const base::string16& field_contents, bool was_edit) { // If the field is edited down to empty, don't show a popup. if (was_edit && field_contents.empty()) { @@ -2146,8 +2147,9 @@ void AutofillDialogControllerImpl::DidSelectSuggestion(int identifier) { // TODO(estade): implement. } -void AutofillDialogControllerImpl::DidAcceptSuggestion(const string16& value, - int identifier) { +void AutofillDialogControllerImpl::DidAcceptSuggestion( + const base::string16& value, + int identifier) { ScopedViewUpdates updates(view_.get()); const PersonalDataManager::GUIDPair& pair = popup_guids_[identifier]; @@ -2175,8 +2177,9 @@ void AutofillDialogControllerImpl::DidAcceptSuggestion(const string16& value, HidePopup(); } -void AutofillDialogControllerImpl::RemoveSuggestion(const string16& value, - int identifier) { +void AutofillDialogControllerImpl::RemoveSuggestion( + const base::string16& value, + int identifier) { // TODO(estade): implement. } @@ -2943,7 +2946,7 @@ void AutofillDialogControllerImpl::SetOutputForFieldsOfType( } } -string16 AutofillDialogControllerImpl::GetValueFromSection( +base::string16 AutofillDialogControllerImpl::GetValueFromSection( DialogSection section, ServerFieldType type) { DCHECK(SectionIsActive(section)); @@ -3218,7 +3221,7 @@ scoped_ptr<wallet::Instrument> AutofillDialogControllerImpl:: CreditCard card; AutofillProfile profile; - string16 cvc; + base::string16 cvc; GetBillingInfoFromOutputs(output, &card, &cvc, &profile); return scoped_ptr<wallet::Instrument>( diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h index a9acd42..b5556ec 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h @@ -96,16 +96,16 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate, TestableAutofillDialogView* GetTestableView(); // AutofillDialogViewDelegate implementation. - virtual string16 DialogTitle() const OVERRIDE; - virtual string16 AccountChooserText() const OVERRIDE; - virtual string16 SignInLinkText() const OVERRIDE; - virtual string16 SpinnerText() const OVERRIDE; - virtual string16 EditSuggestionText() const OVERRIDE; - virtual string16 CancelButtonText() const OVERRIDE; - virtual string16 ConfirmButtonText() const OVERRIDE; - virtual string16 SaveLocallyText() const OVERRIDE; - virtual string16 SaveLocallyTooltip() const OVERRIDE; - virtual string16 LegalDocumentsText() OVERRIDE; + virtual base::string16 DialogTitle() const OVERRIDE; + virtual base::string16 AccountChooserText() const OVERRIDE; + virtual base::string16 SignInLinkText() const OVERRIDE; + virtual base::string16 SpinnerText() const OVERRIDE; + virtual base::string16 EditSuggestionText() const OVERRIDE; + virtual base::string16 CancelButtonText() const OVERRIDE; + virtual base::string16 ConfirmButtonText() const OVERRIDE; + virtual base::string16 SaveLocallyText() const OVERRIDE; + virtual base::string16 SaveLocallyTooltip() const OVERRIDE; + virtual base::string16 LegalDocumentsText() OVERRIDE; virtual bool ShouldShowSpinner() const OVERRIDE; virtual bool ShouldShowSignInWebView() const OVERRIDE; virtual GURL SignInUrl() const OVERRIDE; @@ -124,25 +124,25 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate, virtual ui::ComboboxModel* ComboboxModelForAutofillType( ServerFieldType type) OVERRIDE; virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; - virtual string16 LabelForSection(DialogSection section) const OVERRIDE; + virtual base::string16 LabelForSection(DialogSection section) const OVERRIDE; virtual SuggestionState SuggestionStateForSection( DialogSection section) OVERRIDE; virtual FieldIconMap IconsForFields(const FieldValueMap& user_inputs) const OVERRIDE; virtual bool FieldControlsIcons(ServerFieldType type) const OVERRIDE; - virtual string16 TooltipForField(ServerFieldType type) const OVERRIDE; + virtual base::string16 TooltipForField(ServerFieldType type) const OVERRIDE; virtual bool InputIsEditable(const DetailInput& input, DialogSection section) OVERRIDE; - virtual string16 InputValidityMessage(DialogSection section, + virtual base::string16 InputValidityMessage(DialogSection section, ServerFieldType type, - const string16& value) OVERRIDE; + const base::string16& value) OVERRIDE; virtual ValidityMessages InputsAreValid( DialogSection section, const FieldValueMap& inputs) OVERRIDE; virtual void UserEditedOrActivatedInput(DialogSection section, ServerFieldType type, gfx::NativeView parent_view, const gfx::Rect& content_bounds, - const string16& field_contents, + const base::string16& field_contents, bool was_edit) OVERRIDE; virtual bool HandleKeyPressEventInInput( const content::NativeWebKeyboardEvent& event) OVERRIDE; @@ -165,9 +165,9 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate, virtual void OnPopupHidden() OVERRIDE; virtual bool ShouldRepostEvent(const ui::MouseEvent& event) OVERRIDE; virtual void DidSelectSuggestion(int identifier) OVERRIDE; - virtual void DidAcceptSuggestion(const string16& value, + virtual void DidAcceptSuggestion(const base::string16& value, int identifier) OVERRIDE; - virtual void RemoveSuggestion(const string16& value, + virtual void RemoveSuggestion(const base::string16& value, int identifier) OVERRIDE; virtual void ClearPreviewedForm() OVERRIDE; @@ -412,11 +412,12 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate, // Finds all fields of the given |type| in |form_structure_|, if any, and sets // each field's value to |output|. - void SetOutputForFieldsOfType(ServerFieldType type, const string16& output); + void SetOutputForFieldsOfType(ServerFieldType type, + const base::string16& output); // Gets the value for |type| in |section|, whether it comes from manual user // input or the active suggestion. - string16 GetValueFromSection(DialogSection section, + base::string16 GetValueFromSection(DialogSection section, ServerFieldType type); // Gets the SuggestionsMenuModel for |section|. @@ -434,9 +435,9 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate, bool SuggestionTextForSection(DialogSection section, base::string16* vertically_compact, base::string16* horizontally_compact); - string16 RequiredActionTextForSection(DialogSection section) const; + base::string16 RequiredActionTextForSection(DialogSection section) const; gfx::Image SuggestionIconForSection(DialogSection section); - string16 ExtraSuggestionTextForSection(DialogSection section) const; + base::string16 ExtraSuggestionTextForSection(DialogSection section) const; gfx::Image ExtraSuggestionIconForSection(DialogSection section); // Loads profiles that can suggest data for |type|. |field_contents| is the @@ -445,7 +446,7 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate, // |popup_guids_|. void GetProfileSuggestions( ServerFieldType type, - const string16& field_contents, + const base::string16& field_contents, const DetailInputs& inputs, std::vector<string16>* popup_values, std::vector<string16>* popup_labels, @@ -635,7 +636,7 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate, std::string risk_data_; // The text to display when the user is accepting new terms of service, etc. - string16 legal_documents_text_; + base::string16 legal_documents_text_; // The ranges within |legal_documents_text_| to linkify. std::vector<gfx::Range> legal_document_link_ranges_; diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc index bb5be6d4..70fb6fc 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc @@ -180,7 +180,7 @@ class TestAutofillDialogView : public AutofillDialogView { return NULL; } - virtual string16 GetCvc() OVERRIDE { return string16(); } + virtual base::string16 GetCvc() OVERRIDE { return base::string16(); } virtual bool HitTestInput(const DetailInput& input, const gfx::Point& screen_point) OVERRIDE { return false; @@ -623,7 +623,7 @@ TEST_F(AutofillDialogControllerTest, ValidityCheck) { controller()->RequestedFieldsForSection(section); for (DetailInputs::const_iterator iter = shipping_inputs.begin(); iter != shipping_inputs.end(); ++iter) { - controller()->InputValidityMessage(section, iter->type, string16()); + controller()->InputValidityMessage(section, iter->type, base::string16()); } } } @@ -849,7 +849,7 @@ TEST_F(AutofillDialogControllerTest, AutofillProfiles) { // An otherwise full but unverified profile should be ignored. AutofillProfile full_profile(test::GetFullProfile()); full_profile.set_origin("https://www.example.com"); - full_profile.SetRawInfo(ADDRESS_HOME_LINE2, string16()); + full_profile.SetRawInfo(ADDRESS_HOME_LINE2, base::string16()); controller()->GetTestingManager()->AddTestingProfile(&full_profile); shipping_model = controller()->MenuModelForSection(SECTION_SHIPPING); ASSERT_TRUE(shipping_model); @@ -857,7 +857,7 @@ TEST_F(AutofillDialogControllerTest, AutofillProfiles) { // A full, verified profile should be picked up. AutofillProfile verified_profile(test::GetVerifiedProfile()); - verified_profile.SetRawInfo(ADDRESS_HOME_LINE2, string16()); + verified_profile.SetRawInfo(ADDRESS_HOME_LINE2, base::string16()); controller()->GetTestingManager()->AddTestingProfile(&verified_profile); shipping_model = controller()->MenuModelForSection(SECTION_SHIPPING); ASSERT_TRUE(shipping_model); @@ -973,7 +973,7 @@ TEST_F(AutofillDialogControllerTest, AutofillProfileVariants) { TEST_F(AutofillDialogControllerTest, SuggestValidEmail) { SwitchToAutofill(); AutofillProfile profile(test::GetVerifiedProfile()); - const string16 kValidEmail = ASCIIToUTF16(kFakeEmail); + const base::string16 kValidEmail = ASCIIToUTF16(kFakeEmail); profile.SetRawInfo(EMAIL_ADDRESS, kValidEmail); controller()->GetTestingManager()->AddTestingProfile(&profile); @@ -1077,21 +1077,21 @@ TEST_F(AutofillDialogControllerTest, DontUseBillingAsShipping) { EXPECT_EQ(ADDRESS_HOME_STATE, form_structure()->field(16)->Type().GetStorableType()); EXPECT_EQ(ADDRESS_HOME, form_structure()->field(16)->Type().group()); - string16 billing_state = form_structure()->field(9)->value; - string16 shipping_state = form_structure()->field(16)->value; + base::string16 billing_state = form_structure()->field(9)->value; + base::string16 shipping_state = form_structure()->field(16)->value; EXPECT_FALSE(billing_state.empty()); EXPECT_FALSE(shipping_state.empty()); EXPECT_NE(billing_state, shipping_state); EXPECT_EQ(CREDIT_CARD_NAME, form_structure()->field(1)->Type().GetStorableType()); - string16 cc_name = form_structure()->field(1)->value; + base::string16 cc_name = form_structure()->field(1)->value; EXPECT_EQ(NAME_FULL, form_structure()->field(6)->Type().GetStorableType()); EXPECT_EQ(NAME_BILLING, form_structure()->field(6)->Type().group()); - string16 billing_name = form_structure()->field(6)->value; + base::string16 billing_name = form_structure()->field(6)->value; EXPECT_EQ(NAME_FULL, form_structure()->field(13)->Type().GetStorableType()); EXPECT_EQ(NAME, form_structure()->field(13)->Type().group()); - string16 shipping_name = form_structure()->field(13)->value; + base::string16 shipping_name = form_structure()->field(13)->value; EXPECT_FALSE(cc_name.empty()); EXPECT_FALSE(billing_name.empty()); @@ -1122,21 +1122,21 @@ TEST_F(AutofillDialogControllerTest, UseBillingAsShipping) { EXPECT_EQ(ADDRESS_HOME_STATE, form_structure()->field(16)->Type().GetStorableType()); EXPECT_EQ(ADDRESS_HOME, form_structure()->field(16)->Type().group()); - string16 billing_state = form_structure()->field(9)->value; - string16 shipping_state = form_structure()->field(16)->value; + base::string16 billing_state = form_structure()->field(9)->value; + base::string16 shipping_state = form_structure()->field(16)->value; EXPECT_FALSE(billing_state.empty()); EXPECT_FALSE(shipping_state.empty()); EXPECT_EQ(billing_state, shipping_state); EXPECT_EQ(CREDIT_CARD_NAME, form_structure()->field(1)->Type().GetStorableType()); - string16 cc_name = form_structure()->field(1)->value; + base::string16 cc_name = form_structure()->field(1)->value; EXPECT_EQ(NAME_FULL, form_structure()->field(6)->Type().GetStorableType()); EXPECT_EQ(NAME_BILLING, form_structure()->field(6)->Type().group()); - string16 billing_name = form_structure()->field(6)->value; + base::string16 billing_name = form_structure()->field(6)->value; EXPECT_EQ(NAME_FULL, form_structure()->field(13)->Type().GetStorableType()); EXPECT_EQ(NAME, form_structure()->field(13)->Type().group()); - string16 shipping_name = form_structure()->field(13)->value; + base::string16 shipping_name = form_structure()->field(13)->value; EXPECT_FALSE(cc_name.empty()); EXPECT_FALSE(billing_name.empty()); @@ -1589,7 +1589,7 @@ TEST_F(AutofillDialogControllerTest, CancelNoSave) { TEST_F(AutofillDialogControllerTest, ManageItem) { AutofillProfile full_profile(test::GetVerifiedProfile()); full_profile.set_origin(kSettingsOrigin); - full_profile.SetRawInfo(ADDRESS_HOME_LINE2, string16()); + full_profile.SetRawInfo(ADDRESS_HOME_LINE2, base::string16()); controller()->GetTestingManager()->AddTestingProfile(&full_profile); SwitchToAutofill(); diff --git a/chrome/browser/ui/autofill/autofill_dialog_models.cc b/chrome/browser/ui/autofill/autofill_dialog_models.cc index 791835a..1eae057 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_models.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_models.cc @@ -32,7 +32,7 @@ SuggestionsMenuModel::SuggestionsMenuModel( SuggestionsMenuModel::~SuggestionsMenuModel() {} void SuggestionsMenuModel::AddKeyedItem( - const std::string& key, const string16& display_label) { + const std::string& key, const base::string16& display_label) { Item item = { key, true }; items_.push_back(item); AddCheckItem(items_.size() - 1, display_label); @@ -40,7 +40,7 @@ void SuggestionsMenuModel::AddKeyedItem( void SuggestionsMenuModel::AddKeyedItemWithIcon( const std::string& key, - const string16& display_label, + const base::string16& display_label, const gfx::Image& icon) { AddKeyedItem(key, display_label); SetIcon(items_.size() - 1, icon); @@ -48,16 +48,16 @@ void SuggestionsMenuModel::AddKeyedItemWithIcon( void SuggestionsMenuModel::AddKeyedItemWithMinorText( const std::string& key, - const string16& display_label, - const string16& display_minor_text) { + const base::string16& display_label, + const base::string16& display_minor_text) { AddKeyedItem(key, display_label); SetMinorText(items_.size() - 1, display_minor_text); } void SuggestionsMenuModel::AddKeyedItemWithMinorTextAndIcon( const std::string& key, - const string16& display_label, - const string16& display_minor_text, + const base::string16& display_label, + const base::string16& display_minor_text, const gfx::Image& icon) { AddKeyedItemWithIcon(key, display_label, icon); SetMinorText(items_.size() - 1, display_minor_text); diff --git a/chrome/browser/ui/autofill/autofill_dialog_models.h b/chrome/browser/ui/autofill/autofill_dialog_models.h index de62b45..0986559 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_models.h +++ b/chrome/browser/ui/autofill/autofill_dialog_models.h @@ -40,26 +40,28 @@ class SuggestionsMenuModel : public ui::SimpleMenuModel, virtual ~SuggestionsMenuModel(); // Adds an item and its identifying key to the model. Keys needn't be unique. - void AddKeyedItem(const std::string& key, const string16& display_label); + void AddKeyedItem(const std::string& key, + const base::string16& display_label); // As above, but also accepts an image which will be displayed alongside the // text. void AddKeyedItemWithIcon(const std::string& key, - const string16& display_label, + const base::string16& display_label, const gfx::Image& icon); // Adds a label with a minor text and its identifying key to the model. // Keys needn't be unique. void AddKeyedItemWithMinorText(const std::string& key, - const string16& display_label, - const string16& display_minor_text); + const base::string16& display_label, + const base::string16& display_minor_text); // As above, but also accepts an image which will be displayed alongside the // text. - void AddKeyedItemWithMinorTextAndIcon(const std::string& key, - const string16& display_label, - const string16& display_minor_text, - const gfx::Image& icon); + void AddKeyedItemWithMinorTextAndIcon( + const std::string& key, + const base::string16& display_label, + const base::string16& display_minor_text, + const gfx::Image& icon); // Resets the model to empty. void Reset(); @@ -120,11 +122,11 @@ class MonthComboboxModel : public ui::ComboboxModel { MonthComboboxModel(); virtual ~MonthComboboxModel(); - static string16 FormatMonth(int index); + static base::string16 FormatMonth(int index); // ui::Combobox implementation: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(MonthComboboxModel); @@ -138,7 +140,7 @@ class YearComboboxModel : public ui::ComboboxModel { // ui::Combobox implementation: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; private: // The current year (e.g., 2012). diff --git a/chrome/browser/ui/autofill/autofill_dialog_types.cc b/chrome/browser/ui/autofill/autofill_dialog_types.cc index 1225f3b..f6d6b07 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_types.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_types.cc @@ -25,7 +25,8 @@ static const base::char16 kRangeSeparator = '|'; DialogNotification::DialogNotification() : type_(NONE) {} -DialogNotification::DialogNotification(Type type, const string16& display_text) +DialogNotification::DialogNotification(Type type, + const base::string16& display_text) : type_(type), display_text_(display_text), checked_(false) { @@ -36,7 +37,7 @@ DialogNotification::DialogNotification(Type type, const string16& display_text) size_t start = pieces[0].size(); size_t end = start + pieces[1].size(); link_range_ = gfx::Range(start, end); - display_text_ = JoinString(pieces, string16()); + display_text_ = JoinString(pieces, base::string16()); } } @@ -106,12 +107,13 @@ SkColor const kWarningColor = SkColorSetRGB(0xde, 0x49, 0x32); SuggestionState::SuggestionState() : visible(false) {} -SuggestionState::SuggestionState(bool visible, - const string16& vertically_compact_text, - const string16& horizontally_compact_text, - const gfx::Image& icon, - const string16& extra_text, - const gfx::Image& extra_icon) +SuggestionState::SuggestionState( + bool visible, + const base::string16& vertically_compact_text, + const base::string16& horizontally_compact_text, + const gfx::Image& icon, + const base::string16& extra_text, + const gfx::Image& extra_icon) : visible(visible), vertically_compact_text(vertically_compact_text), horizontally_compact_text(horizontally_compact_text), diff --git a/chrome/browser/ui/autofill/autofill_dialog_view.h b/chrome/browser/ui/autofill/autofill_dialog_view.h index 04ccd24..39ab3be 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_view.h +++ b/chrome/browser/ui/autofill/autofill_dialog_view.h @@ -79,7 +79,7 @@ class AutofillDialogView { // Gets the CVC value the user typed to go along with the stored credit card // data. If the user is inputing credit card data from scratch, this is not // relevant. - virtual string16 GetCvc() = 0; + virtual base::string16 GetCvc() = 0; // Whether or not |point| is within |input|'s bounds. virtual bool HitTestInput(const DetailInput& input, diff --git a/chrome/browser/ui/autofill/autofill_dialog_view_delegate.h b/chrome/browser/ui/autofill/autofill_dialog_view_delegate.h index 1f035a9..bc1053b 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_view_delegate.h +++ b/chrome/browser/ui/autofill/autofill_dialog_view_delegate.h @@ -43,16 +43,16 @@ class AutofillDialogViewDelegate { public: // Strings ------------------------------------------------------------------- - virtual string16 DialogTitle() const = 0; - virtual string16 AccountChooserText() const = 0; - virtual string16 SignInLinkText() const = 0; - virtual string16 SpinnerText() const = 0; - virtual string16 EditSuggestionText() const = 0; - virtual string16 CancelButtonText() const = 0; - virtual string16 ConfirmButtonText() const = 0; - virtual string16 SaveLocallyText() const = 0; - virtual string16 SaveLocallyTooltip() const = 0; - virtual string16 LegalDocumentsText() = 0; + virtual base::string16 DialogTitle() const = 0; + virtual base::string16 AccountChooserText() const = 0; + virtual base::string16 SignInLinkText() const = 0; + virtual base::string16 SpinnerText() const = 0; + virtual base::string16 EditSuggestionText() const = 0; + virtual base::string16 CancelButtonText() const = 0; + virtual base::string16 ConfirmButtonText() const = 0; + virtual base::string16 SaveLocallyText() const = 0; + virtual base::string16 SaveLocallyTooltip() const = 0; + virtual base::string16 LegalDocumentsText() = 0; // State --------------------------------------------------------------------- @@ -118,7 +118,7 @@ class AutofillDialogViewDelegate { virtual ui::MenuModel* MenuModelForSection(DialogSection section) = 0; // Returns the label text used to describe the section (i.e. Billing). - virtual string16 LabelForSection(DialogSection section) const = 0; + virtual base::string16 LabelForSection(DialogSection section) const = 0; // Returns the current state of suggestions for |section|. virtual SuggestionState SuggestionStateForSection(DialogSection section) = 0; @@ -133,7 +133,7 @@ class AutofillDialogViewDelegate { virtual bool FieldControlsIcons(ServerFieldType type) const = 0; // Returns a tooltip for the given field, or an empty string if none exists. - virtual string16 TooltipForField(ServerFieldType type) const = 0; + virtual base::string16 TooltipForField(ServerFieldType type) const = 0; // Whether a particular DetailInput in |section| should be edited or not. virtual bool InputIsEditable(const DetailInput& input, @@ -142,9 +142,9 @@ class AutofillDialogViewDelegate { // Decides whether input of |value| is valid for a field of type |type|. If // valid, the returned string will be empty. Otherwise it will contain an // error message. - virtual string16 InputValidityMessage(DialogSection section, + virtual base::string16 InputValidityMessage(DialogSection section, ServerFieldType type, - const string16& value) = 0; + const base::string16& value) = 0; // Decides whether the combination of all |inputs| is valid, returns a @@ -159,7 +159,7 @@ class AutofillDialogViewDelegate { ServerFieldType type, gfx::NativeView parent_view, const gfx::Rect& content_bounds, - const string16& field_contents, + const base::string16& field_contents, bool was_edit) = 0; // The view forwards keypresses in text inputs. Returns true if there should diff --git a/chrome/browser/ui/autofill/autofill_popup_controller.h b/chrome/browser/ui/autofill/autofill_popup_controller.h index d35cf89..e9f6851 100644 --- a/chrome/browser/ui/autofill/autofill_popup_controller.h +++ b/chrome/browser/ui/autofill/autofill_popup_controller.h @@ -56,7 +56,7 @@ class AutofillPopupController { // Gets the resource value for the given resource, returning -1 if the // resource isn't recognized. - virtual int GetIconResourceID(const string16& resource_name) const = 0; + virtual int GetIconResourceID(const base::string16& resource_name) const = 0; // Returns true if the given index refers to an element that can be deleted. virtual bool CanDelete(size_t index) const = 0; diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc index b42617c..77b6447 100644 --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc @@ -226,9 +226,9 @@ void AutofillPopupControllerImpl::UpdateDataListValues( // Add a separator if there are any other values. if (!identifiers_.empty() && identifiers_[0] != WebAutofillClient::MenuItemIDSeparator) { - names_.insert(names_.begin(), string16()); - subtexts_.insert(subtexts_.begin(), string16()); - icons_.insert(icons_.begin(), string16()); + names_.insert(names_.begin(), base::string16()); + subtexts_.insert(subtexts_.begin(), base::string16()); + icons_.insert(icons_.begin(), base::string16()); identifiers_.insert(identifiers_.begin(), WebAutofillClient::MenuItemIDSeparator); } @@ -340,7 +340,7 @@ void AutofillPopupControllerImpl::AcceptSuggestion(size_t index) { } int AutofillPopupControllerImpl::GetIconResourceID( - const string16& resource_name) const { + const base::string16& resource_name) const { for (size_t i = 0; i < arraysize(kDataResources); ++i) { if (resource_name == ASCIIToUTF16(kDataResources[i].name)) return kDataResources[i].id; diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.h b/chrome/browser/ui/autofill/autofill_popup_controller_impl.h index e1891c5..25dc09a 100644 --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.h +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.h @@ -52,9 +52,9 @@ class AutofillPopupControllerImpl : public AutofillPopupController { base::i18n::TextDirection text_direction); // Shows the popup, or updates the existing popup with the given values. - void Show(const std::vector<string16>& names, - const std::vector<string16>& subtexts, - const std::vector<string16>& icons, + void Show(const std::vector<base::string16>& names, + const std::vector<base::string16>& subtexts, + const std::vector<base::string16>& icons, const std::vector<int>& identifiers); // Updates the data list values currently shown with the popup. @@ -93,7 +93,8 @@ class AutofillPopupControllerImpl : public AutofillPopupController { virtual void SelectionCleared() OVERRIDE; virtual bool ShouldRepostEvent(const ui::MouseEvent& event) OVERRIDE; virtual void AcceptSuggestion(size_t index) OVERRIDE; - virtual int GetIconResourceID(const string16& resource_name) const OVERRIDE; + virtual int GetIconResourceID( + const base::string16& resource_name) const OVERRIDE; virtual bool CanDelete(size_t index) const OVERRIDE; virtual bool IsWarning(size_t index) const OVERRIDE; virtual gfx::Rect GetRowBounds(size_t index) OVERRIDE; @@ -103,9 +104,9 @@ class AutofillPopupControllerImpl : public AutofillPopupController { virtual const gfx::RectF& element_bounds() const OVERRIDE; virtual bool IsRTL() const OVERRIDE; - virtual const std::vector<string16>& names() const OVERRIDE; - virtual const std::vector<string16>& subtexts() const OVERRIDE; - virtual const std::vector<string16>& icons() const OVERRIDE; + virtual const std::vector<base::string16>& names() const OVERRIDE; + virtual const std::vector<base::string16>& subtexts() const OVERRIDE; + virtual const std::vector<base::string16>& icons() const OVERRIDE; virtual const std::vector<int>& identifiers() const OVERRIDE; #if !defined(OS_ANDROID) virtual const gfx::Font& GetNameFontForRow(size_t index) const OVERRIDE; @@ -143,9 +144,9 @@ class AutofillPopupControllerImpl : public AutofillPopupController { // Set the Autofill entry values. Exposed to allow tests to set these values // without showing the popup. - void SetValues(const std::vector<string16>& names, - const std::vector<string16>& subtexts, - const std::vector<string16>& icons, + void SetValues(const std::vector<base::string16>& names, + const std::vector<base::string16>& subtexts, + const std::vector<base::string16>& icons, const std::vector<int>& identifier); AutofillPopupView* view() { return view_; } @@ -225,14 +226,14 @@ class AutofillPopupControllerImpl : public AutofillPopupController { content::RenderViewHost* registered_key_press_event_callback_with_; // The current Autofill query values. - std::vector<string16> names_; - std::vector<string16> subtexts_; - std::vector<string16> icons_; + std::vector<base::string16> names_; + std::vector<base::string16> subtexts_; + std::vector<base::string16> icons_; std::vector<int> identifiers_; // Since names_ can be elided to ensure that it fits on the screen, we need to // keep an unelided copy of the names to be able to pass to the delegate. - std::vector<string16> full_names_; + std::vector<base::string16> full_names_; #if !defined(OS_ANDROID) // The fonts for the popup text. diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc index f0e1df0..7979885 100644 --- a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc +++ b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc @@ -41,8 +41,8 @@ class MockAutofillExternalDelegate : public AutofillExternalDelegate { virtual ~MockAutofillExternalDelegate() {} virtual void DidSelectSuggestion(int identifier) OVERRIDE {} - virtual void RemoveSuggestion(const string16& value, int identifier) OVERRIDE - {} + virtual void RemoveSuggestion(const base::string16& value, + int identifier) OVERRIDE {} virtual void ClearPreviewedForm() OVERRIDE {} base::WeakPtr<AutofillExternalDelegate> GetWeakPtr() { return AutofillExternalDelegate::GetWeakPtr(); @@ -185,7 +185,7 @@ TEST_F(AutofillPopupControllerUnitTest, SetBounds) { TEST_F(AutofillPopupControllerUnitTest, ChangeSelectedLine) { // Set up the popup. - std::vector<string16> names(2, string16()); + std::vector<base::string16> names(2, base::string16()); std::vector<int> autofill_ids(2, 0); autofill_popup_controller_->Show(names, names, names, autofill_ids); @@ -208,7 +208,7 @@ TEST_F(AutofillPopupControllerUnitTest, ChangeSelectedLine) { TEST_F(AutofillPopupControllerUnitTest, RedrawSelectedLine) { // Set up the popup. - std::vector<string16> names(2, string16()); + std::vector<base::string16> names(2, base::string16()); std::vector<int> autofill_ids(2, 0); autofill_popup_controller_->Show(names, names, names, autofill_ids); @@ -230,7 +230,7 @@ TEST_F(AutofillPopupControllerUnitTest, RedrawSelectedLine) { TEST_F(AutofillPopupControllerUnitTest, RemoveLine) { // Set up the popup. - std::vector<string16> names(3, string16()); + std::vector<base::string16> names(3, base::string16()); std::vector<int> autofill_ids; autofill_ids.push_back(1); autofill_ids.push_back(1); @@ -266,7 +266,7 @@ TEST_F(AutofillPopupControllerUnitTest, RemoveLine) { TEST_F(AutofillPopupControllerUnitTest, RemoveOnlyLine) { // Set up the popup. - std::vector<string16> names(1, string16()); + std::vector<base::string16> names(1, base::string16()); std::vector<int> autofill_ids; autofill_ids.push_back(1); autofill_popup_controller_->Show(names, names, names, autofill_ids); @@ -286,7 +286,7 @@ TEST_F(AutofillPopupControllerUnitTest, RemoveOnlyLine) { TEST_F(AutofillPopupControllerUnitTest, SkipSeparator) { // Set up the popup. - std::vector<string16> names(3, string16()); + std::vector<base::string16> names(3, base::string16()); std::vector<int> autofill_ids; autofill_ids.push_back(1); autofill_ids.push_back(WebAutofillClient::MenuItemIDSeparator); @@ -305,9 +305,9 @@ TEST_F(AutofillPopupControllerUnitTest, SkipSeparator) { } TEST_F(AutofillPopupControllerUnitTest, RowWidthWithoutText) { - std::vector<string16> names(4); - std::vector<string16> subtexts(4); - std::vector<string16> icons(4); + std::vector<base::string16> names(4); + std::vector<base::string16> subtexts(4); + std::vector<base::string16> icons(4); std::vector<int> ids(4); // Set up some visible display so the text values are kept. @@ -341,7 +341,7 @@ TEST_F(AutofillPopupControllerUnitTest, RowWidthWithoutText) { } TEST_F(AutofillPopupControllerUnitTest, UpdateDataListValues) { - std::vector<string16> items; + std::vector<base::string16> items; items.push_back(string16()); std::vector<int> ids; ids.push_back(1); @@ -352,7 +352,7 @@ TEST_F(AutofillPopupControllerUnitTest, UpdateDataListValues) { EXPECT_EQ(ids, autofill_popup_controller_->identifiers()); // Add one data list entry. - std::vector<string16> data_list_values; + std::vector<base::string16> data_list_values; data_list_values.push_back(ASCIIToUTF16("data list value 1")); autofill_popup_controller_->UpdateDataListValues(data_list_values, @@ -360,7 +360,7 @@ TEST_F(AutofillPopupControllerUnitTest, UpdateDataListValues) { // Update the expected values. items.insert(items.begin(), data_list_values[0]); - items.insert(items.begin() + 1, string16()); + items.insert(items.begin() + 1, base::string16()); ids.insert(ids.begin(), WebAutofillClient::MenuItemIDDataListEntry); ids.insert(ids.begin() + 1, WebAutofillClient::MenuItemIDSeparator); @@ -397,7 +397,7 @@ TEST_F(AutofillPopupControllerUnitTest, UpdateDataListValues) { TEST_F(AutofillPopupControllerUnitTest, PopupsWithOnlyDataLists) { // Create the popup with a single datalist element. - std::vector<string16> items; + std::vector<base::string16> items; items.push_back(string16()); std::vector<int> ids; ids.push_back(WebAutofillClient::MenuItemIDDataListEntry); @@ -408,7 +408,7 @@ TEST_F(AutofillPopupControllerUnitTest, PopupsWithOnlyDataLists) { EXPECT_EQ(ids, autofill_popup_controller_->identifiers()); // Replace the datalist element with a new one. - std::vector<string16> data_list_values; + std::vector<base::string16> data_list_values; data_list_values.push_back(ASCIIToUTF16("data list value 1")); autofill_popup_controller_->UpdateDataListValues(data_list_values, @@ -478,7 +478,7 @@ TEST_F(AutofillPopupControllerUnitTest, GetOrCreate) { } TEST_F(AutofillPopupControllerUnitTest, ProperlyResetController) { - std::vector<string16> names(2); + std::vector<base::string16> names(2); std::vector<int> ids(2); popup_controller()->SetValues(names, names, names, ids); popup_controller()->SetSelectedLine(0); @@ -498,15 +498,15 @@ TEST_F(AutofillPopupControllerUnitTest, ProperlyResetController) { #if !defined(OS_ANDROID) TEST_F(AutofillPopupControllerUnitTest, ElideText) { - std::vector<string16> names; + std::vector<base::string16> names; names.push_back(ASCIIToUTF16("Text that will need to be trimmed")); names.push_back(ASCIIToUTF16("Untrimmed")); - std::vector<string16> subtexts; + std::vector<base::string16> subtexts; subtexts.push_back(ASCIIToUTF16("Label that will be trimmed")); subtexts.push_back(ASCIIToUTF16("Untrimmed")); - std::vector<string16> icons(2, ASCIIToUTF16("genericCC")); + std::vector<base::string16> icons(2, ASCIIToUTF16("genericCC")); std::vector<int> autofill_ids(2, 0); // Show the popup once so we can easily generate the size it needs. @@ -534,7 +534,7 @@ TEST_F(AutofillPopupControllerUnitTest, ElideText) { #endif TEST_F(AutofillPopupControllerUnitTest, GrowPopupInSpace) { - std::vector<string16> names(1); + std::vector<base::string16> names(1); std::vector<int> autofill_ids(1, 1); // Call Show so that GetDesired...() will be able to provide valid values. diff --git a/chrome/browser/ui/autofill/country_combobox_model.h b/chrome/browser/ui/autofill/country_combobox_model.h index 40c4202..74afeae 100644 --- a/chrome/browser/ui/autofill/country_combobox_model.h +++ b/chrome/browser/ui/autofill/country_combobox_model.h @@ -25,7 +25,7 @@ class CountryComboboxModel : public ui::ComboboxModel { // ui::Combobox implementation: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; virtual bool IsItemSeparatorAt(int index) OVERRIDE; const std::vector<AutofillCountry*>& countries() const { diff --git a/chrome/browser/ui/autofill/data_model_wrapper_unittest.cc b/chrome/browser/ui/autofill/data_model_wrapper_unittest.cc index e5a8490..5dc0d24 100644 --- a/chrome/browser/ui/autofill/data_model_wrapper_unittest.cc +++ b/chrome/browser/ui/autofill/data_model_wrapper_unittest.cc @@ -91,7 +91,7 @@ TEST(DataModelWrapperTest, GetDisplayTextEmptyWithoutPhone) { EXPECT_TRUE(address_wrapper.GetDisplayText(&unused, &unused2)); const_cast<wallet::Address*>(&instrument->address())->SetPhoneNumber( - string16()); + base::string16()); EXPECT_EQ(base::string16(), instrument_wrapper.GetInfo(AutofillType(PHONE_HOME_WHOLE_NUMBER))); diff --git a/chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.cc b/chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.cc index 1aaef16..65ea225 100644 --- a/chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.cc +++ b/chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.cc @@ -26,10 +26,10 @@ MockAutofillDialogViewDelegate::MockAutofillDialogViewDelegate() { DefaultValue<ValidityMessages>::Set(ValidityMessages()); DefaultValue<gfx::Image>::Set(gfx::Image()); DefaultValue<SuggestionState>::Set(SuggestionState(false, - string16(), - string16(), + base::string16(), + base::string16(), gfx::Image(), - string16(), + base::string16(), gfx::Image())); DefaultValue<FieldIconMap>::Set(FieldIconMap()); DefaultValue<std::vector<DialogNotification> >::Set( diff --git a/chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h b/chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h index 1de57cd..34947f5 100644 --- a/chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h +++ b/chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h @@ -17,16 +17,16 @@ class MockAutofillDialogViewDelegate : public AutofillDialogViewDelegate { MockAutofillDialogViewDelegate(); virtual ~MockAutofillDialogViewDelegate(); - MOCK_CONST_METHOD0(DialogTitle, string16()); - MOCK_CONST_METHOD0(AccountChooserText, string16()); - MOCK_CONST_METHOD0(SignInLinkText, string16()); - MOCK_CONST_METHOD0(SpinnerText, string16()); - MOCK_CONST_METHOD0(EditSuggestionText, string16()); - MOCK_CONST_METHOD0(CancelButtonText, string16()); - MOCK_CONST_METHOD0(ConfirmButtonText, string16()); - MOCK_CONST_METHOD0(SaveLocallyText, string16()); - MOCK_CONST_METHOD0(SaveLocallyTooltip, string16()); - MOCK_METHOD0(LegalDocumentsText, string16()); + MOCK_CONST_METHOD0(DialogTitle, base::string16()); + MOCK_CONST_METHOD0(AccountChooserText, base::string16()); + MOCK_CONST_METHOD0(SignInLinkText, base::string16()); + MOCK_CONST_METHOD0(SpinnerText, base::string16()); + MOCK_CONST_METHOD0(EditSuggestionText, base::string16()); + MOCK_CONST_METHOD0(CancelButtonText, base::string16()); + MOCK_CONST_METHOD0(ConfirmButtonText, base::string16()); + MOCK_CONST_METHOD0(SaveLocallyText, base::string16()); + MOCK_CONST_METHOD0(SaveLocallyTooltip, base::string16()); + MOCK_METHOD0(LegalDocumentsText, base::string16()); MOCK_CONST_METHOD0(ShouldShowSpinner, bool()); MOCK_CONST_METHOD0(ShouldShowSignInWebView, bool()); MOCK_CONST_METHOD0(SignInUrl, GURL()); @@ -46,7 +46,7 @@ class MockAutofillDialogViewDelegate : public AutofillDialogViewDelegate { MOCK_METHOD1(ComboboxModelForAutofillType, ui::ComboboxModel*(ServerFieldType)); MOCK_METHOD1(MenuModelForSection, ui::MenuModel*(DialogSection)); - MOCK_CONST_METHOD1(LabelForSection, string16(DialogSection section)); + MOCK_CONST_METHOD1(LabelForSection, base::string16(DialogSection section)); MOCK_METHOD1(SuggestionStateForSection, SuggestionState(DialogSection)); MOCK_METHOD1(EditClickedForSection, void(DialogSection section)); MOCK_METHOD1(EditCancelledForSection, void(DialogSection section)); @@ -56,14 +56,14 @@ class MockAutofillDialogViewDelegate : public AutofillDialogViewDelegate { MOCK_METHOD2(InputIsEditable, bool(const DetailInput& input, DialogSection section)); MOCK_METHOD3(InputValidityMessage, - string16(DialogSection, ServerFieldType, const string16&)); + base::string16(DialogSection, ServerFieldType, const base::string16&)); MOCK_METHOD2(InputsAreValid, ValidityMessages(DialogSection, const FieldValueMap&)); MOCK_METHOD6(UserEditedOrActivatedInput, void(DialogSection, ServerFieldType, gfx::NativeView, const gfx::Rect&, - const string16&, + const base::string16&, bool was_edit)); MOCK_METHOD1(HandleKeyPressEventInInput, bool(const content::NativeWebKeyboardEvent& event)); diff --git a/chrome/browser/ui/autofill/testable_autofill_dialog_view.h b/chrome/browser/ui/autofill/testable_autofill_dialog_view.h index 632e7e9..5ae09b8 100644 --- a/chrome/browser/ui/autofill/testable_autofill_dialog_view.h +++ b/chrome/browser/ui/autofill/testable_autofill_dialog_view.h @@ -20,11 +20,11 @@ class TestableAutofillDialogView { virtual void CancelForTesting() = 0; // Returns the actual contents of the input which is modelled by |input|. - virtual string16 GetTextContentsOfInput(const DetailInput& input) = 0; + virtual base::string16 GetTextContentsOfInput(const DetailInput& input) = 0; // Sets the actual contents of the input which is modelled by |input|. virtual void SetTextContentsOfInput(const DetailInput& input, - const string16& contents) = 0; + const base::string16& contents) = 0; // Sets the content of the extra field for a section. virtual void SetTextContentsOfSuggestionInput(DialogSection section, diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 9a52aa8..e56a0b6 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -546,9 +546,9 @@ gfx::Image Browser::GetCurrentPageIcon() const { return favicon_tab_helper ? favicon_tab_helper->GetFavicon() : gfx::Image(); } -string16 Browser::GetWindowTitleForCurrentTab() const { +base::string16 Browser::GetWindowTitleForCurrentTab() const { WebContents* contents = tab_strip_model_->GetActiveWebContents(); - string16 title; + base::string16 title; // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the // window during the window's creation (before tabs have been added). @@ -577,11 +577,12 @@ string16 Browser::GetWindowTitleForCurrentTab() const { } // static -void Browser::FormatTitleForDisplay(string16* title) { +void Browser::FormatTitleForDisplay(base::string16* title) { size_t current_index = 0; size_t match_index; - while ((match_index = title->find(L'\n', current_index)) != string16::npos) { - title->replace(match_index, 1, string16()); + while ((match_index = title->find(L'\n', current_index)) != + base::string16::npos) { + title->replace(match_index, 1, base::string16()); current_index = match_index; } } @@ -829,7 +830,7 @@ void Browser::OpenFile() { ui::SelectFileDialog::FileTypeInfo file_types; file_types.support_drive = true; select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_OPEN_FILE, - string16(), + base::string16(), directory, &file_types, 0, @@ -874,7 +875,7 @@ void Browser::JSOutOfMemoryHelper(WebContents* web_contents) { void Browser::RegisterProtocolHandlerHelper(WebContents* web_contents, const std::string& protocol, const GURL& url, - const string16& title, + const base::string16& title, bool user_gesture, BrowserWindow* window) { Profile* profile = @@ -1521,7 +1522,7 @@ bool Browser::ShouldCreateWebContents( WebContents* web_contents, int route_id, WindowContainerType window_container_type, - const string16& frame_name, + const base::string16& frame_name, const GURL& target_url, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace) { @@ -1540,7 +1541,7 @@ bool Browser::ShouldCreateWebContents( void Browser::WebContentsCreated(WebContents* source_contents, int64 source_frame_id, - const string16& frame_name, + const base::string16& frame_name, const GURL& target_url, WebContents* new_contents) { // Adopt the WebContents now, so all observers are in place, as the network @@ -1638,7 +1639,7 @@ void Browser::JSOutOfMemory(WebContents* web_contents) { void Browser::RegisterProtocolHandler(WebContents* web_contents, const std::string& protocol, const GURL& url, - const string16& title, + const base::string16& title, bool user_gesture) { RegisterProtocolHandlerHelper( web_contents, protocol, url, title, user_gesture, window()); @@ -2223,7 +2224,7 @@ bool Browser::ShouldHideUIForFullscreen() const { bool Browser::MaybeCreateBackgroundContents( int route_id, WebContents* opener_web_contents, - const string16& frame_name, + const base::string16& frame_name, const GURL& target_url, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace) { diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index b53ee9e..f5e25ea 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h @@ -285,7 +285,7 @@ class Browser : public TabStripModelObserver, gfx::Image GetCurrentPageIcon() const; // Gets the title of the window based on the selected tab's title. - string16 GetWindowTitleForCurrentTab() const; + base::string16 GetWindowTitleForCurrentTab() const; // Prepares a title string for display (removes embedded newlines, etc). static void FormatTitleForDisplay(string16* title); @@ -407,7 +407,7 @@ class Browser : public TabStripModelObserver, static void RegisterProtocolHandlerHelper(content::WebContents* web_contents, const std::string& protocol, const GURL& url, - const string16& title, + const base::string16& title, bool user_gesture, BrowserWindow* window); @@ -596,13 +596,13 @@ class Browser : public TabStripModelObserver, content::WebContents* web_contents, int route_id, WindowContainerType window_container_type, - const string16& frame_name, + const base::string16& frame_name, const GURL& target_url, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace) OVERRIDE; virtual void WebContentsCreated(content::WebContents* source_contents, int64 source_frame_id, - const string16& frame_name, + const base::string16& frame_name, const GURL& target_url, content::WebContents* new_contents) OVERRIDE; virtual void RendererUnresponsive(content::WebContents* source) OVERRIDE; @@ -633,7 +633,7 @@ class Browser : public TabStripModelObserver, virtual void RegisterProtocolHandler(content::WebContents* web_contents, const std::string& protocol, const GURL& url, - const string16& title, + const base::string16& title, bool user_gesture) OVERRIDE; virtual void UpdatePreferredSize(content::WebContents* source, const gfx::Size& pref_size) OVERRIDE; @@ -804,7 +804,7 @@ class Browser : public TabStripModelObserver, bool MaybeCreateBackgroundContents( int route_id, content::WebContents* opener_web_contents, - const string16& frame_name, + const base::string16& frame_name, const GURL& target_url, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace); diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index dd30b83..6fdff5f 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -773,7 +773,7 @@ void BrowserCommandController::OnProfileAdded( void BrowserCommandController::OnProfileWasRemoved( const base::FilePath& profile_path, - const string16& profile_name) { + const base::string16& profile_name) { UpdateCommandsForMultipleProfiles(); } diff --git a/chrome/browser/ui/browser_command_controller.h b/chrome/browser/ui/browser_command_controller.h index f46751c..da9e995 100644 --- a/chrome/browser/ui/browser_command_controller.h +++ b/chrome/browser/ui/browser_command_controller.h @@ -87,7 +87,7 @@ class BrowserCommandController : public CommandUpdaterDelegate, // Overridden from ProfileInfoCacheObserver: virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE; virtual void OnProfileWasRemoved(const base::FilePath& profile_path, - const string16& profile_name) OVERRIDE; + const base::string16& profile_name) OVERRIDE; // Overridden from TabStripModelObserver: virtual void TabInsertedAt(content::WebContents* contents, diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index c36442b..4c86d3e 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc @@ -115,7 +115,7 @@ void BookmarkCurrentPageInternal(Browser* browser, bool from_star) { return; // Ignore requests until bookmarks are loaded. GURL url; - string16 title; + base::string16 title; WebContents* web_contents = browser->tab_strip_model()->GetActiveWebContents(); GetURLAndTitleToBookmark(web_contents, &url, &title); @@ -855,7 +855,7 @@ void FindPrevious(Browser* browser) { void FindInPage(Browser* browser, bool find_next, bool forward_direction) { ShowFindBar(browser); if (find_next) { - string16 find_text; + base::string16 find_text; FindTabHelper* find_helper = FindTabHelper::FromWebContents( browser->tab_strip_model()->GetActiveWebContents()); #if defined(OS_MACOSX) diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc index e73c625..b30da97 100644 --- a/chrome/browser/ui/browser_instant_controller.cc +++ b/chrome/browser/ui/browser_instant_controller.cc @@ -122,7 +122,7 @@ bool BrowserInstantController::OpenInstant(WindowOpenDisposition disposition, // If we will not be replacing search terms from this URL, don't send to // InstantController. - const string16& search_terms = + const base::string16& search_terms = chrome::GetSearchTermsFromURL(browser_->profile(), url); if (search_terms.empty()) return false; diff --git a/chrome/browser/ui/browser_window.h b/chrome/browser/ui/browser_window.h index a9c19e0..951c6ba 100644 --- a/chrome/browser/ui/browser_window.h +++ b/chrome/browser/ui/browser_window.h @@ -247,8 +247,8 @@ class BrowserWindow : public ui::BaseWindow { // of the account that has signed in. virtual void ShowOneClickSigninBubble( OneClickSigninBubbleType type, - const string16& email, - const string16& error_message, + const base::string16& email, + const base::string16& error_message, const StartSyncCallback& start_sync_callback) = 0; #endif diff --git a/chrome/browser/ui/certificate_dialogs.cc b/chrome/browser/ui/certificate_dialogs.cc index fbc0825..d200036 100644 --- a/chrome/browser/ui/certificate_dialogs.cc +++ b/chrome/browser/ui/certificate_dialogs.cc @@ -171,7 +171,7 @@ void ShowCertSelectFileDialog(ui::SelectFileDialog* select_file_dialog, l10n_util::GetStringUTF16(IDS_CERT_EXPORT_TYPE_PKCS7_CHAIN)); file_type_info.include_all_files = true; select_file_dialog->SelectFile( - type, string16(), + type, base::string16(), suggested_path, &file_type_info, 1, // 1-based index for |file_type_info.extensions| to specify default. FILE_PATH_LITERAL("crt"), diff --git a/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.mm b/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.mm index cc9ff82..e7008b7 100644 --- a/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.mm @@ -45,7 +45,7 @@ const BookmarkNode* node = model->AddFolder(bookmarkNode_, bookmarkNode_->child_count(), - string16()); + base::string16()); if (!node) { AppleScript::SetError(AppleScript::errCreateBookmarkFolder); return; @@ -67,7 +67,7 @@ const BookmarkNode* node = model->AddFolder(bookmarkNode_, position, - string16()); + base::string16()); if (!node) { AppleScript::SetError(AppleScript::errCreateBookmarkFolder); return; @@ -123,7 +123,7 @@ const BookmarkNode* node = model->AddURL(bookmarkNode_, bookmarkNode_->child_count(), - string16(), + base::string16(), url); if (!node) { AppleScript::SetError(AppleScript::errCreateBookmarkItem); @@ -153,7 +153,7 @@ const BookmarkNode* node = model->AddURL(bookmarkNode_, position, - string16(), + base::string16(), url); if (!node) { AppleScript::SetError(AppleScript::errCreateBookmarkItem); diff --git a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm index a8afbb8..be4e1ffa 100644 --- a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm @@ -154,7 +154,7 @@ void ResumeAppleEventAndSendReply(NSAppleEventManagerSuspensionID suspension_id, if (!entry) return nil; - string16 title = entry ? entry->GetTitle() : string16(); + base::string16 title = entry ? entry->GetTitle() : base::string16(); return base::SysUTF16ToNSString(title); } @@ -327,7 +327,7 @@ void ResumeAppleEventAndSendReply(NSAppleEventManagerSuspensionID suspension_id, content::RenderViewHost::JavascriptResultCallback callback = base::Bind(&ResumeAppleEventAndSendReply, suspensionID); - string16 script = base::SysNSStringToUTF16( + base::string16 script = base::SysNSStringToUTF16( [[command evaluatedArguments] objectForKey:@"javascript"]); view->ExecuteJavascriptInWebFrameCallbackResult(string16(), // frame_xpath script, diff --git a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h index 87374bf..6f1442e 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h +++ b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h @@ -50,7 +50,7 @@ class AutofillDialogCocoa : public AutofillDialogView, const DetailInput& originating_input) OVERRIDE; virtual void GetUserInput(DialogSection section, FieldValueMap* output) OVERRIDE; - virtual string16 GetCvc() OVERRIDE; + virtual base::string16 GetCvc() OVERRIDE; virtual bool HitTestInput(const DetailInput& input, const gfx::Point& screen_point) OVERRIDE; virtual bool SaveDetailsLocally() OVERRIDE; @@ -65,9 +65,10 @@ class AutofillDialogCocoa : public AutofillDialogView, // http://crbug.com/256864 virtual void SubmitForTesting() OVERRIDE; virtual void CancelForTesting() OVERRIDE; - virtual string16 GetTextContentsOfInput(const DetailInput& input) OVERRIDE; + virtual base::string16 GetTextContentsOfInput( + const DetailInput& input) OVERRIDE; virtual void SetTextContentsOfInput(const DetailInput& input, - const string16& contents) OVERRIDE; + const base::string16& contents) OVERRIDE; virtual void SetTextContentsOfSuggestionInput( DialogSection section, const base::string16& text) OVERRIDE; diff --git a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm index 571c4ca..582c031 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm @@ -104,7 +104,7 @@ void AutofillDialogCocoa::GetUserInput(DialogSection section, [sheet_delegate_ getInputs:output forSection:section]; } -string16 AutofillDialogCocoa::GetCvc() { +base::string16 AutofillDialogCocoa::GetCvc() { return base::SysNSStringToUTF16([sheet_delegate_ getCvc]); } @@ -151,7 +151,8 @@ void AutofillDialogCocoa::CancelForTesting() { [sheet_delegate_ cancel:nil]; } -string16 AutofillDialogCocoa::GetTextContentsOfInput(const DetailInput& input) { +base::string16 AutofillDialogCocoa::GetTextContentsOfInput( + const DetailInput& input) { for (size_t i = SECTION_MIN; i <= SECTION_MAX; ++i) { DialogSection section = static_cast<DialogSection>(i); FieldValueMap contents; @@ -162,11 +163,12 @@ string16 AutofillDialogCocoa::GetTextContentsOfInput(const DetailInput& input) { } NOTREACHED(); - return string16(); + return base::string16(); } -void AutofillDialogCocoa::SetTextContentsOfInput(const DetailInput& input, - const string16& contents) { +void AutofillDialogCocoa::SetTextContentsOfInput( + const DetailInput& input, + const base::string16& contents) { [sheet_delegate_ setTextContents:base::SysUTF16ToNSString(contents) forInput:input]; } diff --git a/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm index fd38bd5..d61330f 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm @@ -179,7 +179,7 @@ bool ShouldOverwriteComboboxes(autofill::DialogSection section, } inputs_.reset([[self makeInputControls] retain]); - string16 labelText = delegate_->LabelForSection(section_); + base::string16 labelText = delegate_->LabelForSection(section_); label_.reset( [[self makeDetailSectionLabel:base::SysUTF16ToNSString(labelText)] retain]); @@ -405,7 +405,7 @@ bool ShouldOverwriteComboboxes(autofill::DialogSection section, return; autofill::ServerFieldType type = [self fieldTypeForControl:field]; - string16 fieldValue = base::SysNSStringToUTF16([textfield fieldValue]); + base::string16 fieldValue = base::SysNSStringToUTF16([textfield fieldValue]); // Get the frame rectangle for the designated field, in screen coordinates. NSRect textFrameInScreen = [field convertRect:[field bounds] toView:nil]; @@ -431,7 +431,7 @@ bool ShouldOverwriteComboboxes(autofill::DialogSection section, // correcting a minor mistake (i.e. a wrong CC digit) should immediately // result in validation - positive user feedback. if ([textfield invalid] && edited) { - string16 message = delegate_->InputValidityMessage(section_, + base::string16 message = delegate_->InputValidityMessage(section_, type, fieldValue); [textfield setValidityMessage:base::SysUTF16ToNSString(message)]; diff --git a/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm b/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm index cfff00c..7fba944 100644 --- a/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm +++ b/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm @@ -311,7 +311,7 @@ class Observer : public content::NotificationObserver { profiles::kAvatarIconWidth, profiles::kAvatarIconHeight); [self setImage:icon.ToNSImage()]; - const string16& name = cache.GetNameOfProfileAtIndex(index); + const base::string16& name = cache.GetNameOfProfileAtIndex(index); NSString* nsName = base::SysUTF16ToNSString(name); [button_ setToolTip:nsName]; [[button_ cell] diff --git a/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.mm b/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.mm index 6e1d05c..ae36e5c 100644 --- a/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.mm +++ b/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.mm @@ -120,8 +120,9 @@ void ShiftOriginY(NSView* view, CGFloat amount) { - (IBAction)save:(id)sender { DCHECK([self validateFields]); - string16 title = base::SysNSStringToUTF16([nameField_ stringValue]); - string16 keyword = base::SysNSStringToUTF16([keywordField_ stringValue]); + base::string16 title = base::SysNSStringToUTF16([nameField_ stringValue]); + base::string16 keyword = + base::SysNSStringToUTF16([keywordField_ stringValue]); std::string url = base::SysNSStringToUTF8([urlField_ stringValue]); controller_->AcceptAddOrEdit(title, keyword, url); [self doClose]; @@ -159,14 +160,15 @@ void ShiftOriginY(NSView* view, CGFloat amount) { // This sets the image state for all the controls and enables or disables the // done button. Returns YES if all the fields are valid. - (BOOL)validateFields { - string16 title = base::SysNSStringToUTF16([nameField_ stringValue]); + base::string16 title = base::SysNSStringToUTF16([nameField_ stringValue]); BOOL titleValid = controller_->IsTitleValid(title); [self setIsValid:titleValid toolTip:IDS_SEARCH_ENGINES_INVALID_TITLE_TT forImageView:nameImage_ textField:nameField_]; - string16 keyword = base::SysNSStringToUTF16([keywordField_ stringValue]); + base::string16 keyword = + base::SysNSStringToUTF16([keywordField_ stringValue]); BOOL keywordValid = controller_->IsKeywordValid(keyword); [self setIsValid:keywordValid toolTip:IDS_SEARCH_ENGINES_INVALID_KEYWORD_TT diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.h b/chrome/browser/ui/cocoa/browser_window_cocoa.h index 92f9e14..4091953 100644 --- a/chrome/browser/ui/cocoa/browser_window_cocoa.h +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.h @@ -108,8 +108,8 @@ class BrowserWindowCocoa : #if defined(ENABLE_ONE_CLICK_SIGNIN) virtual void ShowOneClickSigninBubble( OneClickSigninBubbleType type, - const string16& email, - const string16& error_message, + const base::string16& email, + const base::string16& error_message, const StartSyncCallback& start_sync_callback) OVERRIDE; #endif virtual bool IsDownloadShelfVisible() const OVERRIDE; diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm index 5072ecc..982d068 100644 --- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm @@ -488,8 +488,8 @@ void BrowserWindowCocoa::ShowTranslateBubble( #if defined(ENABLE_ONE_CLICK_SIGNIN) void BrowserWindowCocoa::ShowOneClickSigninBubble( OneClickSigninBubbleType type, - const string16& email, - const string16& error_message, + const base::string16& email, + const base::string16& error_message, const StartSyncCallback& start_sync_callback) { WebContents* web_contents = browser_->tab_strip_model()->GetActiveWebContents(); diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index d9916d6..783c113 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm @@ -234,7 +234,7 @@ enum { } } - string16 label = signin_ui_util::GetSigninMenuLabel(profile); + base::string16 label = signin_ui_util::GetSigninMenuLabel(profile); [signinMenuItem setTitle:l10n_util::FixUpWindowsStyleLabel(label)]; [signinMenuItem setHidden:!showSigninMenuItem]; [followingSeparator setHidden:!showSigninMenuItem]; diff --git a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm index 389ad2c..11b581f 100644 --- a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm +++ b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm @@ -111,7 +111,7 @@ void CollectedCookiesMac::OnConstrainedWindowClosed( #pragma mark Window Controller @interface CollectedCookiesWindowController(Private) --(void)showInfoBarForDomain:(const string16&)domain +-(void)showInfoBarForDomain:(const base::string16&)domain setting:(ContentSetting)setting; -(void)showInfoBarForMultipleDomainsAndSetting:(ContentSetting)setting; -(void)animateInfoBar; @@ -230,7 +230,7 @@ void CollectedCookiesMac::OnConstrainedWindowClosed( forTreeController:(NSTreeController*)controller { NSArray* nodes = [controller selectedNodes]; BOOL multipleDomainsChanged = NO; - string16 lastDomain; + base::string16 lastDomain; for (NSTreeNode* treeNode in nodes) { CocoaCookieTreeNode* node = [treeNode representedObject]; CookieTreeNode* cookie = static_cast<CookieTreeNode*>([node treeNode]); @@ -417,7 +417,7 @@ void CollectedCookiesMac::OnConstrainedWindowClosed( [self animateInfoBar]; } --(void)showInfoBarForDomain:(const string16&)domain +-(void)showInfoBarForDomain:(const base::string16&)domain setting:(ContentSetting)setting { NSString* label; switch (setting) { diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details.h b/chrome/browser/ui/cocoa/content_settings/cookie_details.h index c0c9c84..e76d0d1 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details.h +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details.h @@ -177,8 +177,8 @@ enum CocoaCookieDetailsType { // Used for database details in the cookie prompt dialog. - (id)initWithDatabase:(const std::string&)domain - databaseName:(const string16&)databaseName - databaseDescription:(const string16&)databaseDescription + databaseName:(const base::string16&)databaseName + databaseDescription:(const base::string16&)databaseDescription fileSize:(unsigned long)fileSize; // -initWithAppCacheInfo: creates a cookie details with the manifest URL plus @@ -188,8 +188,8 @@ enum CocoaCookieDetailsType { // Used for local storage details in the cookie prompt dialog. - (id)initWithLocalStorage:(const std::string&)domain - key:(const string16&)key - value:(const string16&)value; + key:(const base::string16&)key + value:(const base::string16&)value; // -initWithAppCacheManifestURL: is called when the cookie prompt is displayed // for an appcache, at that time only the manifest URL of the appcache is known. diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details.mm b/chrome/browser/ui/cocoa/content_settings/cookie_details.mm index 6cde051..02f6f57 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details.mm +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details.mm @@ -201,8 +201,8 @@ } - (id)initWithDatabase:(const std::string&)domain - databaseName:(const string16&)databaseName - databaseDescription:(const string16&)databaseDescription + databaseName:(const base::string16&)databaseName + databaseDescription:(const base::string16&)databaseDescription fileSize:(unsigned long)fileSize { if ((self = [super init])) { type_ = kCocoaCookieDetailsTypePromptDatabase; @@ -218,8 +218,8 @@ } - (id)initWithLocalStorage:(const std::string&)domain - key:(const string16&)key - value:(const string16&)value { + key:(const base::string16&)key + value:(const base::string16&)value { if ((self = [super init])) { type_ = kCocoaCookieDetailsTypePromptLocalStorage; canEditExpiration_ = NO; diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm b/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm index a7761b1..3c9dc36 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm @@ -165,8 +165,8 @@ TEST_F(CookiesDetailsTest, CreateForTreeIndexedDB) { TEST_F(CookiesDetailsTest, CreateForPromptDatabase) { base::scoped_nsobject<CocoaCookieDetails> details; std::string domain("chromium.org"); - string16 name(base::SysNSStringToUTF16(@"wicked_name")); - string16 desc(base::SysNSStringToUTF16(@"desc")); + base::string16 name(base::SysNSStringToUTF16(@"wicked_name")); + base::string16 desc(base::SysNSStringToUTF16(@"desc")); details.reset([[CocoaCookieDetails alloc] initWithDatabase:domain databaseName:name databaseDescription:desc @@ -191,8 +191,8 @@ TEST_F(CookiesDetailsTest, CreateForPromptDatabase) { TEST_F(CookiesDetailsTest, CreateForPromptLocalStorage) { base::scoped_nsobject<CocoaCookieDetails> details; std::string domain("chromium.org"); - string16 key(base::SysNSStringToUTF16(@"testKey")); - string16 value(base::SysNSStringToUTF16(@"testValue")); + base::string16 key(base::SysNSStringToUTF16(@"testKey")); + base::string16 value(base::SysNSStringToUTF16(@"testValue")); details.reset([[CocoaCookieDetails alloc] initWithLocalStorage:domain key:key value:value]); diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller_unittest.mm b/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller_unittest.mm index c901c71..789e64f 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller_unittest.mm @@ -35,8 +35,8 @@ static CookiePromptContentDetailsAdapter* CreateCookieTestContent( static CocoaCookieDetails* CreateTestDatabaseDetails() { std::string domain("chromium.org"); - string16 name(base::SysNSStringToUTF16(@"wicked_name")); - string16 desc(base::SysNSStringToUTF16(@"wicked_desc")); + base::string16 name(base::SysNSStringToUTF16(@"wicked_name")); + base::string16 desc(base::SysNSStringToUTF16(@"wicked_desc")); CocoaCookieDetails* details = [CocoaCookieDetails alloc]; [details initWithDatabase:domain databaseName:name diff --git a/chrome/browser/ui/cocoa/download/download_item_cell.mm b/chrome/browser/ui/cocoa/download/download_item_cell.mm index bb18147..6f54fe0 100644 --- a/chrome/browser/ui/cocoa/download/download_item_cell.mm +++ b/chrome/browser/ui/cocoa/download/download_item_cell.mm @@ -185,7 +185,7 @@ using content::DownloadItem; // Set the name of the download. downloadPath_ = downloadModel->download()->GetFileNameToReportUser(); - string16 statusText = downloadModel->GetStatusText(); + base::string16 statusText = downloadModel->GetStatusText(); if (statusText.empty()) { // Remove the status text label. [self hideSecondaryTitle]; diff --git a/chrome/browser/ui/cocoa/download/download_item_controller.mm b/chrome/browser/ui/cocoa/download/download_item_controller.mm index f5e3cb5..5bc66cc 100644 --- a/chrome/browser/ui/cocoa/download/download_item_controller.mm +++ b/chrome/browser/ui/cocoa/download/download_item_controller.mm @@ -260,7 +260,7 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu { } - (void)updateToolTip { - string16 tooltip_text = + base::string16 tooltip_text = bridge_->download_model()->GetTooltipText(*font_list_, kToolTipMaxWidth); [progressView_ setToolTip:base::SysUTF16ToNSString(tooltip_text)]; } diff --git a/chrome/browser/ui/cocoa/external_protocol_dialog.mm b/chrome/browser/ui/cocoa/external_protocol_dialog.mm index d4aacba..5525925 100644 --- a/chrome/browser/ui/cocoa/external_protocol_dialog.mm +++ b/chrome/browser/ui/cocoa/external_protocol_dialog.mm @@ -44,7 +44,7 @@ void ExternalProtocolHandler::RunExternalProtocolDialog( url_ = *url; creation_time_ = base::Time::Now(); - string16 appName = [self appNameForProtocol]; + base::string16 appName = [self appNameForProtocol]; if (appName.length() == 0) { // No registered apps for this protocol; give up and go home. [self autorelease]; @@ -64,7 +64,7 @@ void ExternalProtocolHandler::RunExternalProtocolDialog( IDS_EXTERNAL_PROTOCOL_CANCEL_BUTTON_TEXT)]; const int kMaxUrlWithoutSchemeSize = 256; - string16 elided_url_without_scheme; + base::string16 elided_url_without_scheme; gfx::ElideString(ASCIIToUTF16(url_.possibly_invalid_spec()), kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); @@ -143,7 +143,7 @@ void ExternalProtocolHandler::RunExternalProtocolDialog( &openingApp); if (status != noErr) { // likely kLSApplicationNotFoundErr - return string16(); + return base::string16(); } NSString* appPath = [(NSURL*)openingApp path]; CFRelease(openingApp); // NOT A BUG; LSGetApplicationForURL retains for us diff --git a/chrome/browser/ui/cocoa/global_error_bubble_controller.mm b/chrome/browser/ui/cocoa/global_error_bubble_controller.mm index d053972..551abe9 100644 --- a/chrome/browser/ui/cocoa/global_error_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/global_error_bubble_controller.mm @@ -88,7 +88,7 @@ class Bridge : public GlobalErrorBubbleViewBase { [title_ setStringValue:SysUTF16ToNSString(error_->GetBubbleViewTitle())]; std::vector<string16> messages = error_->GetBubbleViewMessages(); - string16 message = JoinString(messages, '\n'); + base::string16 message = JoinString(messages, '\n'); base::scoped_nsobject<NSMutableAttributedString> messageValue( [[NSMutableAttributedString alloc] @@ -104,7 +104,7 @@ class Bridge : public GlobalErrorBubbleViewBase { [acceptButton_ setTitle: SysUTF16ToNSString(error_->GetBubbleViewAcceptButtonLabel())]; - string16 cancelLabel = error_->GetBubbleViewCancelButtonLabel(); + base::string16 cancelLabel = error_->GetBubbleViewCancelButtonLabel(); if (cancelLabel.empty()) [cancelButton_ setHidden:YES]; else diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.h b/chrome/browser/ui/cocoa/history_menu_bridge.h index 2ab76ed1..91e79af 100644 --- a/chrome/browser/ui/cocoa/history_menu_bridge.h +++ b/chrome/browser/ui/cocoa/history_menu_bridge.h @@ -71,7 +71,7 @@ class HistoryMenuBridge : public content::NotificationObserver, ~HistoryItem(); // The title for the menu item. - string16 title; + base::string16 title; // The URL that will be navigated to if the user selects this item. GURL url; // Favicon for the URL. diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.mm b/chrome/browser/ui/cocoa/history_menu_bridge.mm index d206e8e..1da19c9 100644 --- a/chrome/browser/ui/cocoa/history_menu_bridge.mm +++ b/chrome/browser/ui/cocoa/history_menu_bridge.mm @@ -349,7 +349,7 @@ NSMenuItem* HistoryMenuBridge::AddItemToMenu(HistoryItem* item, title = base::SysUTF8ToNSString(url_string); NSString* full_title = title; if ([title length] > kMaximumMenuWidthInChars) { - // TODO(rsesek): use app/text_elider.h once it uses string16 and can + // TODO(rsesek): use app/text_elider.h once it uses base::string16 and can // take out the middle of strings. title = [NSString stringWithFormat:@"%@…%@", [title substringToIndex:kMenuTrimSizeInChars], @@ -402,7 +402,7 @@ void HistoryMenuBridge::CreateMenu() { options.SetRecentDayRange(kVisitedScope); history_service_->QueryHistory( - string16(), + base::string16(), options, &cancelable_request_consumer_, base::Bind(&HistoryMenuBridge::OnVisitedHistoryResults, diff --git a/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm b/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm index 12920f7..e5779ee 100644 --- a/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm +++ b/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm @@ -85,7 +85,7 @@ class HistoryMenuBridgeTest : public CocoaProfileTest { return item; } - HistoryMenuBridge::HistoryItem* CreateItem(const string16& title) { + HistoryMenuBridge::HistoryItem* CreateItem(const base::string16& title) { HistoryMenuBridge::HistoryItem* item = new HistoryMenuBridge::HistoryItem(); item->title = title; @@ -175,8 +175,8 @@ TEST_F(HistoryMenuBridgeTest, ClearHistoryMenuEmpty) { TEST_F(HistoryMenuBridgeTest, AddItemToMenu) { NSMenu* menu = [[[NSMenu alloc] initWithTitle:@"history foo"] autorelease]; - const string16 short_url = ASCIIToUTF16("http://foo/"); - const string16 long_url = ASCIIToUTF16("http://super-duper-long-url--." + const base::string16 short_url = ASCIIToUTF16("http://foo/"); + const base::string16 long_url = ASCIIToUTF16("http://super-duper-long-url--." "that.cannot.possibly.fit.even-in-80-columns" "or.be.reasonably-displayed-in-a-menu" "without.looking-ridiculous.com/"); // 140 chars total diff --git a/chrome/browser/ui/cocoa/hung_renderer_controller.mm b/chrome/browser/ui/cocoa/hung_renderer_controller.mm index 01b1ef9..cf314dc 100644 --- a/chrome/browser/ui/cocoa/hung_renderer_controller.mm +++ b/chrome/browser/ui/cocoa/hung_renderer_controller.mm @@ -179,7 +179,7 @@ class WebContentsObserverBridge : public content::WebContentsObserver { base::scoped_nsobject<NSMutableArray> favicons([[NSMutableArray alloc] init]); for (TabContentsIterator it; !it.done(); it.Next()) { if (it->GetRenderProcessHost() == hungContents_->GetRenderProcessHost()) { - string16 title = it->GetTitle(); + base::string16 title = it->GetTitle(); if (title.empty()) title = CoreTabHelper::GetDefaultTitle(); [titles addObject:base::SysUTF16ToNSString(title)]; diff --git a/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm index 3d0be70..6a7585f 100644 --- a/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm @@ -27,9 +27,9 @@ AlternateNavInfoBarDelegate* delegate = static_cast<AlternateNavInfoBarDelegate*>([self delegate]); DCHECK(delegate); - size_t offset = string16::npos; - string16 message = delegate->GetMessageTextWithOffset(&offset); - string16 link = delegate->GetLinkText(); + size_t offset = base::string16::npos; + base::string16 message = delegate->GetMessageTextWithOffset(&offset); + base::string16 link = delegate->GetLinkText(); NSFont* font = [NSFont labelFontOfSize: [NSFont systemFontSizeForControlSize:NSRegularControlSize]]; HyperlinkTextView* view = (HyperlinkTextView*)label_.get(); diff --git a/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.mm index fb1af15..cec81f5 100644 --- a/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.mm @@ -15,8 +15,8 @@ using InfoBarUtilities::VerifyControlOrderAndSpacing; namespace { NSButton* CreateNSButtonWithResourceIDAndParameter( - int resourceId, const string16& param) { - string16 title = l10n_util::GetStringFUTF16(resourceId, param); + int resourceId, const base::string16& param) { + base::string16 title = l10n_util::GetStringFUTF16(resourceId, param); NSButton* button = [[NSButton alloc] init]; [button setTitle:base::SysUTF16ToNSString(title)]; [button setBezelStyle:NSTexturedRoundedBezelStyle]; @@ -46,7 +46,7 @@ NSButton* CreateNSButtonWithResourceIDAndParameter( - (void)initializeExtraControls { TranslateInfoBarDelegate* delegate = [self delegate]; - const string16& language = + const base::string16& language = delegate->language_name_at(delegate->original_language_index()); neverTranslateButton_.reset( CreateNSButtonWithResourceIDAndParameter( @@ -80,9 +80,9 @@ NSButton* CreateNSButtonWithResourceIDAndParameter( - (void)loadLabelText { size_t offset = 0; - string16 text = + base::string16 text = l10n_util::GetStringFUTF16(IDS_TRANSLATE_INFOBAR_BEFORE_MESSAGE, - string16(), &offset); + base::string16(), &offset); NSString* string1 = base::SysUTF16ToNSString(text.substr(0, offset)); NSString* string2 = base::SysUTF16ToNSString(text.substr(offset)); [label1_ setStringValue:string1]; diff --git a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm index 99c34bb..4a771ac 100644 --- a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm @@ -107,7 +107,7 @@ // Set the text and link. NSString* message = base::SysUTF16ToNSString(delegate->GetMessageText()); - string16 link = delegate->GetLinkText(); + base::string16 link = delegate->GetLinkText(); if (!link.empty()) { // Add spacing between the label and the link. message = [message stringByAppendingString:@" "]; diff --git a/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc b/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc index f772168..7686a26 100644 --- a/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc +++ b/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc @@ -52,7 +52,7 @@ bool MockConfirmInfoBarDelegate::Cancel() { string16 MockConfirmInfoBarDelegate::GetLinkText() const { link_text_accessed_ = true; - return string16(); + return base::string16(); } bool MockConfirmInfoBarDelegate::LinkClicked( diff --git a/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h b/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h index 4df1112..1051b1a 100644 --- a/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h +++ b/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h @@ -37,11 +37,11 @@ class MockConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { private: // ConfirmInfoBarDelegate: virtual int GetIconID() const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; - virtual string16 GetLinkText() const OVERRIDE; + virtual base::string16 GetLinkText() const OVERRIDE; virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; Owner* owner_; diff --git a/chrome/browser/ui/cocoa/infobars/translate_message_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/translate_message_infobar_controller.mm index d210d21..53e0a61 100644 --- a/chrome/browser/ui/cocoa/infobars/translate_message_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/translate_message_infobar_controller.mm @@ -17,7 +17,7 @@ using InfoBarUtilities::MoveControl; label1_, translateMessageButton_, spaceBetweenControls_ * 2, true); TranslateInfoBarDelegate* delegate = [self delegate]; if ([self delegate]->ShouldShowMessageInfoBarButton()) { - string16 buttonText = delegate->GetMessageInfoBarButtonText(); + base::string16 buttonText = delegate->GetMessageInfoBarButtonText(); [translateMessageButton_ setTitle:base::SysUTF16ToNSString(buttonText)]; [translateMessageButton_ sizeToFit]; } @@ -37,7 +37,7 @@ using InfoBarUtilities::MoveControl; - (void)loadLabelText { TranslateInfoBarDelegate* delegate = [self delegate]; - string16 messageText = delegate->GetMessageInfoBarText(); + base::string16 messageText = delegate->GetMessageInfoBarText(); NSString* string1 = base::SysUTF16ToNSString(messageText); [label1_ setStringValue:string1]; } diff --git a/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm b/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm index b25ab67..8641d26 100644 --- a/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm +++ b/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm @@ -53,8 +53,8 @@ class KeystonePromotionInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate virtual int GetIconID() const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; virtual bool ShouldExpireInternal( diff --git a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h index cd218e8..0342bc3 100644 --- a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h @@ -21,7 +21,7 @@ class KeywordHintDecoration : public LocationBarDecoration { // Calculates the message to display and where to place the [tab] // image. - void SetKeyword(const string16& keyword, bool is_extension_keyword); + void SetKeyword(const base::string16& keyword, bool is_extension_keyword); // Implement |LocationBarDecoration|. virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE; diff --git a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm index 340f7e4..f8fb800 100644 --- a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm +++ b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm @@ -30,8 +30,8 @@ const CGFloat kHintAvailableRatio = 2.0 / 3.0; // Helper to convert |s| to an |NSString|, trimming whitespace at // ends. -NSString* TrimAndConvert(const string16& s) { - string16 output; +NSString* TrimAndConvert(const base::string16& s) { + base::string16 output; TrimWhitespace(s, TRIM_ALL, &output); return base::SysUTF16ToNSString(output); } @@ -56,7 +56,7 @@ NSImage* KeywordHintDecoration::GetHintImage() { return hint_image_; } -void KeywordHintDecoration::SetKeyword(const string16& short_name, +void KeywordHintDecoration::SetKeyword(const base::string16& short_name, bool is_extension_keyword) { // KEYWORD_HINT is a message like "Press [tab] to search <site>". // [tab] is a parameter to be replaced by an image. "<site>" is @@ -64,9 +64,9 @@ void KeywordHintDecoration::SetKeyword(const string16& short_name, std::vector<size_t> content_param_offsets; int message_id = is_extension_keyword ? IDS_OMNIBOX_EXTENSION_KEYWORD_HINT : IDS_OMNIBOX_KEYWORD_HINT; - const string16 keyword_hint( + const base::string16 keyword_hint( l10n_util::GetStringFUTF16(message_id, - string16(), short_name, + base::string16(), short_name, &content_param_offsets)); // Should always be 2 offsets, see the comment in diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h index c856b5f..ba11001 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h @@ -143,7 +143,7 @@ class LocationBarViewMac : public LocationBar, virtual ToolbarModel* GetToolbarModel() OVERRIDE; virtual const ToolbarModel* GetToolbarModel() const OVERRIDE; - NSImage* GetKeywordImage(const string16& keyword); + NSImage* GetKeywordImage(const base::string16& keyword); AutocompleteTextField* GetAutocompleteTextField() { return field_; } diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm index 4d2457a..e51ae5a 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm @@ -384,8 +384,8 @@ void LocationBarViewMac::Layout() { keyword_hint_decoration_->SetVisible(false); // Get the keyword to use for keyword-search and hinting. - const string16 keyword = omnibox_view_->model()->keyword(); - string16 short_name; + const base::string16 keyword = omnibox_view_->model()->keyword(); + base::string16 short_name; bool is_extension_keyword = false; if (!keyword.empty()) { short_name = TemplateURLServiceFactory::GetForProfile(profile_)-> @@ -405,7 +405,7 @@ void LocationBarViewMac::Layout() { location_icon_decoration_->SetVisible(false); ev_bubble_decoration_->SetVisible(true); - string16 label(GetToolbarModel()->GetEVCertName()); + base::string16 label(GetToolbarModel()->GetEVCertName()); ev_bubble_decoration_->SetFullLabel(base::SysUTF16ToNSString(label)); } else if (!keyword.empty() && is_keyword_hint) { keyword_hint_decoration_->SetKeyword(short_name, @@ -544,7 +544,7 @@ const ToolbarModel* LocationBarViewMac::GetToolbarModel() const { return browser_->toolbar_model(); } -NSImage* LocationBarViewMac::GetKeywordImage(const string16& keyword) { +NSImage* LocationBarViewMac::GetKeywordImage(const base::string16& keyword) { const TemplateURL* template_url = TemplateURLServiceFactory::GetForProfile( profile_)->GetTemplateURLForKeyword(keyword); if (template_url && diff --git a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h index 96b6d13..9c6abf1 100644 --- a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h @@ -19,7 +19,7 @@ class SelectedKeywordDecoration : public BubbleDecoration { // Calculates appropriate full and partial label strings based on // inputs. - void SetKeyword(const string16& keyword, bool is_extension_keyword); + void SetKeyword(const base::string16& keyword, bool is_extension_keyword); // Determines what combination of labels and image will best fit // within |width|, makes those current for |BubbleDecoration|, and diff --git a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm index e7d654f..a19a477 100644 --- a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm +++ b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm @@ -53,9 +53,10 @@ ui::NinePartImageIds SelectedKeywordDecoration::GetBubbleImageIds() { }; } -void SelectedKeywordDecoration::SetKeyword(const string16& short_name, +void SelectedKeywordDecoration::SetKeyword(const base::string16& short_name, bool is_extension_keyword) { - const string16 min_name(location_bar_util::CalculateMinString(short_name)); + const base::string16 min_name( + location_bar_util::CalculateMinString(short_name)); NSString* full_string = is_extension_keyword ? base::SysUTF16ToNSString(short_name) : l10n_util::GetNSStringF(IDS_OMNIBOX_KEYWORD_TEXT, short_name); diff --git a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm index 3c5ab03..e850e9d 100644 --- a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm +++ b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm @@ -32,7 +32,7 @@ class SelectedKeywordDecorationTest : public CocoaTest { // not enough room. TEST_F(SelectedKeywordDecorationTest, UsesPartialKeywordIfNarrow) { - const string16 kKeyword = ASCIIToUTF16("Engine"); + const base::string16 kKeyword = ASCIIToUTF16("Engine"); NSString* const kFullString = @"Search Engine:"; NSString* const kPartialString = @"Search En\u2026:"; // ellipses diff --git a/chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm b/chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm index 912b17d..0caa1d9 100644 --- a/chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm +++ b/chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm @@ -34,7 +34,8 @@ void ZoomDecoration::Update(ZoomController* zoom_controller) { SetImage(OmniboxViewMac::ImageForResource( zoom_controller->GetResourceForZoomLevel())); - string16 zoom_percent = base::IntToString16(zoom_controller->zoom_percent()); + base::string16 zoom_percent = + base::IntToString16(zoom_controller->zoom_percent()); NSString* zoom_string = l10n_util::GetNSStringFWithFixup(IDS_TOOLTIP_ZOOM, zoom_percent); tooltip_.reset([zoom_string retain]); diff --git a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm index b9a81d4..0b0572a 100644 --- a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm +++ b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm @@ -43,8 +43,9 @@ class LoginHandlerMac : public LoginHandler, } // LoginModelObserver implementation. - virtual void OnAutofillDataAvailable(const string16& username, - const string16& password) OVERRIDE { + virtual void OnAutofillDataAvailable( + const base::string16& username, + const base::string16& password) OVERRIDE { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); [sheet_controller_ autofillLogin:base::SysUTF16ToNSString(username) @@ -55,7 +56,7 @@ class LoginHandlerMac : public LoginHandler, // LoginHandler: virtual void BuildViewForPasswordManager( PasswordManager* manager, - const string16& explanation) OVERRIDE { + const base::string16& explanation) OVERRIDE { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); sheet_controller_.reset( @@ -99,8 +100,8 @@ class LoginHandlerMac : public LoginHandler, sheet_controller_.reset(); } - void OnLoginPressed(const string16& username, - const string16& password) { + void OnLoginPressed(const base::string16& username, + const base::string16& password) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); SetAuth(username, password); } diff --git a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.h b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.h index 62afc09..5ca332a 100644 --- a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.h +++ b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.h @@ -19,7 +19,7 @@ class DesktopMediaPickerCocoa : public DesktopMediaPicker { // Overridden from DesktopMediaPicker: virtual void Show(gfx::NativeWindow context, gfx::NativeWindow parent, - const string16& app_name, + const base::string16& app_name, scoped_ptr<DesktopMediaList> media_list, const DoneCallback& done_callback) OVERRIDE; diff --git a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm index 1b31516..57d3b32 100644 --- a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm +++ b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm @@ -14,7 +14,7 @@ DesktopMediaPickerCocoa::~DesktopMediaPickerCocoa() { void DesktopMediaPickerCocoa::Show(gfx::NativeWindow context, gfx::NativeWindow parent, - const string16& app_name, + const base::string16& app_name, scoped_ptr<DesktopMediaList> media_list, const DoneCallback& done_callback) { controller_.reset( diff --git a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h index 4ad9883c..0d37bfe8 100644 --- a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h +++ b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h @@ -55,7 +55,7 @@ // |appName| will be used to format the dialog's title and the label. - (id)initWithMediaList:(scoped_ptr<DesktopMediaList>)media_list callback:(const DesktopMediaPicker::DoneCallback&)callback - appName:(const string16&)appName; + appName:(const base::string16&)appName; @end diff --git a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm index 31342a6..fb16902 100644 --- a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm +++ b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm @@ -32,7 +32,7 @@ const int kExcessButtonPadding = 6; @interface DesktopMediaPickerController (Private) // Populate the window with controls and views. -- (void)initializeContentsWithAppName:(const string16&)appName; +- (void)initializeContentsWithAppName:(const base::string16&)appName; // Create a |NSTextField| with label traits given |width|. Frame height is // automatically adjusted to fit. @@ -56,7 +56,7 @@ const int kExcessButtonPadding = 6; - (id)initWithMediaList:(scoped_ptr<DesktopMediaList>)media_list callback:(const DesktopMediaPicker::DoneCallback&)callback - appName:(const string16&)appName { + appName:(const base::string16&)appName { const NSUInteger kStyleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask; base::scoped_nsobject<NSWindow> window( @@ -83,7 +83,7 @@ const int kExcessButtonPadding = 6; [super dealloc]; } -- (void)initializeContentsWithAppName:(const string16&)appName { +- (void)initializeContentsWithAppName:(const base::string16&)appName { // Use flipped coordinates to facilitate manual layout. const CGFloat kPaddedWidth = kInitialContentWidth - (kFramePadding * 2); base::scoped_nsobject<FlippedView> content( diff --git a/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm b/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm index b8f8137..6dfea68 100644 --- a/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm @@ -79,7 +79,7 @@ class BalloonControllerTest : public ChromeRenderViewHostTestHarness { TEST_F(BalloonControllerTest, ShowAndCloseTest) { Notification n(GURL("http://www.google.com"), GURL("http://www.google.com"), - ASCIIToUTF16("http://www.google.com"), string16(), + ASCIIToUTF16("http://www.google.com"), base::string16(), new NotificationObjectProxy(-1, -1, -1, false)); scoped_ptr<Balloon> balloon( new Balloon(n, profile(), collection_.get())); @@ -95,7 +95,7 @@ TEST_F(BalloonControllerTest, ShowAndCloseTest) { TEST_F(BalloonControllerTest, SizesTest) { Notification n(GURL("http://www.google.com"), GURL("http://www.google.com"), - ASCIIToUTF16("http://www.google.com"), string16(), + ASCIIToUTF16("http://www.google.com"), base::string16(), new NotificationObjectProxy(-1, -1, -1, false)); scoped_ptr<Balloon> balloon( new Balloon(n, profile(), collection_.get())); diff --git a/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.mm b/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.mm index acb9edc..b266e8c 100644 --- a/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.mm +++ b/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.mm @@ -100,7 +100,7 @@ void MessageCenterTrayBridge::UpdateStatusItem() { [status_item_view_ setUnreadCount:unread_count withQuietMode:quiet_mode]; if (unread_count > 0) { - string16 unread_count_string = base::FormatNumber(unread_count); + base::string16 unread_count_string = base::FormatNumber(unread_count); [status_item_view_ setToolTip: l10n_util::GetNSStringF(IDS_MESSAGE_CENTER_TOOLTIP_UNREAD, unread_count_string)]; diff --git a/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge_unittest.mm b/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge_unittest.mm index e8755f7..62cabb8 100644 --- a/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge_unittest.mm +++ b/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge_unittest.mm @@ -50,7 +50,7 @@ TEST_F(MessageCenterTrayBridgeTest, StatusItemOnlyAfterFirstNotification) { ASCIIToUTF16("First notification"), ASCIIToUTF16("This is a simple test."), gfx::Image(), - string16(), + base::string16(), message_center::NotifierId(), data, NULL)); diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h index da3b545..c14872b 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h @@ -60,7 +60,7 @@ class OmniboxPopupViewMac : public OmniboxPopupView, // Applies the given font and colors to the match string based on // classifications. static NSMutableAttributedString* DecorateMatchedString( - const string16& match_string, + const base::string16& match_string, const AutocompleteMatch::ACMatchClassifications& classifications, NSColor* text_color, NSColor* dim_text_color, @@ -74,7 +74,7 @@ class OmniboxPopupViewMac : public OmniboxPopupView, // cleaner. static NSMutableAttributedString* ElideString( NSMutableAttributedString* a_string, - const string16& original_string, + const base::string16& original_string, const gfx::Font& font, const float cell_width); diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm index d1f302b..17678d2 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm @@ -246,7 +246,7 @@ NSAttributedString* OmniboxPopupViewMac::MatchText( // static NSMutableAttributedString* OmniboxPopupViewMac::DecorateMatchedString( - const string16& match_string, + const base::string16& match_string, const AutocompleteMatch::ACMatchClassifications& classifications, NSColor* text_color, NSColor* dim_text_color, @@ -311,7 +311,7 @@ NSMutableAttributedString* OmniboxPopupViewMac::DecorateMatchedString( NSMutableAttributedString* OmniboxPopupViewMac::ElideString( NSMutableAttributedString* a_string, - const string16& original_string, + const base::string16& original_string, const gfx::Font& font, const float width) { // If it already fits, nothing to be done. @@ -320,7 +320,7 @@ NSMutableAttributedString* OmniboxPopupViewMac::ElideString( } // If ElideText() decides to do nothing, nothing to be done. - const string16 elided = + const base::string16 elided = gfx::ElideText(original_string, font, width, gfx::ELIDE_AT_END); if (0 == elided.compare(original_string)) { return a_string; diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm index 0b267de..062f0f5 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm @@ -76,8 +76,8 @@ bool RunHasFontTrait(NSAttributedString* string, // AutocompleteMatch doesn't really have the right constructor for our // needs. Fake one for us to use. -AutocompleteMatch MakeMatch(const string16& contents, - const string16& description) { +AutocompleteMatch MakeMatch(const base::string16& contents, + const base::string16& description) { AutocompleteMatch m(NULL, 1, true, AutocompleteMatchType::URL_WHAT_YOU_TYPED); m.contents = contents; m.description = description; @@ -373,7 +373,7 @@ TEST_F(OmniboxPopupViewMacTest, MatchTextContentsMatch) { EXPECT_EQ(run_length_1 + run_length_2 + run_length_3, [contents length]); AutocompleteMatch m = MakeMatch(base::SysNSStringToUTF16(contents), - string16()); + base::string16()); // Push each run onto contents classifications. m.contents_class.push_back( @@ -467,7 +467,7 @@ TEST_F(OmniboxPopupViewMacTest, MatchTextDescriptionMatch) { TEST_F(OmniboxPopupViewMacTest, ElideString) { NSString* const contents = @"This is a test with long contents"; - const string16 contents16(base::SysNSStringToUTF16(contents)); + const base::string16 contents16(base::SysNSStringToUTF16(contents)); const float kWide = 1000.0; const float kNarrow = 20.0; @@ -487,7 +487,7 @@ TEST_F(OmniboxPopupViewMacTest, ElideString) { // When elided, result is the same as ElideText(). ret = OmniboxPopupViewMac::ElideString(as, contents16, font_, kNarrow); - string16 elided = + base::string16 elided = gfx::ElideText(contents16, font_, kNarrow, gfx::ELIDE_AT_END); EXPECT_TRUE(ret == as); EXPECT_FALSE([[as string] isEqualToString:contents]); diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h index b76cba2..becf719 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h @@ -32,16 +32,17 @@ class OmniboxViewMac : public OmniboxView, virtual void SaveStateToTab(content::WebContents* tab) OVERRIDE; virtual void OnTabChanged(const content::WebContents* web_contents) OVERRIDE; virtual void Update() OVERRIDE; - virtual string16 GetText() const OVERRIDE; - virtual void SetWindowTextAndCaretPos(const string16& text, + virtual base::string16 GetText() const OVERRIDE; + virtual void SetWindowTextAndCaretPos(const base::string16& text, size_t caret_pos, bool update_popup, bool notify_text_changed) OVERRIDE; virtual void SetForcedQuery() OVERRIDE; virtual bool IsSelectAll() const OVERRIDE; virtual bool DeleteAtEndPressed() OVERRIDE; - virtual void GetSelectionBounds(string16::size_type* start, - string16::size_type* end) const OVERRIDE; + virtual void GetSelectionBounds( + base::string16::size_type* start, + base::string16::size_type* end) const OVERRIDE; virtual void SelectAll(bool reversed) OVERRIDE; virtual void RevertAll() OVERRIDE; virtual void UpdatePopup() OVERRIDE; @@ -49,19 +50,19 @@ class OmniboxViewMac : public OmniboxView, virtual void SetFocus() OVERRIDE; virtual void ApplyCaretVisibility() OVERRIDE; virtual void OnTemporaryTextMaybeChanged( - const string16& display_text, + const base::string16& display_text, bool save_original_selection, bool notify_text_changed) OVERRIDE; virtual bool OnInlineAutocompleteTextMaybeChanged( - const string16& display_text, size_t user_text_length) OVERRIDE; + const base::string16& display_text, size_t user_text_length) OVERRIDE; virtual void OnInlineAutocompleteTextCleared() OVERRIDE; virtual void OnRevertTemporaryText() OVERRIDE; virtual void OnBeforePossibleChange() OVERRIDE; virtual bool OnAfterPossibleChange() OVERRIDE; virtual gfx::NativeView GetNativeView() const OVERRIDE; virtual gfx::NativeView GetRelativeWindowForPopup() const OVERRIDE; - virtual void SetGrayTextAutocompletion(const string16& input) OVERRIDE; - virtual string16 GetGrayTextAutocompletion() const OVERRIDE; + virtual void SetGrayTextAutocompletion(const base::string16& input) OVERRIDE; + virtual base::string16 GetGrayTextAutocompletion() const OVERRIDE; virtual int TextWidth() const OVERRIDE; virtual bool IsImeComposing() const OVERRIDE; @@ -131,14 +132,14 @@ class OmniboxViewMac : public OmniboxView, // Update the field with |display_text| and highlight the host and scheme (if // it's an URL or URL-fragment). Resets any suggest text that may be present. - void SetText(const string16& display_text); + void SetText(const base::string16& display_text); // Internal implementation of SetText. Does not reset the suggest text before // setting the display text. Most callers should use |SetText()| instead. - void SetTextInternal(const string16& display_text); + void SetTextInternal(const base::string16& display_text); // Update the field with |display_text| and set the selection. - void SetTextAndSelectedRange(const string16& display_text, + void SetTextAndSelectedRange(const base::string16& display_text, const NSRange range); // Pass the current content of |field_| to SetText(), maintaining @@ -148,7 +149,7 @@ class OmniboxViewMac : public OmniboxView, // Calculates text attributes according to |display_text| and applies them // to the given |as| object. - void ApplyTextAttributes(const string16& display_text, + void ApplyTextAttributes(const base::string16& display_text, NSMutableAttributedString* as); // Return the number of UTF-16 units in the current buffer, excluding the @@ -170,7 +171,7 @@ class OmniboxViewMac : public OmniboxView, // Tracking state before and after a possible change for reporting // to model_. NSRange selection_before_change_; - string16 text_before_change_; + base::string16 text_before_change_; NSRange marked_range_before_change_; // Was delete pressed? @@ -179,7 +180,7 @@ class OmniboxViewMac : public OmniboxView, // Was the delete key pressed with an empty selection at the end of the edit? bool delete_at_end_pressed_; - string16 suggest_text_; + base::string16 suggest_text_; DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac); }; diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm index 4a5a333..932da71 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm @@ -224,7 +224,7 @@ void OmniboxViewMac::Update() { } } -string16 OmniboxViewMac::GetText() const { +base::string16 OmniboxViewMac::GetText() const { return base::SysNSStringToUTF16([field_ stringValue]); } @@ -255,7 +255,7 @@ void OmniboxViewMac::SetSelectedRange(const NSRange range) { } } -void OmniboxViewMac::SetWindowTextAndCaretPos(const string16& text, +void OmniboxViewMac::SetWindowTextAndCaretPos(const base::string16& text, size_t caret_pos, bool update_popup, bool notify_text_changed) { @@ -275,7 +275,7 @@ void OmniboxViewMac::SetForcedQuery() { const base::string16 current_text(GetText()); const size_t start = current_text.find_first_not_of(base::kWhitespaceUTF16); - if (start == string16::npos || (current_text[start] != '?')) { + if (start == base::string16::npos || (current_text[start] != '?')) { SetUserText(ASCIIToUTF16("?")); } else { NSRange range = NSMakeRange(start + 1, current_text.size() - start - 1); @@ -294,8 +294,8 @@ bool OmniboxViewMac::DeleteAtEndPressed() { return delete_at_end_pressed_; } -void OmniboxViewMac::GetSelectionBounds(string16::size_type* start, - string16::size_type* end) const { +void OmniboxViewMac::GetSelectionBounds(base::string16::size_type* start, + base::string16::size_type* end) const { if (![field_ currentEditor]) { *start = *end = 0; return; @@ -359,11 +359,11 @@ void OmniboxViewMac::ApplyCaretVisibility() { ofView:field_]; } -void OmniboxViewMac::SetText(const string16& display_text) { +void OmniboxViewMac::SetText(const base::string16& display_text) { SetTextInternal(display_text); } -void OmniboxViewMac::SetTextInternal(const string16& display_text) { +void OmniboxViewMac::SetTextInternal(const base::string16& display_text) { NSString* ss = base::SysUTF16ToNSString(display_text); NSMutableAttributedString* as = [[[NSMutableAttributedString alloc] initWithString:ss] autorelease]; @@ -388,7 +388,7 @@ void OmniboxViewMac::SetTextInternal(const string16& display_text) { // text-field implementation. } -void OmniboxViewMac::SetTextAndSelectedRange(const string16& display_text, +void OmniboxViewMac::SetTextAndSelectedRange(const base::string16& display_text, const NSRange range) { SetText(display_text); SetSelectedRange(range); @@ -414,7 +414,7 @@ void OmniboxViewMac::EmphasizeURLComponents() { } } -void OmniboxViewMac::ApplyTextAttributes(const string16& display_text, +void OmniboxViewMac::ApplyTextAttributes(const base::string16& display_text, NSMutableAttributedString* as) { NSUInteger as_length = [as length]; NSRange as_entire_string = NSMakeRange(0, as_length); @@ -484,9 +484,10 @@ void OmniboxViewMac::ApplyTextAttributes(const string16& display_text, } } -void OmniboxViewMac::OnTemporaryTextMaybeChanged(const string16& display_text, - bool save_original_selection, - bool notify_text_changed) { +void OmniboxViewMac::OnTemporaryTextMaybeChanged( + const base::string16& display_text, + bool save_original_selection, + bool notify_text_changed) { if (save_original_selection) saved_temporary_selection_ = GetSelectedRange(); @@ -497,7 +498,7 @@ void OmniboxViewMac::OnTemporaryTextMaybeChanged(const string16& display_text, } bool OmniboxViewMac::OnInlineAutocompleteTextMaybeChanged( - const string16& display_text, + const base::string16& display_text, size_t user_text_length) { // TODO(shess): Make sure that this actually works. The round trip // to native form and back may mean that it's the same but not the @@ -544,7 +545,7 @@ bool OmniboxViewMac::OnAfterPossibleChange() { DCHECK(IsFirstResponder()); const NSRange new_selection(GetSelectedRange()); - const string16 new_text(GetText()); + const base::string16 new_text(GetText()); const size_t length = new_text.length(); const bool selection_differs = @@ -600,7 +601,8 @@ gfx::NativeView OmniboxViewMac::GetRelativeWindowForPopup() const { return NULL; } -void OmniboxViewMac::SetGrayTextAutocompletion(const string16& suggest_text) { +void OmniboxViewMac::SetGrayTextAutocompletion( + const base::string16& suggest_text) { if (suggest_text == suggest_text_) return; suggest_text_ = suggest_text; @@ -608,7 +610,7 @@ void OmniboxViewMac::SetGrayTextAutocompletion(const string16& suggest_text) { textColor:SuggestTextColor()]; } -string16 OmniboxViewMac::GetGrayTextAutocompletion() const { +base::string16 OmniboxViewMac::GetGrayTextAutocompletion() const { return suggest_text_; } @@ -792,7 +794,7 @@ void OmniboxViewMac::CopyToPasteboard(NSPasteboard* pb) { DCHECK(CanCopy()); const NSRange selection = GetSelectedRange(); - string16 text = base::SysNSStringToUTF16( + base::string16 text = base::SysNSStringToUTF16( [[field_ stringValue] substringWithRange:selection]); // Copy the URL unless this is the search URL and it's being replaced by the @@ -827,7 +829,7 @@ void OmniboxViewMac::OnPaste() { // This code currently expects |field_| to be focussed. DCHECK([field_ currentEditor]); - string16 text = GetClipboardText(); + base::string16 text = GetClipboardText(); if (text.empty()) { return; } @@ -869,14 +871,14 @@ bool OmniboxViewMac::CanPasteAndGo() { } int OmniboxViewMac::GetPasteActionStringId() { - string16 text(GetClipboardText()); + base::string16 text(GetClipboardText()); DCHECK(model()->CanPasteAndGo(text)); return model()->IsPasteAndSearch(text) ? IDS_PASTE_AND_SEARCH : IDS_PASTE_AND_GO; } void OmniboxViewMac::OnPasteAndGo() { - string16 text(GetClipboardText()); + base::string16 text(GetClipboardText()); if (model()->CanPasteAndGo(text)) model()->PasteAndGo(text); } diff --git a/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.mm b/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.mm index 022e373..f0156f2 100644 --- a/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.mm +++ b/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.mm @@ -13,7 +13,7 @@ OneClickSigninDialogController::OneClickSigninDialogController( content::WebContents* web_contents, const BrowserWindow::StartSyncCallback& sync_callback, - const string16& email) { + const base::string16& email) { base::Closure close_callback = base::Bind( &OneClickSigninDialogController::PerformClose, base::Unretained(this)); view_controller_.reset([[OneClickSigninViewController alloc] diff --git a/chrome/browser/ui/cocoa/one_click_signin_view_controller.h b/chrome/browser/ui/cocoa/one_click_signin_view_controller.h index 751970a..df1f2d5 100644 --- a/chrome/browser/ui/cocoa/one_click_signin_view_controller.h +++ b/chrome/browser/ui/cocoa/one_click_signin_view_controller.h @@ -32,7 +32,7 @@ class WebContents; BOOL clickedLearnMore_; // The user's email address to be used for sync. - string16 email_; + base::string16 email_; // Alternate error message to be displayed. base::scoped_nsobject<NSString> errorMessage_; @@ -57,7 +57,7 @@ class WebContents; syncCallback:(const BrowserWindow::StartSyncCallback&)syncCallback closeCallback:(const base::Closure&)callback isSyncDialog:(BOOL)isSyncDialog - email:(const string16&)email + email:(const base::string16&)email errorMessage:(NSString*)errorMessage; // Called before the view is closed. diff --git a/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm b/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm index be723e3..db6d681 100644 --- a/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm +++ b/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm @@ -44,7 +44,7 @@ void ShiftOriginY(NSView* view, CGFloat amount) { syncCallback:(const BrowserWindow::StartSyncCallback&)syncCallback closeCallback:(const base::Closure&)closeCallback isSyncDialog:(BOOL)isSyncDialog - email:(const string16&)email + email:(const base::string16&)email errorMessage:(NSString*)errorMessage { if ((self = [super initWithNibName:nibName bundle:base::mac::FrameworkBundle()])) { diff --git a/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.mm b/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.mm index 4a84a92..e47e710 100644 --- a/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.mm +++ b/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.mm @@ -82,8 +82,8 @@ void RemoveUnderlining(NSTextView* textView, int offset, int length) { NSTextView* AddTextView( NSView* parent, id<NSTextViewDelegate> delegate, - const string16& message, - const string16& link, + const base::string16& message, + const base::string16& link, int offset, const ui::ResourceBundle::FontStyle& font_style) { base::scoped_nsobject<HyperlinkTextView> textView( @@ -107,7 +107,7 @@ NSTextView* AddTextView( // Create a new NSTextField and add it to the specified parent. NSTextField* AddTextField( NSView* parent, - const string16& message, + const base::string16& message, const ui::ResourceBundle::FontStyle& font_style) { NSTextField* textField = constrained_window::CreateLabel(); [textField setAttributedStringValue: @@ -251,9 +251,10 @@ NSTextField* AddTextField( // Prompt text. size_t offset; - const string16 domain = ASCIIToUTF16(gaia::ExtractDomainName(username_)); - const string16 username = ASCIIToUTF16(username_); - const string16 prompt_text = + const base::string16 domain = + ASCIIToUTF16(gaia::ExtractDomainName(username_)); + const base::string16 username = ASCIIToUTF16(username_); + const base::string16 prompt_text = l10n_util::GetStringFUTF16( IDS_ENTERPRISE_SIGNIN_ALERT_NEW_STYLE, domain, &offset); @@ -275,10 +276,10 @@ NSTextField* AddTextField( // Explanation text. std::vector<size_t> offsets; - const string16 learn_more_text = + const base::string16 learn_more_text = l10n_util::GetStringUTF16( IDS_ENTERPRISE_SIGNIN_PROFILE_LINK_LEARN_MORE); - const string16 explanation_text = + const base::string16 explanation_text = l10n_util::GetStringFUTF16( offerProfileCreation_ ? IDS_ENTERPRISE_SIGNIN_EXPLANATION_WITH_PROFILE_CREATION_NEW_STYLE : @@ -288,7 +289,7 @@ NSTextField* AddTextField( // into the middle of the message text. To do this we slice out // the "learn more" string from the message so that it can be // inserted again. - const string16 explanation_message_text = + const base::string16 explanation_message_text = explanation_text.substr(0, offsets[1]) + explanation_text.substr(offsets[1] + learn_more_text.size()); explanationField_.reset( diff --git a/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller_browsertest.mm b/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller_browsertest.mm index 0d5a5c4..d477090 100644 --- a/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller_browsertest.mm +++ b/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller_browsertest.mm @@ -57,7 +57,7 @@ class ProfileSigninConfirmationViewControllerTest std::string username() { return "foo@bar.com"; } - string16 learn_more() { + base::string16 learn_more() { return l10n_util::GetStringUTF16( IDS_ENTERPRISE_SIGNIN_PROFILE_LINK_LEARN_MORE); } diff --git a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.h b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.h index ca803a7..97126c8 100644 --- a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.h +++ b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.h @@ -22,14 +22,14 @@ } - (id)initWithCallback:(const base::Closure&)stop_callback - text:(const string16&)text; + text:(const base::string16&)text; - (void)stopSharing:(id)sender; @end class ScreenCaptureNotificationUICocoa : public ScreenCaptureNotificationUI { public: - explicit ScreenCaptureNotificationUICocoa(const string16& text); + explicit ScreenCaptureNotificationUICocoa(const base::string16& text); virtual ~ScreenCaptureNotificationUICocoa(); // ScreenCaptureNotificationUI interface. @@ -38,7 +38,7 @@ class ScreenCaptureNotificationUICocoa : public ScreenCaptureNotificationUI { private: friend class ScreenCaptureNotificationUICocoaTest; - const string16 text_; + const base::string16 text_; base::scoped_nsobject<ScreenCaptureNotificationController> windowController_; DISALLOW_COPY_AND_ASSIGN(ScreenCaptureNotificationUICocoa); diff --git a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm index 6f5cc4e..15b937a 100644 --- a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm +++ b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm @@ -34,7 +34,7 @@ const CGFloat kWindowCornerRadius = 2; @interface ScreenCaptureNotificationController() - (void)hide; -- (void)populateWithText:(const string16&)text; +- (void)populateWithText:(const base::string16&)text; @end @interface ScreenCaptureNotificationView : NSView @@ -46,7 +46,7 @@ const CGFloat kWindowCornerRadius = 2; ScreenCaptureNotificationUICocoa::ScreenCaptureNotificationUICocoa( - const string16& text) + const base::string16& text) : text_(text) { } @@ -64,14 +64,14 @@ void ScreenCaptureNotificationUICocoa::OnStarted( } scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( - const string16& text) { + const base::string16& text) { return scoped_ptr<ScreenCaptureNotificationUI>( new ScreenCaptureNotificationUICocoa(text)); } @implementation ScreenCaptureNotificationController - (id)initWithCallback:(const base::Closure&)stop_callback - text:(const string16&)text { + text:(const base::string16&)text { base::scoped_nsobject<NSWindow> window( [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater styleMask:NSBorderlessWindowMask @@ -117,7 +117,7 @@ scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( [self close]; } -- (void)populateWithText:(const string16&)text { +- (void)populateWithText:(const base::string16&)text { base::scoped_nsobject<ScreenCaptureNotificationView> content( [[ScreenCaptureNotificationView alloc] initWithFrame:ui::kWindowSizeDeterminedLater]); @@ -151,7 +151,7 @@ scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( gfx::Font font(ui::ResourceBundle::GetSharedInstance() .GetFont(ui::ResourceBundle::BaseFont) .GetNativeFont()); - string16 elidedText = + base::string16 elidedText = ElideText(text, font, maxLabelWidth, gfx::ELIDE_IN_MIDDLE); NSString* statusText = base::SysUTF16ToNSString(elidedText); base::scoped_nsobject<NSTextField> statusTextField( diff --git a/chrome/browser/ui/cocoa/simple_message_box_mac.mm b/chrome/browser/ui/cocoa/simple_message_box_mac.mm index cc956ee..883d527 100644 --- a/chrome/browser/ui/cocoa/simple_message_box_mac.mm +++ b/chrome/browser/ui/cocoa/simple_message_box_mac.mm @@ -14,8 +14,8 @@ namespace chrome { MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, - const string16& title, - const string16& message, + const base::string16& title, + const base::string16& message, MessageBoxType type) { if (type == MESSAGE_BOX_TYPE_OK_CANCEL) NOTIMPLEMENTED(); diff --git a/chrome/browser/ui/cocoa/speech_recognition_window_controller.h b/chrome/browser/ui/cocoa/speech_recognition_window_controller.h index 9befe2c..24fa890 100644 --- a/chrome/browser/ui/cocoa/speech_recognition_window_controller.h +++ b/chrome/browser/ui/cocoa/speech_recognition_window_controller.h @@ -41,7 +41,7 @@ // Updates the UI with data related to the given display mode. - (void)updateLayout:(SpeechRecognitionBubbleBase::DisplayMode)mode - messageText:(const string16&)messageText + messageText:(const base::string16&)messageText iconImage:(NSImage*)iconImage; // Makes the speech recognition bubble visible on screen. diff --git a/chrome/browser/ui/cocoa/speech_recognition_window_controller.mm b/chrome/browser/ui/cocoa/speech_recognition_window_controller.mm index 6a0969e..2048fb2 100644 --- a/chrome/browser/ui/cocoa/speech_recognition_window_controller.mm +++ b/chrome/browser/ui/cocoa/speech_recognition_window_controller.mm @@ -175,7 +175,7 @@ const int kInstructionLabelMaxWidth = 150; } - (void)updateLayout:(SpeechRecognitionBubbleBase::DisplayMode)mode - messageText:(const string16&)messageText + messageText:(const base::string16&)messageText iconImage:(NSImage*)iconImage { // The very first time this method is called, the child views would still be // uninitialized and null. So we invoke [self window] first and that sets up diff --git a/chrome/browser/ui/cocoa/status_bubble_mac.h b/chrome/browser/ui/cocoa/status_bubble_mac.h index d38c9e5..be7637f 100644 --- a/chrome/browser/ui/cocoa/status_bubble_mac.h +++ b/chrome/browser/ui/cocoa/status_bubble_mac.h @@ -35,7 +35,7 @@ class StatusBubbleMac : public StatusBubble { virtual ~StatusBubbleMac(); // StatusBubble implementation. - virtual void SetStatus(const string16& status) OVERRIDE; + virtual void SetStatus(const base::string16& status) OVERRIDE; virtual void SetURL(const GURL& url, const std::string& languages) OVERRIDE; virtual void Hide() OVERRIDE; virtual void MouseMoved(const gfx::Point& location, @@ -72,7 +72,7 @@ class StatusBubbleMac : public StatusBubble { void SetState(StatusBubbleState state); // Sets the bubble text for SetStatus and SetURL. - void SetText(const string16& text, bool is_url); + void SetText(const base::string16& text, bool is_url); // Construct the window/widget if it does not already exist. (Safe to call if // it does.) diff --git a/chrome/browser/ui/cocoa/status_bubble_mac.mm b/chrome/browser/ui/cocoa/status_bubble_mac.mm index d42cb29..2e5cdf8 100644 --- a/chrome/browser/ui/cocoa/status_bubble_mac.mm +++ b/chrome/browser/ui/cocoa/status_bubble_mac.mm @@ -124,7 +124,7 @@ StatusBubbleMac::~StatusBubbleMac() { window_ = nil; } -void StatusBubbleMac::SetStatus(const string16& status) { +void StatusBubbleMac::SetStatus(const base::string16& status) { SetText(status, false); } @@ -153,8 +153,9 @@ void StatusBubbleMac::SetURL(const GURL& url, const std::string& languages) { gfx::FontList font_list_chr( gfx::Font(base::SysNSStringToUTF8([font fontName]), [font pointSize])); - string16 original_url_text = net::FormatUrl(url, languages); - string16 status = gfx::ElideUrl(url, font_list_chr, text_width, languages); + base::string16 original_url_text = net::FormatUrl(url, languages); + base::string16 status = + gfx::ElideUrl(url, font_list_chr, text_width, languages); SetText(status, true); @@ -178,7 +179,7 @@ void StatusBubbleMac::SetURL(const GURL& url, const std::string& languages) { } } -void StatusBubbleMac::SetText(const string16& text, bool is_url) { +void StatusBubbleMac::SetText(const base::string16& text, bool is_url) { // The status bubble allows the status and URL strings to be set // independently. Whichever was set non-empty most recently will be the // value displayed. When both are empty, the status bubble hides. @@ -623,7 +624,7 @@ void StatusBubbleMac::ExpandBubble() { NSFont* font = [[window_ contentView] font]; gfx::FontList font_list_chr( gfx::Font(base::SysNSStringToUTF8([font fontName]), [font pointSize])); - string16 expanded_url = gfx::ElideUrl( + base::string16 expanded_url = gfx::ElideUrl( url_, font_list_chr, max_bubble_width, languages_); // Scale width from gfx::Font in view coordinates to window coordinates. diff --git a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h index 6bd6570..c3f5cf0 100644 --- a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h +++ b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h @@ -26,10 +26,10 @@ class StatusIconMac : public StatusIcon { // Overridden from StatusIcon. virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE; virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE; - virtual void SetToolTip(const string16& tool_tip) OVERRIDE; + virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE; virtual void DisplayBalloon(const gfx::ImageSkia& icon, - const string16& title, - const string16& contents) OVERRIDE; + const base::string16& title, + const base::string16& contents) OVERRIDE; bool HasStatusIconMenu(); diff --git a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm index cc79fc6..32c1f81 100644 --- a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm +++ b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm @@ -79,7 +79,7 @@ void StatusIconMac::SetPressedImage(const gfx::ImageSkia& image) { } } -void StatusIconMac::SetToolTip(const string16& tool_tip) { +void StatusIconMac::SetToolTip(const base::string16& tool_tip) { // If we have a status icon menu, make the tool tip part of the menu instead // of a pop-up tool tip when hovering the mouse over the image. toolTip_.reset([base::SysUTF16ToNSString(tool_tip) retain]); @@ -92,8 +92,8 @@ void StatusIconMac::SetToolTip(const string16& tool_tip) { } void StatusIconMac::DisplayBalloon(const gfx::ImageSkia& icon, - const string16& title, - const string16& contents) { + const base::string16& title, + const base::string16& contents) { notification_.DisplayBalloon(icon, title, contents); } diff --git a/chrome/browser/ui/cocoa/status_icons/status_tray_mac.h b/chrome/browser/ui/cocoa/status_icons/status_tray_mac.h index 7325d86..7496892 100644 --- a/chrome/browser/ui/cocoa/status_icons/status_tray_mac.h +++ b/chrome/browser/ui/cocoa/status_icons/status_tray_mac.h @@ -17,7 +17,7 @@ class StatusTrayMac : public StatusTray { virtual StatusIcon* CreatePlatformStatusIcon( StatusIconType type, const gfx::ImageSkia& image, - const string16& tool_tip) OVERRIDE; + const base::string16& tool_tip) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(StatusTrayMac); diff --git a/chrome/browser/ui/cocoa/status_icons/status_tray_mac.mm b/chrome/browser/ui/cocoa/status_icons/status_tray_mac.mm index 50dc797..bec5554 100644 --- a/chrome/browser/ui/cocoa/status_icons/status_tray_mac.mm +++ b/chrome/browser/ui/cocoa/status_icons/status_tray_mac.mm @@ -13,9 +13,10 @@ StatusTray* StatusTray::Create() { StatusTrayMac::StatusTrayMac() { } -StatusIcon* StatusTrayMac::CreatePlatformStatusIcon(StatusIconType type, - const gfx::ImageSkia& image, - const string16& tool_tip) { +StatusIcon* StatusTrayMac::CreatePlatformStatusIcon( + StatusIconType type, + const gfx::ImageSkia& image, + const base::string16& tool_tip) { StatusIcon* icon = new StatusIconMac(); icon->SetImage(image); icon->SetToolTip(tool_tip); diff --git a/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.h b/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.h index c43503a..43afdd7 100644 --- a/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.h +++ b/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.h @@ -31,7 +31,7 @@ class RenderViewContextMenuMac : public RenderViewContextMenu { virtual void UpdateMenuItem(int command_id, bool enabled, bool hidden, - const string16& title) OVERRIDE; + const base::string16& title) OVERRIDE; protected: // RenderViewContextMenu implementation. diff --git a/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm b/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm index 4caf5ce..47c4516 100644 --- a/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm +++ b/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm @@ -265,7 +265,7 @@ void RenderViewContextMenuMac::StopSpeaking() { void RenderViewContextMenuMac::UpdateMenuItem(int command_id, bool enabled, bool hidden, - const string16& title) { + const base::string16& title) { NSMenuItem* item = GetMenuItemByID(&menu_model_, [menu_controller_ menu], command_id); if (!item) diff --git a/chrome/browser/ui/cocoa/tab_contents/sad_tab_view.mm b/chrome/browser/ui/cocoa/tab_contents/sad_tab_view.mm index 411ffff..769ea74 100644 --- a/chrome/browser/ui/cocoa/tab_contents/sad_tab_view.mm +++ b/chrome/browser/ui/cocoa/tab_contents/sad_tab_view.mm @@ -147,7 +147,7 @@ static const CGFloat kTabHorzMargin = 13; // Get the help text and link. size_t linkOffset = 0; NSString* helpMessage(base::SysUTF16ToNSString(l10n_util::GetStringFUTF16( - IDS_SAD_TAB_HELP_MESSAGE, string16(), &linkOffset))); + IDS_SAD_TAB_HELP_MESSAGE, base::string16(), &linkOffset))); NSString* helpLink = l10n_util::GetNSString(IDS_SAD_TAB_HELP_LINK); NSFont* font = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; [help_.get() setMessageAndLink:helpMessage diff --git a/chrome/browser/ui/cocoa/tabpose_window.mm b/chrome/browser/ui/cocoa/tabpose_window.mm index af5b80b..f4cc4fc 100644 --- a/chrome/browser/ui/cocoa/tabpose_window.mm +++ b/chrome/browser/ui/cocoa/tabpose_window.mm @@ -406,7 +406,7 @@ class Tile { NSRect title_rect() const { return NSIntegralRect(title_rect_); } // Returns an unelided title. The view logic is responsible for eliding. - const string16& title() const { + const base::string16& title() const { return contents_->GetTitle(); } diff --git a/chrome/browser/ui/cocoa/task_manager_mac_unittest.mm b/chrome/browser/ui/cocoa/task_manager_mac_unittest.mm index 9dff6b1e..5bf1fe7 100644 --- a/chrome/browser/ui/cocoa/task_manager_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/task_manager_mac_unittest.mm @@ -19,9 +19,12 @@ namespace { class TestResource : public task_manager::Resource { public: - TestResource(const string16& title, pid_t pid) : title_(title), pid_(pid) {} - virtual string16 GetTitle() const OVERRIDE { return title_; } - virtual string16 GetProfileName() const OVERRIDE { return string16(); } + TestResource(const base::string16& title, pid_t pid) + : title_(title), pid_(pid) {} + virtual base::string16 GetTitle() const OVERRIDE { return title_; } + virtual base::string16 GetProfileName() const OVERRIDE { + return base::string16(); + } virtual gfx::ImageSkia GetIcon() const OVERRIDE { return gfx::ImageSkia(); } virtual base::ProcessHandle GetProcess() const OVERRIDE { return pid_; } virtual int GetUniqueChildProcessId() const OVERRIDE { @@ -33,8 +36,8 @@ class TestResource : public task_manager::Resource { virtual bool SupportNetworkUsage() const OVERRIDE { return false; } virtual void SetSupportNetworkUsage() OVERRIDE { NOTREACHED(); } virtual void Refresh() OVERRIDE {} - string16 title_; - string16 profile_name_; + base::string16 title_; + base::string16 profile_name_; pid_t pid_; }; diff --git a/chrome/browser/ui/cocoa/ui_localizer.mm b/chrome/browser/ui/cocoa/ui_localizer.mm index 273f3f4..139f93e 100644 --- a/chrome/browser/ui/cocoa/ui_localizer.mm +++ b/chrome/browser/ui/cocoa/ui_localizer.mm @@ -78,9 +78,9 @@ int ResourceMapCompare(const void* utf8Void, if (val) { // Do we need to build the string, or just fetch it? if (val->label_arg_id != 0) { - const string16 label_arg(l10n_util::GetStringUTF16(val->label_arg_id)); - return l10n_util::GetNSStringFWithFixup(val->label_id, - label_arg); + const base::string16 label_arg( + l10n_util::GetStringUTF16(val->label_arg_id)); + return l10n_util::GetNSStringFWithFixup(val->label_id, label_arg); } return l10n_util::GetNSStringWithFixup(val->label_id); diff --git a/chrome/browser/ui/cocoa/validation_message_bubble_controller.h b/chrome/browser/ui/cocoa/validation_message_bubble_controller.h index e010fab..7c8f78d 100644 --- a/chrome/browser/ui/cocoa/validation_message_bubble_controller.h +++ b/chrome/browser/ui/cocoa/validation_message_bubble_controller.h @@ -13,12 +13,12 @@ - (id)init:(NSWindow*)parentWindow anchoredAt:(NSPoint)anchorPoint - mainText:(const string16&)mainText - subText:(const string16&)subText; + mainText:(const base::string16&)mainText + subText:(const base::string16&)subText; // This is exposed for testing. -+ (NSView*)constructContentView:(const string16&)mainText - subText:(const string16&)subText; ++ (NSView*)constructContentView:(const base::string16&)mainText + subText:(const base::string16&)subText; @end diff --git a/chrome/browser/ui/cocoa/web_dialog_window_controller.mm b/chrome/browser/ui/cocoa/web_dialog_window_controller.mm index 4e7d2bf..d87ef92 100644 --- a/chrome/browser/ui/cocoa/web_dialog_window_controller.mm +++ b/chrome/browser/ui/cocoa/web_dialog_window_controller.mm @@ -46,7 +46,7 @@ public: // WebDialogDelegate declarations. virtual ui::ModalType GetDialogModalType() const OVERRIDE; - virtual string16 GetDialogTitle() const OVERRIDE; + virtual base::string16 GetDialogTitle() const OVERRIDE; virtual GURL GetDialogContentURL() const OVERRIDE; virtual void GetWebUIMessageHandlers( std::vector<WebUIMessageHandler*>* handlers) const OVERRIDE; @@ -151,7 +151,7 @@ ui::ModalType WebDialogWindowDelegateBridge::GetDialogModalType() const { } string16 WebDialogWindowDelegateBridge::GetDialogTitle() const { - return delegate_ ? delegate_->GetDialogTitle() : string16(); + return delegate_ ? delegate_->GetDialogTitle() : base::string16(); } GURL WebDialogWindowDelegateBridge::GetDialogContentURL() const { diff --git a/chrome/browser/ui/cocoa/web_dialog_window_controller_unittest.mm b/chrome/browser/ui/cocoa/web_dialog_window_controller_unittest.mm index c3bb0d6..be10630 100644 --- a/chrome/browser/ui/cocoa/web_dialog_window_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/web_dialog_window_controller_unittest.mm @@ -33,7 +33,7 @@ namespace { class MockDelegate : public WebDialogDelegate { public: MOCK_CONST_METHOD0(GetDialogModalType, ui::ModalType()); - MOCK_CONST_METHOD0(GetDialogTitle, string16()); + MOCK_CONST_METHOD0(GetDialogTitle, base::string16()); MOCK_CONST_METHOD0(GetDialogContentURL, GURL()); MOCK_CONST_METHOD1(GetWebUIMessageHandlers, void(std::vector<WebUIMessageHandler*>*)); @@ -56,7 +56,7 @@ class WebDialogWindowControllerTest : public BrowserWithTestWindowTest { } protected: - string16 title_; + base::string16 title_; gfx::Size size_; GURL gurl_; diff --git a/chrome/browser/ui/cocoa/website_settings_bubble_controller.h b/chrome/browser/ui/cocoa/website_settings_bubble_controller.h index 5f671e7..dcf3849 100644 --- a/chrome/browser/ui/cocoa/website_settings_bubble_controller.h +++ b/chrome/browser/ui/cocoa/website_settings_bubble_controller.h @@ -119,7 +119,7 @@ class WebsiteSettingsUIBridge : public WebsiteSettingsUI { virtual void SetPermissionInfo( const PermissionInfoList& permission_info_list) OVERRIDE; virtual void SetIdentityInfo(const IdentityInfo& identity_info) OVERRIDE; - virtual void SetFirstVisit(const string16& first_visit) OVERRIDE; + virtual void SetFirstVisit(const base::string16& first_visit) OVERRIDE; virtual void SetSelectedTab(TabId tab_id) OVERRIDE; private: diff --git a/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm index d131376..d39bb7e 100644 --- a/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm @@ -359,7 +359,7 @@ NSColor* IdentityVerifiedTextColor() { [imageView setImage:rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_26).ToNSImage()]; controlOrigin.x += NSWidth([imageView frame]) + kInternalPageImageSpacing; - string16 text = l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); + base::string16 text = l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); NSTextField* textField = [self addText:text withSize:[NSFont smallSystemFontSize] bold:NO @@ -768,7 +768,7 @@ NSColor* IdentityVerifiedTextColor() { // Create a new text field and add it to the given array of subviews. // The array will retain a reference to the object. -- (NSTextField*)addText:(const string16&)text +- (NSTextField*)addText:(const base::string16&)text withSize:(CGFloat)fontSize bold:(BOOL)bold toView:(NSView*)view @@ -893,7 +893,7 @@ NSColor* IdentityVerifiedTextColor() { // Set the button title. base::scoped_nsobject<NSMenuItem> titleItem([[NSMenuItem alloc] init]); - string16 buttonTitle = WebsiteSettingsUI::PermissionActionToUIString( + base::string16 buttonTitle = WebsiteSettingsUI::PermissionActionToUIString( permissionInfo.setting, permissionInfo.default_setting, permissionInfo.source); @@ -905,7 +905,7 @@ NSColor* IdentityVerifiedTextColor() { // Determine the largest possible size for this button. CGFloat maxTitleWidth = 0; for (NSInteger i = 0; i < [button numberOfItems]; ++i) { - string16 title = WebsiteSettingsUI::PermissionActionToUIString( + base::string16 title = WebsiteSettingsUI::PermissionActionToUIString( static_cast<ContentSetting>([[button itemAtIndex:i] tag]), permissionInfo.default_setting, content_settings::SETTING_SOURCE_USER); @@ -962,7 +962,7 @@ NSColor* IdentityVerifiedTextColor() { [imageView setImage:image]; point.x += kPermissionImageSize + kPermissionImageSpacing; - string16 labelText = + base::string16 labelText = WebsiteSettingsUI::PermissionTypeToUIString(permissionInfo.type) + ASCIIToUTF16(":"); @@ -1027,7 +1027,7 @@ NSColor* IdentityVerifiedTextColor() { [imageView setImage:image]; point.x += kPermissionImageSize + kPermissionImageSpacing; - string16 labelText = l10n_util::GetStringFUTF16( + base::string16 labelText = l10n_util::GetStringFUTF16( IDS_WEBSITE_SETTINGS_SITE_DATA_STATS_LINE, UTF8ToUTF16(cookieInfo.cookie_source), base::IntToString16(cookieInfo.allowed), @@ -1094,7 +1094,7 @@ NSColor* IdentityVerifiedTextColor() { [cookiesView_ setSubviews:[NSArray array]]; NSPoint controlOrigin = NSMakePoint(kFramePadding, 0); - string16 sectionTitle = l10n_util::GetStringUTF16( + base::string16 sectionTitle = l10n_util::GetStringUTF16( IDS_WEBSITE_SETTINGS_TITLE_SITE_DATA); NSTextField* header = [self addText:sectionTitle withSize:[NSFont smallSystemFontSize] @@ -1124,7 +1124,7 @@ NSColor* IdentityVerifiedTextColor() { [permissionsView_ setSubviews:[NSArray array]]; NSPoint controlOrigin = NSMakePoint(kFramePadding, 0); - string16 sectionTitle = l10n_util::GetStringUTF16( + base::string16 sectionTitle = l10n_util::GetStringUTF16( IDS_WEBSITE_SETTINGS_TITLE_SITE_PERMISSIONS); NSTextField* header = [self addText:sectionTitle withSize:[NSFont smallSystemFontSize] @@ -1150,7 +1150,7 @@ NSColor* IdentityVerifiedTextColor() { [self performLayout]; } -- (void)setFirstVisit:(const string16&)firstVisit { +- (void)setFirstVisit:(const base::string16&)firstVisit { [firstVisitIcon_ setImage: WebsiteSettingsUI::GetFirstVisitIcon(firstVisit).ToNSImage()]; [firstVisitDescriptionField_ setStringValue: @@ -1228,7 +1228,7 @@ void WebsiteSettingsUIBridge::SetPermissionInfo( [bubble_controller_ setPermissionInfo:permission_info_list]; } -void WebsiteSettingsUIBridge::SetFirstVisit(const string16& first_visit) { +void WebsiteSettingsUIBridge::SetFirstVisit(const base::string16& first_visit) { [bubble_controller_ setFirstVisit:first_visit]; } diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm index 23eb0b8..4ac09ad 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm +++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm @@ -79,7 +79,7 @@ class ZoomLevelObserver { void OnZoomLevelChanged(const HostZoomMap::ZoomLevelChange& change) { WrenchMenuModel* wrenchMenuModel = [controller_ wrenchMenuModel]; wrenchMenuModel->UpdateZoomControls(); - const string16 level = + const base::string16 level = wrenchMenuModel->GetLabelForCommandId(IDC_ZOOM_PERCENT_DISPLAY); [[controller_ zoomDisplay] setTitle:SysUTF16ToNSString(level)]; } @@ -170,7 +170,7 @@ class ZoomLevelObserver { } else { // Not a section header. Add a tooltip with the title and the URL. std::string url; - string16 title; + base::string16 title; if ([self recentTabsMenuModel]->GetURLAndTitleForItemAtIndex( [item tag], &url, &title)) { [menuItem setToolTip: diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm index 15547fc..29472bc 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm @@ -134,9 +134,9 @@ TEST_F(WrenchMenuControllerTest, RecentTabsElideTitle) { RecentTabsBuilderTestHelper recent_tabs_builder; recent_tabs_builder.AddSession(); recent_tabs_builder.AddWindow(0); - string16 tab1_short_title = ASCIIToUTF16("Short"); + base::string16 tab1_short_title = ASCIIToUTF16("Short"); recent_tabs_builder.AddTabWithInfo(0, 0, base::Time::Now(), tab1_short_title); - string16 tab2_long_title = ASCIIToUTF16("Very very very very very very " + base::string16 tab2_long_title = ASCIIToUTF16("Very very very very very very " "very very very very very very long"); recent_tabs_builder.AddTabWithInfo(0, 0, base::Time::Now() - base::TimeDelta::FromMinutes(10), tab2_long_title); diff --git a/chrome/browser/ui/collected_cookies_infobar_delegate.h b/chrome/browser/ui/collected_cookies_infobar_delegate.h index 2fb053a..7bed4fb 100644 --- a/chrome/browser/ui/collected_cookies_infobar_delegate.h +++ b/chrome/browser/ui/collected_cookies_infobar_delegate.h @@ -27,9 +27,9 @@ class CollectedCookiesInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual int GetIconID() const OVERRIDE; virtual Type GetInfoBarType() const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; virtual int GetButtons() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; DISALLOW_COPY_AND_ASSIGN(CollectedCookiesInfoBarDelegate); diff --git a/chrome/browser/ui/confirm_bubble_model.h b/chrome/browser/ui/confirm_bubble_model.h index c6c95c7..e5a8b59 100644 --- a/chrome/browser/ui/confirm_bubble_model.h +++ b/chrome/browser/ui/confirm_bubble_model.h @@ -29,8 +29,8 @@ class ConfirmBubbleModel { // Returns the title string and the message string to be displayed for this // bubble menu. These must not be empty strings. - virtual string16 GetTitle() const = 0; - virtual string16 GetMessageText() const = 0; + virtual base::string16 GetTitle() const = 0; + virtual base::string16 GetMessageText() const = 0; // Returns an icon for the bubble. This image should be owned by the // ResourceBundle and callers should not take ownership of it. Must not return @@ -45,7 +45,7 @@ class ConfirmBubbleModel { // Return the label for the specified button. The default implementation // returns "OK" for the OK button and "Cancel" for the Cancel button. - virtual string16 GetButtonLabel(BubbleButton button) const; + virtual base::string16 GetButtonLabel(BubbleButton button) const; // Called when the OK button is pressed. virtual void Accept(); @@ -55,7 +55,7 @@ class ConfirmBubbleModel { // Returns the text of the link to be displayed, if any. Otherwise returns // and empty string. - virtual string16 GetLinkText() const; + virtual base::string16 GetLinkText() const; // Called when the Link is clicked. virtual void LinkClicked(); diff --git a/chrome/browser/ui/external_protocol_dialog_delegate.cc b/chrome/browser/ui/external_protocol_dialog_delegate.cc index e0129c2..2badc31 100644 --- a/chrome/browser/ui/external_protocol_dialog_delegate.cc +++ b/chrome/browser/ui/external_protocol_dialog_delegate.cc @@ -28,15 +28,15 @@ string16 ExternalProtocolDialogDelegate::GetMessageText() const { // TODO(calamity): Look up the command in ExternalProtocolHandler and pass it // into the constructor. Will require simultaneous change of // ExternalProtocolHandler::RunExternalProtocolDialog across all platforms. - string16 command = + base::string16 command = UTF8ToUTF16(ShellIntegration::GetApplicationForProtocol(url())); - string16 elided_url_without_scheme; - string16 elided_command; + base::string16 elided_url_without_scheme; + base::string16 elided_command; gfx::ElideString(ASCIIToUTF16(url().possibly_invalid_spec()), kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); gfx::ElideString(command, kMaxCommandSize, &elided_command); - string16 message_text = l10n_util::GetStringFUTF16( + base::string16 message_text = l10n_util::GetStringFUTF16( IDS_EXTERNAL_PROTOCOL_INFORMATION, ASCIIToUTF16(url().scheme() + ":"), elided_url_without_scheme) + ASCIIToUTF16("\n\n"); diff --git a/chrome/browser/ui/external_protocol_dialog_delegate.h b/chrome/browser/ui/external_protocol_dialog_delegate.h index 1fccfb9..85de91e 100644 --- a/chrome/browser/ui/external_protocol_dialog_delegate.h +++ b/chrome/browser/ui/external_protocol_dialog_delegate.h @@ -21,9 +21,9 @@ class ExternalProtocolDialogDelegate : public ProtocolDialogDelegate { virtual void DoAccept(const GURL& url, bool dont_block) const OVERRIDE; virtual void DoCancel(const GURL& url, bool dont_block) const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetCheckboxText() const OVERRIDE; - virtual string16 GetTitleText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetCheckboxText() const OVERRIDE; + virtual base::string16 GetTitleText() const OVERRIDE; }; #endif // CHROME_BROWSER_UI_EXTERNAL_PROTOCOL_DIALOG_DELEGATE_H_ diff --git a/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc b/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc index dc2fffd..b2378fa 100644 --- a/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc +++ b/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc @@ -165,7 +165,7 @@ namespace libgtk2ui { AppIndicatorIcon::AppIndicatorIcon(std::string id, const gfx::ImageSkia& image, - const string16& tool_tip) + const base::string16& tool_tip) : id_(id), icon_(NULL), gtk_menu_(NULL), @@ -222,7 +222,7 @@ void AppIndicatorIcon::SetPressedImage(const gfx::ImageSkia& image) { // pressed status icons. } -void AppIndicatorIcon::SetToolTip(const string16& tool_tip) { +void AppIndicatorIcon::SetToolTip(const base::string16& tool_tip) { DCHECK(!tool_tip_.empty()); tool_tip_ = UTF16ToUTF8(tool_tip); diff --git a/chrome/browser/ui/libgtk2ui/app_indicator_icon.h b/chrome/browser/ui/libgtk2ui/app_indicator_icon.h index 8b0f0d9..99da811 100644 --- a/chrome/browser/ui/libgtk2ui/app_indicator_icon.h +++ b/chrome/browser/ui/libgtk2ui/app_indicator_icon.h @@ -29,7 +29,7 @@ class AppIndicatorIcon : public views::StatusIconLinux { // icons. AppIndicatorIcon(std::string id, const gfx::ImageSkia& image, - const string16& tool_tip); + const base::string16& tool_tip); virtual ~AppIndicatorIcon(); // Indicates whether libappindicator so could be opened. @@ -38,7 +38,7 @@ class AppIndicatorIcon : public views::StatusIconLinux { // Overridden from views::StatusIconLinux: virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE; virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE; - virtual void SetToolTip(const string16& tool_tip) OVERRIDE; + virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE; virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) OVERRIDE; virtual void RefreshPlatformContextMenu() OVERRIDE; diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc index ec8a11a..8fa7cd3 100644 --- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc +++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc @@ -475,7 +475,7 @@ bool Gtk2UI::IsStatusIconSupported() const { scoped_ptr<views::StatusIconLinux> Gtk2UI::CreateLinuxStatusIcon( const gfx::ImageSkia& image, - const string16& tool_tip) const { + const base::string16& tool_tip) const { if (AppIndicatorIcon::CouldOpen()) { ++indicators_count; return scoped_ptr<views::StatusIconLinux>(new AppIndicatorIcon( diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.h b/chrome/browser/ui/libgtk2ui/gtk2_ui.h index eaebae7..4c22f01 100644 --- a/chrome/browser/ui/libgtk2ui/gtk2_ui.h +++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.h @@ -72,7 +72,7 @@ class Gtk2UI : public views::LinuxUI { virtual bool IsStatusIconSupported() const OVERRIDE; virtual scoped_ptr<views::StatusIconLinux> CreateLinuxStatusIcon( const gfx::ImageSkia& image, - const string16& tool_tip) const OVERRIDE; + const base::string16& tool_tip) const OVERRIDE; virtual gfx::Image GetIconForContentType( const std::string& content_type, int size) const OVERRIDE; virtual void AddWindowButtonOrderObserver( diff --git a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h index 89db17c..5429fdb 100644 --- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h +++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h @@ -51,7 +51,7 @@ class SelectFileDialogImpl : public ui::SelectFileDialog { // |params| is user data we pass back via the Listener interface. virtual void SelectFileImpl( Type type, - const string16& title, + const base::string16& title, const base::FilePath& default_path, const FileTypeInfo* file_types, int file_type_index, diff --git a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc index 5778d6c..eda5b26 100644 --- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc +++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc @@ -79,7 +79,7 @@ class SelectFileDialogImplGTK : public SelectFileDialogImpl, // |params| is user data we pass back via the Listener interface. virtual void SelectFileImpl( Type type, - const string16& title, + const base::string16& title, const base::FilePath& default_path, const FileTypeInfo* file_types, int file_type_index, @@ -215,7 +215,7 @@ void SelectFileDialogImplGTK::OnWindowDestroying(aura::Window* window) { // We ignore |default_extension|. void SelectFileDialogImplGTK::SelectFileImpl( Type type, - const string16& title, + const base::string16& title, const base::FilePath& default_path, const FileTypeInfo* file_types, int file_type_index, diff --git a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc index a0178a7..db284ba 100644 --- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc +++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc @@ -56,7 +56,7 @@ class SelectFileDialogImplKDE : public SelectFileDialogImpl { // |params| is user data we pass back via the Listener interface. virtual void SelectFileImpl( Type type, - const string16& title, + const base::string16& title, const base::FilePath& default_path, const FileTypeInfo* file_types, int file_type_index, @@ -187,7 +187,7 @@ SelectFileDialogImplKDE::~SelectFileDialogImplKDE() { // We ignore |default_extension|. void SelectFileDialogImplKDE::SelectFileImpl( Type type, - const string16& title, + const base::string16& title, const base::FilePath& default_path, const FileTypeInfo* file_types, int file_type_index, diff --git a/chrome/browser/ui/pdf/open_pdf_in_reader_prompt_delegate.h b/chrome/browser/ui/pdf/open_pdf_in_reader_prompt_delegate.h index 980b70d..c39d66a 100644 --- a/chrome/browser/ui/pdf/open_pdf_in_reader_prompt_delegate.h +++ b/chrome/browser/ui/pdf/open_pdf_in_reader_prompt_delegate.h @@ -15,11 +15,11 @@ class OpenPDFInReaderPromptDelegate { public: virtual ~OpenPDFInReaderPromptDelegate() {} - virtual string16 GetMessageText() const = 0; + virtual base::string16 GetMessageText() const = 0; - virtual string16 GetAcceptButtonText() const = 0; + virtual base::string16 GetAcceptButtonText() const = 0; - virtual string16 GetCancelButtonText() const = 0; + virtual base::string16 GetCancelButtonText() const = 0; virtual bool ShouldExpire( const content::LoadCommittedDetails& details) const = 0; diff --git a/chrome/browser/ui/pdf/pdf_browsertest.cc b/chrome/browser/ui/pdf/pdf_browsertest.cc index 784741b..105feac 100644 --- a/chrome/browser/ui/pdf/pdf_browsertest.cc +++ b/chrome/browser/ui/pdf/pdf_browsertest.cc @@ -114,7 +114,7 @@ class PDFBrowserTest : public InProcessBrowserTest, // renderer code will think the second message is to go to next result, but // there are none so the plugin will assert. - string16 query = UTF8ToUTF16( + base::string16 query = UTF8ToUTF16( std::string("xyzxyz" + base::IntToString(next_dummy_search_value_++))); ASSERT_EQ(0, ui_test_utils::FindInPage( browser()->tab_strip_model()->GetActiveWebContents(), diff --git a/chrome/browser/ui/pdf/pdf_tab_helper.cc b/chrome/browser/ui/pdf/pdf_tab_helper.cc index 4785105..66336fc 100644 --- a/chrome/browser/ui/pdf/pdf_tab_helper.cc +++ b/chrome/browser/ui/pdf/pdf_tab_helper.cc @@ -96,7 +96,7 @@ void PDFTabHelper::OnUpdateContentRestrictions(int content_restrictions) { void PDFTabHelper::OnModalPromptForPasswordClosed( IPC::Message* reply_message, bool success, - const string16& actual_value) { + const base::string16& actual_value) { ChromeViewHostMsg_PDFModalPromptForPassword::WriteReplyParams( reply_message, UTF16ToUTF8(actual_value)); Send(reply_message); @@ -104,7 +104,7 @@ void PDFTabHelper::OnModalPromptForPasswordClosed( void PDFTabHelper::OnModalPromptForPassword(const std::string& prompt, IPC::Message* reply_message) { - base::Callback<void(bool, const string16&)> callback = + base::Callback<void(bool, const base::string16&)> callback = base::Bind(&PDFTabHelper::OnModalPromptForPasswordClosed, base::Unretained(this), reply_message); #if !defined(TOOLKIT_GTK) diff --git a/chrome/browser/ui/pdf/pdf_tab_helper.h b/chrome/browser/ui/pdf/pdf_tab_helper.h index 6b7809b..04ae744 100644 --- a/chrome/browser/ui/pdf/pdf_tab_helper.h +++ b/chrome/browser/ui/pdf/pdf_tab_helper.h @@ -45,7 +45,7 @@ class PDFTabHelper : public content::WebContentsObserver, void UpdateLocationBar(); void OnModalPromptForPasswordClosed(IPC::Message* reply_message, bool success, - const string16& actual_value); + const base::string16& actual_value); // Message handlers. void OnHasUnsupportedFeature(); diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc index f31fc5b..924d882 100644 --- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc +++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc @@ -70,9 +70,9 @@ class PDFEnableAdobeReaderPromptDelegate virtual ~PDFEnableAdobeReaderPromptDelegate(); // OpenPDFInReaderPromptDelegate - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetAcceptButtonText() const OVERRIDE; - virtual string16 GetCancelButtonText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetAcceptButtonText() const OVERRIDE; + virtual base::string16 GetCancelButtonText() const OVERRIDE; virtual bool ShouldExpire( const content::LoadCommittedDetails& details) const OVERRIDE; virtual void Accept() OVERRIDE; @@ -251,9 +251,9 @@ class PDFUnsupportedFeaturePromptDelegate virtual ~PDFUnsupportedFeaturePromptDelegate(); // OpenPDFInReaderPromptDelegate: - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetAcceptButtonText() const OVERRIDE; - virtual string16 GetCancelButtonText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetAcceptButtonText() const OVERRIDE; + virtual base::string16 GetCancelButtonText() const OVERRIDE; virtual bool ShouldExpire( const content::LoadCommittedDetails& details) const OVERRIDE; virtual void Accept() OVERRIDE; diff --git a/chrome/browser/ui/search_engines/edit_search_engine_controller.cc b/chrome/browser/ui/search_engines/edit_search_engine_controller.cc index 096ed4c..287d5e2 100644 --- a/chrome/browser/ui/search_engines/edit_search_engine_controller.cc +++ b/chrome/browser/ui/search_engines/edit_search_engine_controller.cc @@ -27,7 +27,7 @@ EditSearchEngineController::EditSearchEngineController( } bool EditSearchEngineController::IsTitleValid( - const string16& title_input) const { + const base::string16& title_input) const { return !CollapseWhitespace(title_input, true).empty(); } @@ -62,8 +62,8 @@ bool EditSearchEngineController::IsURLValid( } bool EditSearchEngineController::IsKeywordValid( - const string16& keyword_input) const { - string16 keyword_input_trimmed(CollapseWhitespace(keyword_input, true)); + const base::string16& keyword_input) const { + base::string16 keyword_input_trimmed(CollapseWhitespace(keyword_input, true)); if (keyword_input_trimmed.empty()) return false; // Do not allow empty keyword. const TemplateURL* turl_with_keyword = @@ -73,8 +73,8 @@ bool EditSearchEngineController::IsKeywordValid( } void EditSearchEngineController::AcceptAddOrEdit( - const string16& title_input, - const string16& keyword_input, + const base::string16& title_input, + const base::string16& keyword_input, const std::string& url_input) { DCHECK(!keyword_input.empty()); std::string url_string = GetFixedUpURL(url_input); diff --git a/chrome/browser/ui/search_engines/edit_search_engine_controller.h b/chrome/browser/ui/search_engines/edit_search_engine_controller.h index 9835528..278b344 100644 --- a/chrome/browser/ui/search_engines/edit_search_engine_controller.h +++ b/chrome/browser/ui/search_engines/edit_search_engine_controller.h @@ -21,8 +21,8 @@ class EditSearchEngineControllerDelegate { // indicates a new TemplateURL should be created rather than modifying an // existing TemplateURL. virtual void OnEditedKeyword(TemplateURL* template_url, - const string16& title, - const string16& keyword, + const base::string16& title, + const base::string16& keyword, const std::string& url) = 0; protected: @@ -41,7 +41,7 @@ class EditSearchEngineController { ~EditSearchEngineController() {} // Returns true if the value of |title_input| is a valid search engine name. - bool IsTitleValid(const string16& title_input) const; + bool IsTitleValid(const base::string16& title_input) const; // Returns true if the value of |url_input| represents a valid search engine // URL. The URL is valid if it contains no search terms and is a valid @@ -52,11 +52,11 @@ class EditSearchEngineController { // Returns true if the value of |keyword_input| represents a valid keyword. // The keyword is valid if it is non-empty and does not conflict with an // existing entry. NOTE: this is just the keyword, not the title and url. - bool IsKeywordValid(const string16& keyword_input) const; + bool IsKeywordValid(const base::string16& keyword_input) const; // Completes the add or edit of a search engine. - void AcceptAddOrEdit(const string16& title_input, - const string16& keyword_input, + void AcceptAddOrEdit(const base::string16& title_input, + const base::string16& keyword_input, const std::string& url_input); // Deletes an unused TemplateURL, if its add was cancelled and it's not diff --git a/chrome/browser/ui/search_engines/keyword_editor_controller.cc b/chrome/browser/ui/search_engines/keyword_editor_controller.cc index 57630ee..a5cfdf4 100644 --- a/chrome/browser/ui/search_engines/keyword_editor_controller.cc +++ b/chrome/browser/ui/search_engines/keyword_editor_controller.cc @@ -32,8 +32,8 @@ void KeywordEditorController::RegisterPrefs(PrefRegistrySimple* registry) { registry->RegisterDictionaryPref(prefs::kKeywordEditorWindowPlacement); } -int KeywordEditorController::AddTemplateURL(const string16& title, - const string16& keyword, +int KeywordEditorController::AddTemplateURL(const base::string16& title, + const base::string16& keyword, const std::string& url) { DCHECK(!url.empty()); @@ -46,8 +46,8 @@ int KeywordEditorController::AddTemplateURL(const string16& title, } void KeywordEditorController::ModifyTemplateURL(TemplateURL* template_url, - const string16& title, - const string16& keyword, + const base::string16& title, + const base::string16& keyword, const std::string& url) { DCHECK(!url.empty()); const int index = table_model_->IndexOfTemplateURL(template_url); diff --git a/chrome/browser/ui/search_engines/keyword_editor_controller.h b/chrome/browser/ui/search_engines/keyword_editor_controller.h index a6877ae..656f8f8 100644 --- a/chrome/browser/ui/search_engines/keyword_editor_controller.h +++ b/chrome/browser/ui/search_engines/keyword_editor_controller.h @@ -27,15 +27,15 @@ class KeywordEditorController { // Invoked when the user succesfully fills out the add keyword dialog. // Propagates the change to the TemplateURLService and updates the table // model. Returns the index of the added URL. - int AddTemplateURL(const string16& title, - const string16& keyword, + int AddTemplateURL(const base::string16& title, + const base::string16& keyword, const std::string& url); // Invoked when the user modifies a TemplateURL. Updates the // TemplateURLService and table model appropriately. void ModifyTemplateURL(TemplateURL* template_url, - const string16& title, - const string16& keyword, + const base::string16& title, + const base::string16& keyword, const std::string& url); // Return true if the given |url| can be edited. diff --git a/chrome/browser/ui/search_engines/keyword_editor_controller_unittest.cc b/chrome/browser/ui/search_engines/keyword_editor_controller_unittest.cc index d967269..d4d293c 100644 --- a/chrome/browser/ui/search_engines/keyword_editor_controller_unittest.cc +++ b/chrome/browser/ui/search_engines/keyword_editor_controller_unittest.cc @@ -19,10 +19,10 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/models/table_model_observer.h" -static const string16 kA(ASCIIToUTF16("a")); -static const string16 kA1(ASCIIToUTF16("a1")); -static const string16 kB(ASCIIToUTF16("b")); -static const string16 kB1(ASCIIToUTF16("b1")); +static const base::string16 kA(ASCIIToUTF16("a")); +static const base::string16 kA1(ASCIIToUTF16("a1")); +static const base::string16 kB(ASCIIToUTF16("b")); +static const base::string16 kB1(ASCIIToUTF16("b1")); // Base class for keyword editor tests. Creates a profile containing an // empty TemplateURLService. diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc index dada154..736dcda 100644 --- a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc +++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc @@ -37,7 +37,7 @@ string16 GenerateKeywordFromNavigationEntry(const NavigationEntry* entry) { // Don't autogenerate keywords for pages that are the result of form // submissions. if (IsFormSubmit(entry)) - return string16(); + return base::string16(); // We want to use the user typed URL if available since that represents what // the user typed to get here, and fall back on the regular URL if not. @@ -45,7 +45,7 @@ string16 GenerateKeywordFromNavigationEntry(const NavigationEntry* entry) { if (!url.is_valid()) { url = entry->GetURL(); if (!url.is_valid()) - return string16(); + return base::string16(); } // Don't autogenerate keywords for referrers that are anything other than HTTP @@ -55,7 +55,7 @@ string16 GenerateKeywordFromNavigationEntry(const NavigationEntry* entry) { // elements and update AutocompletePopup to look for keywords using the path. // See http://b/issue?id=863583. if (!url.SchemeIs(content::kHttpScheme) || (url.path().length() > 1)) - return string16(); + return base::string16(); return TemplateURLService::GenerateKeyword(url); } @@ -122,7 +122,7 @@ void SearchEngineTabHelper::OnPageHasOSDD( // Autogenerate a keyword for the autodetected case; in the other cases we'll // generate a keyword later after fetching the OSDD. - string16 keyword; + base::string16 keyword; if (provider_type == TemplateURLFetcher::AUTODETECTED_PROVIDER) { keyword = GenerateKeywordFromNavigationEntry(entry); if (keyword.empty()) @@ -155,7 +155,7 @@ void SearchEngineTabHelper::GenerateKeywordIfNecessary( if (last_index <= 0) return; - string16 keyword(GenerateKeywordFromNavigationEntry( + base::string16 keyword(GenerateKeywordFromNavigationEntry( controller.GetEntryAtIndex(last_index - 1))); if (keyword.empty()) return; diff --git a/chrome/browser/ui/search_engines/template_url_table_model.cc b/chrome/browser/ui/search_engines/template_url_table_model.cc index dffbc50..c0d45a3 100644 --- a/chrome/browser/ui/search_engines/template_url_table_model.cc +++ b/chrome/browser/ui/search_engines/template_url_table_model.cc @@ -187,7 +187,7 @@ string16 TemplateURLTableModel::GetText(int row, int col_id) { DCHECK(row >= 0 && row < RowCount()); const TemplateURL* url = entries_[row]->template_url(); if (col_id == IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN) { - string16 url_short_name = url->short_name(); + base::string16 url_short_name = url->short_name(); // TODO(xji): Consider adding a special case if the short name is a URL, // since those should always be displayed LTR. Please refer to // http://crbug.com/6726 for more information. @@ -261,8 +261,8 @@ void TemplateURLTableModel::Remove(int index) { } void TemplateURLTableModel::Add(int index, - const string16& short_name, - const string16& keyword, + const base::string16& short_name, + const base::string16& keyword, const std::string& url) { DCHECK(index >= 0 && index <= RowCount()); DCHECK(!url.empty()); @@ -279,8 +279,8 @@ void TemplateURLTableModel::Add(int index, } void TemplateURLTableModel::ModifyTemplateURL(int index, - const string16& title, - const string16& keyword, + const base::string16& title, + const base::string16& keyword, const std::string& url) { DCHECK(index >= 0 && index <= RowCount()); DCHECK(!url.empty()); diff --git a/chrome/browser/ui/search_engines/template_url_table_model.h b/chrome/browser/ui/search_engines/template_url_table_model.h index 864b48c..07a075a9 100644 --- a/chrome/browser/ui/search_engines/template_url_table_model.h +++ b/chrome/browser/ui/search_engines/template_url_table_model.h @@ -47,7 +47,7 @@ class TemplateURLTableModel : public ui::TableModel, // ui::TableModel overrides. virtual int RowCount() OVERRIDE; - virtual string16 GetText(int row, int column) OVERRIDE; + virtual base::string16 GetText(int row, int column) OVERRIDE; virtual gfx::ImageSkia GetIcon(int row) OVERRIDE; virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; virtual bool HasGroups() OVERRIDE; @@ -59,14 +59,14 @@ class TemplateURLTableModel : public ui::TableModel, // Adds a new entry at the specified index. void Add(int index, - const string16& short_name, - const string16& keyword, + const base::string16& short_name, + const base::string16& keyword, const std::string& url); // Update the entry at the specified index. void ModifyTemplateURL(int index, - const string16& title, - const string16& keyword, + const base::string16& title, + const base::string16& keyword, const std::string& url); // Reloads the icon at the specified index. diff --git a/chrome/browser/ui/simple_message_box.h b/chrome/browser/ui/simple_message_box.h index 5ce59e6..c289379 100644 --- a/chrome/browser/ui/simple_message_box.h +++ b/chrome/browser/ui/simple_message_box.h @@ -31,8 +31,8 @@ enum MessageBoxType { // We have a variety of other surfaces such as wrench menu notifications and // infobars; consult the UI leads for a recommendation. MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, - const string16& title, - const string16& message, + const base::string16& title, + const base::string16& message, MessageBoxType type); // Shows a dialog box with the given |title| and |message|, and with two buttons @@ -43,10 +43,10 @@ MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, // We have a variety of other surfaces such as wrench menu notifications and // infobars; consult the UI leads for a recommendation. MessageBoxResult ShowMessageBoxWithButtonText(gfx::NativeWindow parent, - const string16& title, - const string16& message, - const string16& yes_text, - const string16& no_text); + const base::string16& title, + const base::string16& message, + const base::string16& yes_text, + const base::string16& no_text); } // namespace chrome diff --git a/chrome/browser/ui/startup/autolaunch_prompt_win.cc b/chrome/browser/ui/startup/autolaunch_prompt_win.cc index c10eab7..da35243 100644 --- a/chrome/browser/ui/startup/autolaunch_prompt_win.cc +++ b/chrome/browser/ui/startup/autolaunch_prompt_win.cc @@ -49,8 +49,8 @@ class AutolaunchInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual int GetIconID() const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; virtual bool ShouldExpireInternal( diff --git a/chrome/browser/ui/startup/default_browser_prompt.cc b/chrome/browser/ui/startup/default_browser_prompt.cc index e24fe2c..99ea6e2 100644 --- a/chrome/browser/ui/startup/default_browser_prompt.cc +++ b/chrome/browser/ui/startup/default_browser_prompt.cc @@ -74,8 +74,8 @@ class DefaultBrowserInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual int GetIconID() const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool NeedElevation(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; diff --git a/chrome/browser/ui/startup/google_api_keys_infobar_delegate.h b/chrome/browser/ui/startup/google_api_keys_infobar_delegate.h index c949761..23bfb1e 100644 --- a/chrome/browser/ui/startup/google_api_keys_infobar_delegate.h +++ b/chrome/browser/ui/startup/google_api_keys_infobar_delegate.h @@ -23,9 +23,9 @@ class GoogleApiKeysInfoBarDelegate : public ConfirmInfoBarDelegate { GoogleApiKeysInfoBarDelegate(); virtual ~GoogleApiKeysInfoBarDelegate(); - virtual string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; virtual int GetButtons() const OVERRIDE; - virtual string16 GetLinkText() const OVERRIDE; + virtual base::string16 GetLinkText() const OVERRIDE; virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(GoogleApiKeysInfoBarDelegate); diff --git a/chrome/browser/ui/startup/obsolete_os_infobar_delegate.h b/chrome/browser/ui/startup/obsolete_os_infobar_delegate.h index 3e0eec5..727716a 100644 --- a/chrome/browser/ui/startup/obsolete_os_infobar_delegate.h +++ b/chrome/browser/ui/startup/obsolete_os_infobar_delegate.h @@ -24,9 +24,9 @@ class ObsoleteOSInfoBarDelegate : public ConfirmInfoBarDelegate { ObsoleteOSInfoBarDelegate(); virtual ~ObsoleteOSInfoBarDelegate(); - virtual string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; virtual int GetButtons() const OVERRIDE; - virtual string16 GetLinkText() const OVERRIDE; + virtual base::string16 GetLinkText() const OVERRIDE; virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ObsoleteOSInfoBarDelegate); diff --git a/chrome/browser/ui/startup/session_crashed_infobar_delegate.h b/chrome/browser/ui/startup/session_crashed_infobar_delegate.h index 260a320..1437709 100644 --- a/chrome/browser/ui/startup/session_crashed_infobar_delegate.h +++ b/chrome/browser/ui/startup/session_crashed_infobar_delegate.h @@ -23,9 +23,9 @@ class SessionCrashedInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual int GetIconID() const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; virtual int GetButtons() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; bool accepted_; diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc index edb7d02..42bd266 100644 --- a/chrome/browser/ui/startup/startup_browser_creator.cc +++ b/chrome/browser/ui/startup/startup_browser_creator.cc @@ -783,7 +783,7 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( if (!profile) { profile_manager->CreateProfileAsync(profile_path, base::Bind(&StartupBrowserCreator::ProcessCommandLineOnProfileCreated, - command_line, cur_dir), string16(), string16(), + command_line, cur_dir), base::string16(), base::string16(), std::string()); return; } diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc index b6b9833..bf21acc 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc @@ -140,9 +140,9 @@ LaunchMode GetLaunchShortcutKind() { if (si.dwFlags & 0x800) { if (!si.lpTitle) return LM_SHORTCUT_NONAME; - string16 shortcut(si.lpTitle); + base::string16 shortcut(si.lpTitle); // The windows quick launch path is not localized. - if (shortcut.find(L"\\Quick Launch\\") != string16::npos) { + if (shortcut.find(L"\\Quick Launch\\") != base::string16::npos) { if (base::win::GetVersion() >= base::win::VERSION_WIN7) return LM_SHORTCUT_TASKBAR; else diff --git a/chrome/browser/ui/startup/startup_browser_creator_win.cc b/chrome/browser/ui/startup/startup_browser_creator_win.cc index a53e900..f946e77 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_win.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_win.cc @@ -16,7 +16,7 @@ namespace chrome { GURL GetURLToOpen(Profile* profile) { - string16 params; + base::string16 params; base::win::MetroLaunchType launch_type = base::win::GetMetroLaunchParams(¶ms); if ((launch_type == base::win::METRO_PROTOCOL) || diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.cc b/chrome/browser/ui/tab_contents/core_tab_helper.cc index e0d59bf..e8c165e 100644 --- a/chrome/browser/ui/tab_contents/core_tab_helper.cc +++ b/chrome/browser/ui/tab_contents/core_tab_helper.cc @@ -51,7 +51,7 @@ string16 CoreTabHelper::GetDefaultTitle() { string16 CoreTabHelper::GetStatusText() const { if (!web_contents()->IsLoading() || web_contents()->GetLoadState().state == net::LOAD_STATE_IDLE) { - return string16(); + return base::string16(); } switch (web_contents()->GetLoadState().state) { @@ -104,7 +104,7 @@ string16 CoreTabHelper::GetStatusText() const { break; } - return string16(); + return base::string16(); } void CoreTabHelper::OnCloseStarted() { diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.h b/chrome/browser/ui/tab_contents/core_tab_helper.h index 767c1fe..a5ca820 100644 --- a/chrome/browser/ui/tab_contents/core_tab_helper.h +++ b/chrome/browser/ui/tab_contents/core_tab_helper.h @@ -18,10 +18,10 @@ class CoreTabHelper : public content::WebContentsObserver, virtual ~CoreTabHelper(); // Initial title assigned to NavigationEntries from Navigate. - static string16 GetDefaultTitle(); + static base::string16 GetDefaultTitle(); // Returns a human-readable description the tab's loading state. - string16 GetStatusText() const; + base::string16 GetStatusText() const; // Notification that tab closing has started. This can be called multiple // times, subsequent calls are ignored. diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc b/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc index 148b816..5e0c2ba 100644 --- a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc +++ b/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc @@ -27,11 +27,11 @@ MockTabModalConfirmDialogDelegate::~MockTabModalConfirmDialogDelegate() { } string16 MockTabModalConfirmDialogDelegate::GetTitle() { - return string16(); + return base::string16(); } string16 MockTabModalConfirmDialogDelegate::GetMessage() { - return string16(); + return base::string16(); } void MockTabModalConfirmDialogDelegate::OnAccepted() { diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h b/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h index a45e3d1..93d72b4 100644 --- a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h +++ b/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h @@ -26,8 +26,8 @@ class MockTabModalConfirmDialogDelegate : public TabModalConfirmDialogDelegate { Delegate* delegate); virtual ~MockTabModalConfirmDialogDelegate(); - virtual string16 GetTitle() OVERRIDE; - virtual string16 GetMessage() OVERRIDE; + virtual base::string16 GetTitle() OVERRIDE; + virtual base::string16 GetMessage() OVERRIDE; virtual void OnAccepted() OVERRIDE; virtual void OnCanceled() OVERRIDE; diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc index db4efe2..f3f702e 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc @@ -97,20 +97,20 @@ string16 BackForwardMenuModel::GetLabelAt(int index) const { // Return an empty string for a separator. if (IsSeparator(index)) - return string16(); + return base::string16(); // Return the entry title, escaping any '&' characters and eliding it if it's // super long. NavigationEntry* entry = GetNavigationEntry(index); Profile* profile = Profile::FromBrowserContext(GetWebContents()->GetBrowserContext()); - string16 menu_text(entry->GetTitleForDisplay( + base::string16 menu_text(entry->GetTitleForDisplay( profile->GetPrefs()->GetString(prefs::kAcceptLanguages))); menu_text = gfx::ElideText(menu_text, gfx::Font(), kMaxWidth, gfx::ELIDE_AT_END); #if !defined(OS_MACOSX) - for (size_t i = menu_text.find('&'); i != string16::npos; + for (size_t i = menu_text.find('&'); i != base::string16::npos; i = menu_text.find('&', i + 2)) { menu_text.insert(i, 1, '&'); } diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.h b/chrome/browser/ui/toolbar/back_forward_menu_model.h index be08f00..41cecd1 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.h +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.h @@ -60,7 +60,7 @@ class BackForwardMenuModel : public ui::MenuModel { virtual ItemType GetTypeAt(int index) const OVERRIDE; virtual ui::MenuSeparatorType GetSeparatorTypeAt(int index) const OVERRIDE; virtual int GetCommandIdAt(int index) const OVERRIDE; - virtual string16 GetLabelAt(int index) const OVERRIDE; + virtual base::string16 GetLabelAt(int index) const OVERRIDE; virtual bool IsItemDynamicAt(int index) const OVERRIDE; virtual bool GetAcceleratorAt(int index, ui::Accelerator* accelerator) const OVERRIDE; @@ -173,7 +173,7 @@ class BackForwardMenuModel : public ui::MenuModel { bool ItemHasIcon(int index) const; // Allow the unit test to use the "Show Full History" label. - string16 GetShowFullHistoryLabel() const; + base::string16 GetShowFullHistoryLabel() const; // Looks up a NavigationEntry by menu id. content::NavigationEntry* GetNavigationEntry(int index) const; diff --git a/chrome/browser/ui/toolbar/encoding_menu_controller.cc b/chrome/browser/ui/toolbar/encoding_menu_controller.cc index ddaedb7..789abbb 100644 --- a/chrome/browser/ui/toolbar/encoding_menu_controller.cc +++ b/chrome/browser/ui/toolbar/encoding_menu_controller.cc @@ -105,7 +105,7 @@ void EncodingMenuController::GetEncodingMenuItems(Profile* profile, EncodingMenuItemList* menu_items) { DCHECK(menu_items); - EncodingMenuItem separator(0, string16()); + EncodingMenuItem separator(0, base::string16()); menu_items->clear(); menu_items->push_back( @@ -130,7 +130,7 @@ void EncodingMenuController::GetEncodingMenuItems(Profile* profile, std::vector<CharacterEncoding::EncodingInfo>::const_iterator it; for (it = encodings->begin(); it != encodings->end(); ++it) { if (it->encoding_id) { - string16 encoding = it->encoding_display_name; + base::string16 encoding = it->encoding_display_name; base::i18n::AdjustStringForLocaleDirection(&encoding); menu_items->push_back(EncodingMenuItem(it->encoding_id, encoding)); } else { diff --git a/chrome/browser/ui/toolbar/encoding_menu_controller.h b/chrome/browser/ui/toolbar/encoding_menu_controller.h index 9be4ed4..ea4563a 100644 --- a/chrome/browser/ui/toolbar/encoding_menu_controller.h +++ b/chrome/browser/ui/toolbar/encoding_menu_controller.h @@ -22,7 +22,7 @@ class EncodingMenuController { FRIEND_TEST_ALL_PREFIXES(EncodingMenuControllerTest, IsItemChecked); public: - typedef std::pair<int, string16> EncodingMenuItem; + typedef std::pair<int, base::string16> EncodingMenuItem; typedef std::vector<EncodingMenuItem> EncodingMenuItemList; public: diff --git a/chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.cc b/chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.cc index 1fa9d5c..9c40eab 100644 --- a/chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.cc +++ b/chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.cc @@ -20,7 +20,7 @@ const char kBaseTabUrl[] = "http://foo/?"; const char kTabTitleFormat[] = "session=%d;window=%d;tab=%d"; struct TitleTimestampPair { - string16 title; + base::string16 title; base::Time timestamp; }; @@ -61,7 +61,7 @@ struct RecentTabsBuilderTestHelper::TabInfo { TabInfo() : id(0) {} SessionID::id_type id; base::Time timestamp; - string16 title; + base::string16 title; }; struct RecentTabsBuilderTestHelper::WindowInfo { WindowInfo() : id(0) {} @@ -131,13 +131,13 @@ SessionID::id_type RecentTabsBuilderTestHelper::GetWindowID(int session_index, void RecentTabsBuilderTestHelper::AddTab(int session_index, int window_index) { base::Time timestamp = start_time_ + base::TimeDelta::FromMinutes(base::RandUint64()); - AddTabWithInfo(session_index, window_index, timestamp, string16()); + AddTabWithInfo(session_index, window_index, timestamp, base::string16()); } void RecentTabsBuilderTestHelper::AddTabWithInfo(int session_index, int window_index, base::Time timestamp, - const string16& title) { + const base::string16& title) { TabInfo tab_info; tab_info.id = CreateUniqueID(); tab_info.timestamp = timestamp; @@ -166,7 +166,7 @@ base::Time RecentTabsBuilderTestHelper::GetTabTimestamp(int session_index, string16 RecentTabsBuilderTestHelper::GetTabTitle(int session_index, int window_index, int tab_index) { - string16 title = + base::string16 title = sessions_[session_index].windows[window_index].tabs[tab_index].title; if (title.empty()) { title = UTF8ToUTF16(ToTabTitle( diff --git a/chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.h b/chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.h index ac7492b..4d5727c 100644 --- a/chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.h +++ b/chrome/browser/ui/toolbar/recent_tabs_builder_test_helper.h @@ -37,7 +37,7 @@ class RecentTabsBuilderTestHelper { void AddTabWithInfo(int session_index, int window_index, base::Time timestamp, - const string16& title); + const base::string16& title); int GetTabCount(int session_index, int window_index); SessionID::id_type GetTabID(int session_index, int window_index, @@ -45,7 +45,7 @@ class RecentTabsBuilderTestHelper { base::Time GetTabTimestamp(int session_index, int window_index, int tab_index); - string16 GetTabTitle(int session_index, + base::string16 GetTabTitle(int session_index, int window_index, int tab_index); diff --git a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc index 702275f..88ab1a4 100644 --- a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc +++ b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc @@ -142,7 +142,7 @@ struct RecentTabsSubMenuModel::TabNavigationItem { TabNavigationItem(const std::string& session_tag, const SessionID::id_type& tab_id, - const string16& title, + const base::string16& title, const GURL& url) : session_tag(session_tag), tab_id(tab_id), @@ -157,7 +157,7 @@ struct RecentTabsSubMenuModel::TabNavigationItem { // Empty for local tabs, non-empty for other devices' tabs. std::string session_tag; SessionID::id_type tab_id; // -1 for invalid, >= 0 otherwise. - string16 title; + base::string16 title; GURL url; }; @@ -333,9 +333,10 @@ int RecentTabsSubMenuModel::GetMaxWidthForItemAtIndex(int item_index) const { return 320; } -bool RecentTabsSubMenuModel::GetURLAndTitleForItemAtIndex(int index, - std::string* url, - string16* title) { +bool RecentTabsSubMenuModel::GetURLAndTitleForItemAtIndex( + int index, + std::string* url, + base::string16* title) { int command_id = GetCommandIdAt(index); if (IsTabModelCommandId(command_id)) { TabNavigationItems* tab_items = NULL; @@ -498,7 +499,7 @@ void RecentTabsSubMenuModel::BuildTabsFromOtherDevices() { } void RecentTabsSubMenuModel::BuildLocalTabItem(int session_id, - const string16& title, + const base::string16& title, const GURL& url, int curr_model_index) { TabNavigationItem item(std::string(), session_id, title, url); diff --git a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h index ad175ad..b4c102c 100644 --- a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h +++ b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h @@ -66,7 +66,7 @@ class RecentTabsSubMenuModel : public ui::SimpleMenuModel, int GetMaxWidthForItemAtIndex(int item_index) const; bool GetURLAndTitleForItemAtIndex(int index, std::string* url, - string16* title); + base::string16* title); private: struct TabNavigationItem; @@ -86,7 +86,7 @@ class RecentTabsSubMenuModel : public ui::SimpleMenuModel, // Build a recently closed tab item with parameters needed to restore it, and // add it to the menumodel at |curr_model_index|. void BuildLocalTabItem(int seesion_id, - const string16& title, + const base::string16& title, const GURL& url, int curr_model_index); diff --git a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc index 366bbfa..97b27ae 100644 --- a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc +++ b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc @@ -146,7 +146,7 @@ TEST_F(RecentTabsSubMenuModelTest, NoTabs) { EXPECT_EQ(NULL, model.GetLabelFontAt(2)); std::string url; - string16 title; + base::string16 title; EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(0, &url, &title)); EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(1, &url, &title)); EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(2, &url, &title)); @@ -189,7 +189,7 @@ TEST_F(RecentTabsSubMenuModelTest, RecentlyClosedTabsFromCurrentSession) { EXPECT_EQ(NULL, model.GetLabelFontAt(4)); std::string url; - string16 title; + base::string16 title; EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(0, &url, &title)); EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(1, &url, &title)); EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(2, &url, &title)); @@ -300,7 +300,7 @@ TEST_F(RecentTabsSubMenuModelTest, EXPECT_EQ(NULL, model.GetLabelFontAt(5)); std::string url; - string16 title; + base::string16 title; EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(0, &url, &title)); EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(1, &url, &title)); EXPECT_TRUE(model.GetURLAndTitleForItemAtIndex(2, &url, &title)); @@ -323,7 +323,7 @@ TEST_F(RecentTabsSubMenuModelTest, OtherDevices) { recent_tabs_builder.AddWindow(0); for (int i = 0; i < 3; ++i) { timestamp -= time_delta; - recent_tabs_builder.AddTabWithInfo(0, 0, timestamp, string16()); + recent_tabs_builder.AddTabWithInfo(0, 0, timestamp, base::string16()); } // Create 2nd session : 2 windows, 1 tab in 1st window, 2 tabs in 2nd window @@ -331,11 +331,11 @@ TEST_F(RecentTabsSubMenuModelTest, OtherDevices) { recent_tabs_builder.AddWindow(1); recent_tabs_builder.AddWindow(1); timestamp -= time_delta; - recent_tabs_builder.AddTabWithInfo(1, 0, timestamp, string16()); + recent_tabs_builder.AddTabWithInfo(1, 0, timestamp, base::string16()); timestamp -= time_delta; - recent_tabs_builder.AddTabWithInfo(1, 1, timestamp, string16()); + recent_tabs_builder.AddTabWithInfo(1, 1, timestamp, base::string16()); timestamp -= time_delta; - recent_tabs_builder.AddTabWithInfo(1, 1, timestamp, string16()); + recent_tabs_builder.AddTabWithInfo(1, 1, timestamp, base::string16()); recent_tabs_builder.RegisterRecentTabs(&associator_); @@ -391,7 +391,7 @@ TEST_F(RecentTabsSubMenuModelTest, OtherDevices) { EXPECT_EQ(NULL, model.GetLabelFontAt(12)); std::string url; - string16 title; + base::string16 title; EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(0, &url, &title)); EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(1, &url, &title)); EXPECT_FALSE(model.GetURLAndTitleForItemAtIndex(2, &url, &title)); diff --git a/chrome/browser/ui/toolbar/test_toolbar_model.cc b/chrome/browser/ui/toolbar/test_toolbar_model.cc index d1d558c..67a1756 100644 --- a/chrome/browser/ui/toolbar/test_toolbar_model.cc +++ b/chrome/browser/ui/toolbar/test_toolbar_model.cc @@ -20,7 +20,7 @@ string16 TestToolbarModel::GetText() const { } string16 TestToolbarModel::GetCorpusNameForMobile() const { - return string16(); + return base::string16(); } GURL TestToolbarModel::GetURL() const { diff --git a/chrome/browser/ui/toolbar/test_toolbar_model.h b/chrome/browser/ui/toolbar/test_toolbar_model.h index 79887c5..40261e2 100644 --- a/chrome/browser/ui/toolbar/test_toolbar_model.h +++ b/chrome/browser/ui/toolbar/test_toolbar_model.h @@ -16,17 +16,17 @@ class TestToolbarModel : public ToolbarModel { public: TestToolbarModel(); virtual ~TestToolbarModel(); - virtual string16 GetText() const OVERRIDE; - virtual string16 GetCorpusNameForMobile() const OVERRIDE; + virtual base::string16 GetText() const OVERRIDE; + virtual base::string16 GetCorpusNameForMobile() const OVERRIDE; virtual GURL GetURL() const OVERRIDE; virtual bool WouldPerformSearchTermReplacement( bool ignore_editing) const OVERRIDE; virtual SecurityLevel GetSecurityLevel(bool ignore_editing) const OVERRIDE; virtual int GetIcon() const OVERRIDE; - virtual string16 GetEVCertName() const OVERRIDE; + virtual base::string16 GetEVCertName() const OVERRIDE; virtual bool ShouldDisplayURL() const OVERRIDE; - void set_text(const string16& text) { text_ = text; } + void set_text(const base::string16& text) { text_ = text; } void set_url(const GURL& url) { url_ = url;} void set_replace_search_url_with_search_terms(bool should_replace_url) { should_replace_url_ = should_replace_url; @@ -35,7 +35,7 @@ class TestToolbarModel : public ToolbarModel { security_level_ = security_level; } void set_icon(int icon) { icon_ = icon; } - void set_ev_cert_name(const string16& ev_cert_name) { + void set_ev_cert_name(const base::string16& ev_cert_name) { ev_cert_name_ = ev_cert_name; } void set_should_display_url(bool should_display_url) { @@ -43,12 +43,12 @@ class TestToolbarModel : public ToolbarModel { } private: - string16 text_; + base::string16 text_; GURL url_; bool should_replace_url_; SecurityLevel security_level_; int icon_; - string16 ev_cert_name_; + base::string16 ev_cert_name_; bool should_display_url_; DISALLOW_COPY_AND_ASSIGN(TestToolbarModel); diff --git a/chrome/browser/ui/toolbar/toolbar_model.h b/chrome/browser/ui/toolbar/toolbar_model.h index 949764f..f815a53 100644 --- a/chrome/browser/ui/toolbar/toolbar_model.h +++ b/chrome/browser/ui/toolbar/toolbar_model.h @@ -37,14 +37,14 @@ class ToolbarModel { // - The scheme and/or trailing slash may be dropped. // - If the current page's URL is a search URL for the user's default search // engine, the query will be extracted and returned. - virtual string16 GetText() const = 0; + virtual base::string16 GetText() const = 0; // Some search URLs bundle a special "corpus" param that we can extract and // display next to users' search terms in cases where we'd show the search // terms instead of the URL anyway. For example, a Google image search might // show the corpus "Images:" plus a search string. This is only used on // mobile. - virtual string16 GetCorpusNameForMobile() const = 0; + virtual base::string16 GetCorpusNameForMobile() const = 0; // Returns the URL of the current navigation entry. virtual GURL GetURL() const = 0; @@ -68,7 +68,7 @@ class ToolbarModel { // Returns the name of the EV cert holder. Only call this when the security // level is EV_SECURE. - virtual string16 GetEVCertName() const = 0; + virtual base::string16 GetEVCertName() const = 0; // Returns whether the URL for the current navigation entry should be // in the location bar. diff --git a/chrome/browser/ui/toolbar/toolbar_model_impl.cc b/chrome/browser/ui/toolbar/toolbar_model_impl.cc index 3fc3bd1..c7961a0 100644 --- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc +++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc @@ -95,8 +95,8 @@ ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevelForWebContents( } // ToolbarModelImpl Implementation. -string16 ToolbarModelImpl::GetText() const { - string16 search_terms(GetSearchTerms(false)); +base::string16 ToolbarModelImpl::GetText() const { + base::string16 search_terms(GetSearchTerms(false)); if (!search_terms.empty()) return search_terms; @@ -116,9 +116,9 @@ string16 ToolbarModelImpl::GetText() const { net::UnescapeRule::NORMAL, NULL, NULL, NULL)); } -string16 ToolbarModelImpl::GetCorpusNameForMobile() const { +base::string16 ToolbarModelImpl::GetCorpusNameForMobile() const { if (!WouldPerformSearchTermReplacement(false)) - return string16(); + return base::string16(); GURL url(GetURL()); // If there is a query in the url fragment look for the corpus name there, // otherwise look for the corpus name in the query parameters. @@ -134,7 +134,7 @@ string16 ToolbarModelImpl::GetCorpusNameForMobile() const { net::UnescapeRule::NORMAL, NULL); } } - return string16(); + return base::string16(); } GURL ToolbarModelImpl::GetURL() const { @@ -211,7 +211,7 @@ int ToolbarModelImpl::GetIcon() const { return icon_ids[GetSecurityLevel(false)]; } -string16 ToolbarModelImpl::GetEVCertName() const { +base::string16 ToolbarModelImpl::GetEVCertName() const { DCHECK_EQ(EV_SECURE, GetSecurityLevel(false)); scoped_refptr<net::X509Certificate> cert; // Note: Navigation controller and active entry are guaranteed non-NULL or @@ -222,12 +222,13 @@ string16 ToolbarModelImpl::GetEVCertName() const { } // static -string16 ToolbarModelImpl::GetEVCertName(const net::X509Certificate& cert) { +base::string16 ToolbarModelImpl::GetEVCertName( + const net::X509Certificate& cert) { // EV are required to have an organization name and country. if (cert.subject().organization_names.empty() || cert.subject().country_name.empty()) { NOTREACHED(); - return string16(); + return base::string16(); } return l10n_util::GetStringFUTF16( @@ -251,15 +252,17 @@ Profile* ToolbarModelImpl::GetProfile() const { NULL; } -string16 ToolbarModelImpl::GetSearchTerms(bool ignore_editing) const { +base::string16 ToolbarModelImpl::GetSearchTerms(bool ignore_editing) const { if (!search_term_replacement_enabled() || (input_in_progress() && !ignore_editing)) - return string16(); + return base::string16(); const WebContents* web_contents = delegate_->GetActiveWebContents(); - string16 search_terms(chrome::GetSearchTerms(web_contents)); - if (search_terms.empty()) - return string16(); // We mainly do this to enforce the subsequent DCHECK. + base::string16 search_terms(chrome::GetSearchTerms(web_contents)); + if (search_terms.empty()) { + // We mainly do this to enforce the subsequent DCHECK. + return base::string16(); + } // If the page is still loading and the security style is unknown, consider // the page secure. Without this, after the user hit enter on some search @@ -283,5 +286,5 @@ string16 ToolbarModelImpl::GetSearchTerms(bool ignore_editing) const { // error. ToolbarModel::SecurityLevel security_level = GetSecurityLevel(ignore_editing); return ((security_level == NONE) || (security_level == SECURITY_ERROR)) ? - string16() : search_terms; + base::string16() : search_terms; } diff --git a/chrome/browser/ui/toolbar/toolbar_model_impl.h b/chrome/browser/ui/toolbar/toolbar_model_impl.h index d7dccb7..b25b7ee 100644 --- a/chrome/browser/ui/toolbar/toolbar_model_impl.h +++ b/chrome/browser/ui/toolbar/toolbar_model_impl.h @@ -37,18 +37,18 @@ class ToolbarModelImpl : public ToolbarModel { content::WebContents* web_contents); // Overriden from ToolbarModel. - virtual string16 GetText() const OVERRIDE; - virtual string16 GetCorpusNameForMobile() const OVERRIDE; + virtual base::string16 GetText() const OVERRIDE; + virtual base::string16 GetCorpusNameForMobile() const OVERRIDE; virtual GURL GetURL() const OVERRIDE; virtual bool WouldPerformSearchTermReplacement( bool ignore_editing) const OVERRIDE; virtual SecurityLevel GetSecurityLevel(bool ignore_editing) const OVERRIDE; virtual int GetIcon() const OVERRIDE; - virtual string16 GetEVCertName() const OVERRIDE; + virtual base::string16 GetEVCertName() const OVERRIDE; virtual bool ShouldDisplayURL() const OVERRIDE; // Returns "<organization_name> [<country>]". - static string16 GetEVCertName(const net::X509Certificate& cert); + static base::string16 GetEVCertName(const net::X509Certificate& cert); private: // Returns the navigation controller used to retrieve the navigation entry @@ -63,7 +63,7 @@ class ToolbarModelImpl : public ToolbarModel { // appear in the omnibox (i.e. the page is sufficiently secure, search term // replacement is enabled, editing is not in progress, etc.). If // |ignore_editing| is true, the "editing not in progress" check is skipped. - string16 GetSearchTerms(bool ignore_editing) const; + base::string16 GetSearchTerms(bool ignore_editing) const; ToolbarModelDelegate* delegate_; diff --git a/chrome/browser/ui/toolbar/toolbar_model_unittest.cc b/chrome/browser/ui/toolbar/toolbar_model_unittest.cc index d0e72db..11ac46a 100644 --- a/chrome/browser/ui/toolbar/toolbar_model_unittest.cc +++ b/chrome/browser/ui/toolbar/toolbar_model_unittest.cc @@ -34,9 +34,9 @@ namespace { struct TestItem { GURL url; // The expected text to display when query extraction is inactive. - string16 expected_replace_text_inactive; + base::string16 expected_replace_text_inactive; // The expected text to display when query extraction is active. - string16 expected_replace_text_active; + base::string16 expected_replace_text_active; bool would_perform_search_term_replacement; bool should_display_url; } test_items[] = { @@ -63,8 +63,8 @@ struct TestItem { }, { GURL("chrome-internal://newtab/"), - string16(), - string16(), + base::string16(), + base::string16(), false, false }, @@ -141,7 +141,7 @@ class ToolbarModelTest : public BrowserWithTestWindowTest { protected: void NavigateAndCheckText(const GURL& url, - const string16& expected_text, + const base::string16& expected_text, bool would_perform_search_term_replacement, bool should_display_url); @@ -166,7 +166,7 @@ void ToolbarModelTest::SetUp() { void ToolbarModelTest::NavigateAndCheckText( const GURL& url, - const string16& expected_text, + const base::string16& expected_text, bool would_perform_search_term_replacement, bool should_display_url) { // Check while loading. diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc index 63de978..1fae222 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc @@ -115,7 +115,7 @@ void EncodingMenuModel::Build() { encoding_menu_items.begin(); for (; it != encoding_menu_items.end(); ++it) { int id = it->first; - string16& label = it->second; + base::string16& label = it->second; if (id == 0) { AddSeparator(ui::NORMAL_SEPARATOR); } else { @@ -315,7 +315,7 @@ string16 WrenchMenuModel::GetLabelForCommandId(int command_id) const { browser_->profile()->GetOriginalProfile()); default: NOTREACHED(); - return string16(); + return base::string16(); } } @@ -611,7 +611,7 @@ void WrenchMenuModel::Build(bool is_new_menu) { SigninManager* signin = SigninManagerFactory::GetForProfile( browser_->profile()->GetOriginalProfile()); if (signin && signin->IsSigninAllowed()) { - const string16 short_product_name = + const base::string16 short_product_name = l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME); AddItem(IDC_SHOW_SYNC_SETUP, l10n_util::GetStringFUTF16( IDS_SYNC_MENU_PRE_SYNCED_LABEL, short_product_name)); diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.h b/chrome/browser/ui/toolbar/wrench_menu_model.h index 159b219..9d38635 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.h +++ b/chrome/browser/ui/toolbar/wrench_menu_model.h @@ -100,7 +100,7 @@ class WrenchMenuModel : public ui::SimpleMenuModel, // Overridden for both ButtonMenuItemModel::Delegate and SimpleMenuModel: virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE; - virtual string16 GetLabelForCommandId(int command_id) const OVERRIDE; + virtual base::string16 GetLabelForCommandId(int command_id) const OVERRIDE; virtual bool GetIconForCommandId(int command_id, gfx::Image* icon) const OVERRIDE; virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; @@ -167,7 +167,7 @@ class WrenchMenuModel : public ui::SimpleMenuModel, scoped_ptr<ui::ButtonMenuItemModel> zoom_menu_item_model_; // Label of the zoom label in the zoom menu item. - string16 zoom_label_; + base::string16 zoom_label_; // Tools menu. scoped_ptr<ToolsMenuModel> tools_menu_model_; diff --git a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc index 3860ea8..c4de4ea 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc @@ -35,7 +35,7 @@ class MenuError : public GlobalError { virtual bool HasMenuItem() OVERRIDE { return true; } virtual int MenuItemCommandID() OVERRIDE { return command_id_; } - virtual string16 MenuItemLabel() OVERRIDE { return string16(); } + virtual base::string16 MenuItemLabel() OVERRIDE { return base::string16(); } virtual void ExecuteMenuItem(Browser* browser) OVERRIDE { execute_count_++; } virtual bool HasBubbleView() OVERRIDE { return false; } diff --git a/chrome/browser/ui/translate/language_combobox_model.h b/chrome/browser/ui/translate/language_combobox_model.h index 4af7a69..4daa855 100644 --- a/chrome/browser/ui/translate/language_combobox_model.h +++ b/chrome/browser/ui/translate/language_combobox_model.h @@ -23,7 +23,7 @@ class LanguageComboboxModel : public ui::ComboboxModel { // Overridden from ui::ComboboxModel: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; virtual bool IsItemSeparatorAt(int index) OVERRIDE; virtual int GetDefaultIndex() const OVERRIDE; diff --git a/chrome/browser/ui/translate/translate_bubble_model.h b/chrome/browser/ui/translate/translate_bubble_model.h index 67af93d..85b6cec 100644 --- a/chrome/browser/ui/translate/translate_bubble_model.h +++ b/chrome/browser/ui/translate/translate_bubble_model.h @@ -53,7 +53,7 @@ class TranslateBubbleModel { virtual int GetNumberOfLanguages() const = 0; // Returns the displayable name for the language at |index|. - virtual string16 GetLanguageNameAt(int index) const = 0; + virtual base::string16 GetLanguageNameAt(int index) const = 0; // Returns the original language index. virtual int GetOriginalLanguageIndex() const = 0; diff --git a/chrome/browser/ui/translate/translate_bubble_model_impl.h b/chrome/browser/ui/translate/translate_bubble_model_impl.h index 7557168..094b706 100644 --- a/chrome/browser/ui/translate/translate_bubble_model_impl.h +++ b/chrome/browser/ui/translate/translate_bubble_model_impl.h @@ -27,7 +27,7 @@ class TranslateBubbleModelImpl : public TranslateBubbleModel { virtual void SetErrorType(TranslateErrors::Type error_type) OVERRIDE; virtual void GoBackFromAdvanced() OVERRIDE; virtual int GetNumberOfLanguages() const OVERRIDE; - virtual string16 GetLanguageNameAt(int index) const OVERRIDE; + virtual base::string16 GetLanguageNameAt(int index) const OVERRIDE; virtual int GetOriginalLanguageIndex() const OVERRIDE; virtual void UpdateOriginalLanguageIndex(int index) OVERRIDE; virtual int GetTargetLanguageIndex() const OVERRIDE; diff --git a/chrome/browser/ui/validation_message_bubble.h b/chrome/browser/ui/validation_message_bubble.h index 82f7b3d..be99808 100644 --- a/chrome/browser/ui/validation_message_bubble.h +++ b/chrome/browser/ui/validation_message_bubble.h @@ -25,8 +25,8 @@ class ValidationMessageBubble { static scoped_ptr<ValidationMessageBubble> CreateAndShow( content::RenderWidgetHost* widget_host, const gfx::Rect& anchor_in_root_view, - const string16& main_text, - const string16& sub_text); + const base::string16& main_text, + const base::string16& sub_text); // Close the window and destruct the object. virtual ~ValidationMessageBubble() {} diff --git a/chrome/browser/ui/web_applications/web_app_ui.cc b/chrome/browser/ui/web_applications/web_app_ui.cc index d0a1253..8cced49 100644 --- a/chrome/browser/ui/web_applications/web_app_ui.cc +++ b/chrome/browser/ui/web_applications/web_app_ui.cc @@ -299,7 +299,7 @@ void UpdateShortcutWorker::UpdateShortcutsOnFileThread() { CheckExistingShortcuts(); if (!shortcut_files_.empty()) { // Generates app id from web app url and profile path. - string16 app_id = ShellIntegration::GetAppModelIdForProfile( + base::string16 app_id = ShellIntegration::GetAppModelIdForProfile( UTF8ToWide(web_app::GenerateApplicationNameFromURL(shortcut_info_.url)), profile_path_); |