diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-24 23:24:23 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-24 23:24:23 +0000 |
commit | f911df5f3947379800704cb2b0193b0976336b22 (patch) | |
tree | d08ecc8ee4bb4580794294e59d702c1c0d7c0424 | |
parent | 04338722eaee6d09b761353fb6e937b41933ff5e (diff) | |
download | chromium_src-f911df5f3947379800704cb2b0193b0976336b22.zip chromium_src-f911df5f3947379800704cb2b0193b0976336b22.tar.gz chromium_src-f911df5f3947379800704cb2b0193b0976336b22.tar.bz2 |
Update some uses of UTF conversions in chrome/browser to use the base:: namespace.
BUG=330556
TEST=no change
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/120983002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242465 0039d316-1c4b-4281-b951-d872f2087c98
135 files changed, 519 insertions, 451 deletions
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc index 8ecbd84..57f99b4 100644 --- a/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc +++ b/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc @@ -190,7 +190,8 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgIsFormatAvailable( clipboard->ReadData( ui::Clipboard::GetPepperCustomDataFormatType(), &clipboard_data); Pickle pickle(clipboard_data.data(), clipboard_data.size()); - available = IsFormatAvailableInPickle(UTF8ToUTF16(format_name), pickle); + available = + IsFormatAvailableInPickle(base::UTF8ToUTF16(format_name), pickle); } break; } @@ -219,7 +220,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgReadData( clipboard->ReadText(type, &text); if (!text.empty()) { result = PP_OK; - clipboard_string = UTF16ToUTF8(text); + clipboard_string = base::UTF16ToUTF8(text); break; } } @@ -244,7 +245,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgReadData( uint32 fragment_end; clipboard->ReadHTML(type, &html, &url, &fragment_start, &fragment_end); result = PP_OK; - clipboard_string = UTF16ToUTF8( + clipboard_string = base::UTF16ToUTF8( html.substr(fragment_start, fragment_end - fragment_start)); break; } @@ -262,7 +263,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgReadData( default: { if (custom_formats_.IsFormatRegistered(format)) { base::string16 format_name = - UTF8ToUTF16(custom_formats_.GetFormatName(format)); + base::UTF8ToUTF16(custom_formats_.GetFormatName(format)); std::string clipboard_data; clipboard->ReadData( ui::Clipboard::GetPepperCustomDataFormatType(), &clipboard_data); @@ -314,10 +315,10 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgWriteData( switch (formats[i]) { case PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT: - scw.WriteText(UTF8ToUTF16(data[i])); + scw.WriteText(base::UTF8ToUTF16(data[i])); break; case PP_FLASH_CLIPBOARD_FORMAT_HTML: - scw.WriteHTML(UTF8ToUTF16(data[i]), std::string()); + scw.WriteHTML(base::UTF8ToUTF16(data[i]), std::string()); break; case PP_FLASH_CLIPBOARD_FORMAT_RTF: scw.WriteRTF(data[i]); @@ -328,7 +329,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgWriteData( default: if (custom_formats_.IsFormatRegistered(formats[i])) { std::string format_name = custom_formats_.GetFormatName(formats[i]); - custom_data_map[UTF8ToUTF16(format_name)] = data[i]; + custom_data_map[base::UTF8ToUTF16(format_name)] = data[i]; } else { // Invalid format. res = PP_ERROR_BADARGUMENT; diff --git a/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc b/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc index f13542e..c2227c8 100644 --- a/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc +++ b/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc @@ -79,20 +79,20 @@ class PluginInfoMessageFilterTest : public ::testing::Test { } virtual void SetUp() OVERRIDE { - content::WebPluginInfo foo_plugin(ASCIIToUTF16("Foo Plug-in"), + content::WebPluginInfo foo_plugin(base::ASCIIToUTF16("Foo Plug-in"), foo_plugin_path_, - ASCIIToUTF16("1"), - ASCIIToUTF16("The Foo plug-in.")); + base::ASCIIToUTF16("1"), + base::ASCIIToUTF16("The Foo plug-in.")); content::WebPluginMimeType mime_type; mime_type.mime_type = "foo/bar"; foo_plugin.mime_types.push_back(mime_type); PluginService::GetInstance()->Init(); PluginService::GetInstance()->RegisterInternalPlugin(foo_plugin, false); - content::WebPluginInfo bar_plugin(ASCIIToUTF16("Bar Plug-in"), + content::WebPluginInfo bar_plugin(base::ASCIIToUTF16("Bar Plug-in"), bar_plugin_path_, - ASCIIToUTF16("1"), - ASCIIToUTF16("The Bar plug-in.")); + base::ASCIIToUTF16("1"), + base::ASCIIToUTF16("The Bar plug-in.")); mime_type.mime_type = "foo/bar"; bar_plugin.mime_types.push_back(mime_type); PluginService::GetInstance()->RegisterInternalPlugin(bar_plugin, false); diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc index 666a4f9..f54d191 100644 --- a/chrome/browser/rlz/rlz.cc +++ b/chrome/browser/rlz/rlz.cc @@ -359,7 +359,7 @@ void RLZTracker::PingNowImpl() { base::string16 lang; GoogleUpdateSettings::GetLanguage(&lang); if (lang.empty()) - lang = ASCIIToUTF16("en"); + lang = base::ASCIIToUTF16("en"); base::string16 referral; GoogleUpdateSettings::GetReferral(&referral); @@ -494,7 +494,7 @@ std::string RLZTracker::GetAccessPointHttpHeader(rlz_lib::AccessPoint point) { RLZTracker::GetAccessPointRlz(point, &rlz_string); if (!rlz_string.empty()) { net::HttpUtil::AppendHeaderIfMissing("X-Rlz-String", - UTF16ToUTF8(rlz_string), + base::UTF16ToUTF8(rlz_string), &extra_headers); } @@ -533,7 +533,7 @@ bool RLZTracker::GetAccessPointRlzImpl(rlz_lib::AccessPoint point, if (!rlz_lib::GetAccessPointRlz(point, str_rlz, rlz_lib::kMaxRlzLength)) return false; - base::string16 rlz_local(ASCIIToUTF16(std::string(str_rlz))); + base::string16 rlz_local(base::ASCIIToUTF16(std::string(str_rlz))); if (rlz) *rlz = rlz_local; diff --git a/chrome/browser/rlz/rlz_unittest.cc b/chrome/browser/rlz/rlz_unittest.cc index 1dd7ba0..f78a1d9 100644 --- a/chrome/browser/rlz/rlz_unittest.cc +++ b/chrome/browser/rlz/rlz_unittest.cc @@ -218,7 +218,7 @@ void RlzLibTest::SetRegistryBrandValue(const wchar_t* name, LONG result = key.DeleteValue(name); ASSERT_TRUE(ERROR_SUCCESS == result || ERROR_FILE_NOT_FOUND == result); } else { - base::string16 brand16 = ASCIIToUTF16(brand); + base::string16 brand16 = base::ASCIIToUTF16(brand); ASSERT_EQ(ERROR_SUCCESS, key.WriteValue(name, brand16.c_str())); } } @@ -587,7 +587,7 @@ TEST_F(RlzLibTest, GetAccessPointRlzOnIoThread) { tracker_.set_assume_not_ui_thread(true); EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz)); - EXPECT_STREQ(kOmniboxRlzString, UTF16ToUTF8(rlz).c_str()); + EXPECT_STREQ(kOmniboxRlzString, base::UTF16ToUTF8(rlz).c_str()); } TEST_F(RlzLibTest, GetAccessPointRlzNotOnIoThread) { @@ -611,11 +611,11 @@ TEST_F(RlzLibTest, GetAccessPointRlzIsCached) { tracker_.set_assume_not_ui_thread(true); EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz)); - EXPECT_STREQ(kOmniboxRlzString, UTF16ToUTF8(rlz).c_str()); + EXPECT_STREQ(kOmniboxRlzString, base::UTF16ToUTF8(rlz).c_str()); tracker_.set_assume_not_ui_thread(false); EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz)); - EXPECT_STREQ(kOmniboxRlzString, UTF16ToUTF8(rlz).c_str()); + EXPECT_STREQ(kOmniboxRlzString, base::UTF16ToUTF8(rlz).c_str()); } TEST_F(RlzLibTest, PingUpdatesRlzCache) { @@ -629,19 +629,19 @@ TEST_F(RlzLibTest, PingUpdatesRlzCache) { tracker_.set_assume_not_ui_thread(true); EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz)); - EXPECT_STREQ(kOmniboxRlzString, UTF16ToUTF8(rlz).c_str()); + EXPECT_STREQ(kOmniboxRlzString, base::UTF16ToUTF8(rlz).c_str()); EXPECT_TRUE(RLZTracker::GetAccessPointRlz( RLZTracker::CHROME_HOME_PAGE, &rlz)); - EXPECT_STREQ(kHomepageRlzString, UTF16ToUTF8(rlz).c_str()); + EXPECT_STREQ(kHomepageRlzString, base::UTF16ToUTF8(rlz).c_str()); // Make sure cache is valid. tracker_.set_assume_not_ui_thread(false); EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz)); - EXPECT_STREQ(kOmniboxRlzString, UTF16ToUTF8(rlz).c_str()); + EXPECT_STREQ(kOmniboxRlzString, base::UTF16ToUTF8(rlz).c_str()); EXPECT_TRUE(RLZTracker::GetAccessPointRlz( RLZTracker::CHROME_HOME_PAGE, &rlz)); - EXPECT_STREQ(kHomepageRlzString, UTF16ToUTF8(rlz).c_str()); + EXPECT_STREQ(kHomepageRlzString, base::UTF16ToUTF8(rlz).c_str()); // Perform ping. tracker_.set_assume_not_ui_thread(true); @@ -653,10 +653,10 @@ TEST_F(RlzLibTest, PingUpdatesRlzCache) { tracker_.set_assume_not_ui_thread(false); EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz)); - EXPECT_STREQ(kNewOmniboxRlzString, UTF16ToUTF8(rlz).c_str()); + EXPECT_STREQ(kNewOmniboxRlzString, base::UTF16ToUTF8(rlz).c_str()); EXPECT_TRUE(RLZTracker::GetAccessPointRlz( RLZTracker::CHROME_HOME_PAGE, &rlz)); - EXPECT_STREQ(kNewHomepageRlzString, UTF16ToUTF8(rlz).c_str()); + EXPECT_STREQ(kNewHomepageRlzString, base::UTF16ToUTF8(rlz).c_str()); } TEST_F(RlzLibTest, ObserveHandlesBadArgs) { diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index 2062dd2..ed6c951 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -931,7 +931,7 @@ void SafeBrowsingBlockingPageV1::PopulateMultipleThreatStringDictionary( l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_HEADLINE), l10n_util::GetStringFUTF16( IDS_SAFE_BROWSING_MULTI_THREAT_DESCRIPTION1, - UTF8ToUTF16(web_contents_->GetURL().host())), + base::UTF8ToUTF16(web_contents_->GetURL().host())), l10n_util::GetStringUTF16( IDS_SAFE_BROWSING_MULTI_THREAT_DESCRIPTION2), base::string16()); @@ -943,7 +943,7 @@ void SafeBrowsingBlockingPageV1::PopulateMultipleThreatStringDictionary( l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_HEADLINE), l10n_util::GetStringFUTF16( IDS_SAFE_BROWSING_MULTI_MALWARE_DESCRIPTION1, - UTF8ToUTF16(web_contents_->GetURL().host())), + base::UTF8ToUTF16(web_contents_->GetURL().host())), l10n_util::GetStringUTF16( IDS_SAFE_BROWSING_MULTI_MALWARE_DESCRIPTION2), l10n_util::GetStringUTF16( @@ -956,7 +956,7 @@ void SafeBrowsingBlockingPageV1::PopulateMultipleThreatStringDictionary( l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_HEADLINE), l10n_util::GetStringFUTF16( IDS_SAFE_BROWSING_MULTI_PHISHING_DESCRIPTION1, - UTF8ToUTF16(web_contents_->GetURL().host())), + base::UTF8ToUTF16(web_contents_->GetURL().host())), base::string16(), base::string16()); break; @@ -1109,7 +1109,7 @@ void SafeBrowsingBlockingPageV2::PopulateMalwareStringDictionary( description1 = l10n_util::GetStringFUTF16( IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION1, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), - UTF8ToUTF16(url_.host())); + base::UTF8ToUTF16(url_.host())); description2 = l10n_util::GetStringUTF16( IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION2); strings->SetString("details", l10n_util::GetStringUTF16( @@ -1120,13 +1120,13 @@ void SafeBrowsingBlockingPageV2::PopulateMalwareStringDictionary( description1 = l10n_util::GetStringFUTF16( IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION1_SUBRESOURCE, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), - UTF8ToUTF16(web_contents_->GetURL().host())); + base::UTF8ToUTF16(web_contents_->GetURL().host())); description2 = l10n_util::GetStringFUTF16( IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION2_SUBRESOURCE, - UTF8ToUTF16(url_.host())); + base::UTF8ToUTF16(url_.host())); strings->SetString("details", l10n_util::GetStringFUTF16( IDS_SAFE_BROWSING_MALWARE_V2_DETAILS_SUBRESOURCE, - UTF8ToUTF16(url_.host()))); + base::UTF8ToUTF16(url_.host()))); } PopulateStringDictionary( @@ -1153,7 +1153,7 @@ void SafeBrowsingBlockingPageV2::PopulateMalwareStringDictionary( strings->SetString("confirm_text", l10n_util::GetStringFUTF16( IDS_SAFE_BROWSING_MALWARE_V2_REPORTING_AGREE, - UTF8ToUTF16(privacy_link))); + base::UTF8ToUTF16(privacy_link))); if (IsPrefEnabled(prefs::kSafeBrowsingReportingEnabled)) strings->SetString(kBoxChecked, "yes"); else @@ -1173,7 +1173,7 @@ void SafeBrowsingBlockingPageV2::PopulatePhishingStringDictionary( l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_HEADLINE), l10n_util::GetStringFUTF16(IDS_SAFE_BROWSING_PHISHING_V2_DESCRIPTION1, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), - UTF8ToUTF16(url_.host())), + base::UTF8ToUTF16(url_.host())), base::string16(), l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_DESCRIPTION2)); diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc index 70ed042..ec71d0a 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc @@ -568,7 +568,8 @@ class SafeBrowsingBlockingPageTest : public InProcessBrowserTest { // reply, hanging the test. rvh->ExecuteJavascriptInWebFrame( base::string16(), - ASCIIToUTF16("document.getElementById('" + node_id + "').click();\n")); + base::ASCIIToUTF16( + "document.getElementById('" + node_id + "').click();\n")); return true; } diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc index ed38ffe..d4387a1 100644 --- a/chrome/browser/search/search.cc +++ b/chrome/browser/search/search.cc @@ -96,9 +96,9 @@ const char kInstantSupportDisabled[] = "Instant support disabled"; const char kInstantSupportUnknown[] = "Instant support unknown"; InstantSupportState StringToInstantSupportState(const base::string16& value) { - if (value == ASCIIToUTF16(kInstantSupportEnabled)) + if (value == base::ASCIIToUTF16(kInstantSupportEnabled)) return INSTANT_SUPPORT_YES; - else if (value == ASCIIToUTF16(kInstantSupportDisabled)) + else if (value == base::ASCIIToUTF16(kInstantSupportDisabled)) return INSTANT_SUPPORT_NO; else return INSTANT_SUPPORT_UNKNOWN; @@ -107,13 +107,13 @@ InstantSupportState StringToInstantSupportState(const base::string16& value) { base::string16 InstantSupportStateToString(InstantSupportState state) { switch (state) { case INSTANT_SUPPORT_NO: - return ASCIIToUTF16(kInstantSupportDisabled); + return base::ASCIIToUTF16(kInstantSupportDisabled); case INSTANT_SUPPORT_YES: - return ASCIIToUTF16(kInstantSupportEnabled); + return base::ASCIIToUTF16(kInstantSupportEnabled); case INSTANT_SUPPORT_UNKNOWN: - return ASCIIToUTF16(kInstantSupportUnknown); + return base::ASCIIToUTF16(kInstantSupportUnknown); } - return ASCIIToUTF16(kInstantSupportUnknown); + return base::ASCIIToUTF16(kInstantSupportUnknown); } TemplateURL* GetDefaultSearchProviderTemplateURL(Profile* profile) { diff --git a/chrome/browser/search_engines/search_provider_install_data_unittest.cc b/chrome/browser/search_engines/search_provider_install_data_unittest.cc index a09d1a8..d44108a 100644 --- a/chrome/browser/search_engines/search_provider_install_data_unittest.cc +++ b/chrome/browser/search_engines/search_provider_install_data_unittest.cc @@ -208,7 +208,7 @@ TEST_F(SearchProviderInstallDataTest, GetInstallState) { // Set up the database. util_.ChangeModelToLoadState(); std::string host = "www.unittest.com"; - AddNewTemplateURL("http://" + host + "/path", ASCIIToUTF16("unittest")); + AddNewTemplateURL("http://" + host + "/path", base::ASCIIToUTF16("unittest")); // Wait for the changes to be saved. base::RunLoop().RunUntilIdle(); @@ -220,7 +220,8 @@ TEST_F(SearchProviderInstallDataTest, GetInstallState) { // Set-up a default and try it all one more time. std::string default_host = "www.mmm.com"; TemplateURL* default_url = - AddNewTemplateURL("http://" + default_host + "/", ASCIIToUTF16("mmm")); + AddNewTemplateURL("http://" + default_host + "/", + base::ASCIIToUTF16("mmm")); util_.model()->SetDefaultSearchProvider(default_url); test_get_install_state.RunTests(host, default_host); } @@ -229,7 +230,7 @@ TEST_F(SearchProviderInstallDataTest, ManagedDefaultSearch) { // Set up the database. util_.ChangeModelToLoadState(); std::string host = "www.unittest.com"; - AddNewTemplateURL("http://" + host + "/path", ASCIIToUTF16("unittest")); + AddNewTemplateURL("http://" + host + "/path", base::ASCIIToUTF16("unittest")); // Set a managed preference that establishes a default search provider. std::string host2 = "www.managedtest.com"; @@ -256,9 +257,10 @@ TEST_F(SearchProviderInstallDataTest, GoogleBaseUrlChange) { // Wait for the I/O thread to process the update notification. base::RunLoop().RunUntilIdle(); - AddNewTemplateURL("{google:baseURL}?q={searchTerms}", ASCIIToUTF16("t")); + AddNewTemplateURL("{google:baseURL}?q={searchTerms}", + base::ASCIIToUTF16("t")); TemplateURL* default_url = - AddNewTemplateURL("http://d.com/", ASCIIToUTF16("d")); + AddNewTemplateURL("http://d.com/", base::ASCIIToUTF16("d")); util_.model()->SetDefaultSearchProvider(default_url); // Wait for the changes to be saved. diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc index 7f9d93f..a4f205c 100644 --- a/chrome/browser/search_engines/template_url.cc +++ b/chrome/browser/search_engines/template_url.cc @@ -130,7 +130,7 @@ bool TryEncoding(const base::string16& terms, if (!base::UTF16ToCodepage(terms, encoding, base::OnStringConversionError::SKIP, &encoded_terms)) return false; - *escaped_terms = UTF8ToUTF16(is_in_query ? + *escaped_terms = base::UTF8ToUTF16(is_in_query ? net::EscapeQueryParamValue(encoded_terms, true) : net::EscapePath(encoded_terms)); if (original_query.empty()) @@ -139,8 +139,8 @@ bool TryEncoding(const base::string16& terms, if (!base::UTF16ToCodepage(original_query, encoding, base::OnStringConversionError::SKIP, &encoded_original_query)) return false; - *escaped_original_query = - UTF8ToUTF16(net::EscapeQueryParamValue(encoded_original_query, true)); + *escaped_original_query = base::UTF8ToUTF16( + net::EscapeQueryParamValue(encoded_original_query, true)); return true; } @@ -379,14 +379,14 @@ bool TemplateURLRef::IsValidUsingTermsData( base::string16 TemplateURLRef::DisplayURL() const { ParseIfNecessary(); - base::string16 result(UTF8ToUTF16(GetURL())); + base::string16 result(base::UTF8ToUTF16(GetURL())); if (valid_ && !replacements_.empty()) { ReplaceSubstringsAfterOffset(&result, 0, - ASCIIToUTF16(kSearchTermsParameterFull), - ASCIIToUTF16(kDisplaySearchTerms)); + base::ASCIIToUTF16(kSearchTermsParameterFull), + base::ASCIIToUTF16(kDisplaySearchTerms)); ReplaceSubstringsAfterOffset(&result, 0, - ASCIIToUTF16(kGoogleUnescapedSearchTermsParameterFull), - ASCIIToUTF16(kDisplayUnescapedSearchTerms)); + base::ASCIIToUTF16(kGoogleUnescapedSearchTermsParameterFull), + base::ASCIIToUTF16(kDisplayUnescapedSearchTerms)); } return result; } @@ -395,13 +395,14 @@ base::string16 TemplateURLRef::DisplayURL() const { std::string TemplateURLRef::DisplayURLToURLRef( const base::string16& display_url) { base::string16 result = display_url; - ReplaceSubstringsAfterOffset(&result, 0, ASCIIToUTF16(kDisplaySearchTerms), - ASCIIToUTF16(kSearchTermsParameterFull)); + ReplaceSubstringsAfterOffset(&result, 0, + base::ASCIIToUTF16(kDisplaySearchTerms), + base::ASCIIToUTF16(kSearchTermsParameterFull)); ReplaceSubstringsAfterOffset( &result, 0, - ASCIIToUTF16(kDisplayUnescapedSearchTerms), - ASCIIToUTF16(kGoogleUnescapedSearchTermsParameterFull)); - return UTF16ToUTF8(result); + base::ASCIIToUTF16(kDisplayUnescapedSearchTerms), + base::ASCIIToUTF16(kGoogleUnescapedSearchTermsParameterFull)); + return base::UTF16ToUTF8(result); } const std::string& TemplateURLRef::GetHost() const { @@ -442,7 +443,7 @@ base::string16 TemplateURLRef::SearchTermToString16( // When nothing worked, just use the escaped text. We have no idea what the // encoding is. We need to substitute spaces for pluses ourselves since we're // not sending it through an unescaper. - result = UTF8ToUTF16(term); + result = base::UTF8ToUTF16(term); std::replace(result.begin(), result.end(), '+', ' '); return result; } @@ -925,7 +926,7 @@ std::string TemplateURLRef::HandleReplacements( if (search_terms_args.accepted_suggestion >= 0 || !search_terms_args.assisted_query_stats.empty()) { HandleReplacement( - "oq", UTF16ToUTF8(encoded_original_query), *i, &url); + "oq", base::UTF16ToUTF8(encoded_original_query), *i, &url); } break; @@ -946,7 +947,7 @@ std::string TemplateURLRef::HandleReplacements( // NOTREACHED below.) base::string16 rlz_string = search_terms_data.GetRlzParameterValue(); if (!rlz_string.empty()) { - HandleReplacement("rlz", UTF16ToUTF8(rlz_string), *i, &url); + HandleReplacement("rlz", base::UTF16ToUTF8(rlz_string), *i, &url); } break; } @@ -992,7 +993,8 @@ std::string TemplateURLRef::HandleReplacements( break; case SEARCH_TERMS: - HandleReplacement(std::string(), UTF16ToUTF8(encoded_terms), *i, &url); + HandleReplacement( + std::string(), base::UTF16ToUTF8(encoded_terms), *i, &url); break; case GOOGLE_IMAGE_THUMBNAIL: @@ -1050,7 +1052,7 @@ TemplateURLData::TemplateURLData() usage_count(0), prepopulate_id(0), sync_guid(base::GenerateGUID()), - keyword_(ASCIIToUTF16("dummy")), + keyword_(base::ASCIIToUTF16("dummy")), url_("x") { } @@ -1132,7 +1134,7 @@ bool TemplateURL::SupportsReplacementUsingTermsData( bool TemplateURL::IsGoogleSearchURLWithReplaceableKeyword() const { return (GetType() == NORMAL) && url_ref_.HasGoogleBaseURLs() && - google_util::IsGoogleHostname(UTF16ToUTF8(data_.keyword()), + google_util::IsGoogleHostname(base::UTF16ToUTF8(data_.keyword()), google_util::DISALLOW_SUBDOMAIN); } @@ -1242,7 +1244,7 @@ bool TemplateURL::ReplaceSearchTermsInURL( std::string old_params((search_term_component == url_parse::Parsed::REF) ? url.ref() : url.query()); std::string new_params(old_params, 0, search_terms_position.begin); - new_params += UTF16ToUTF8(search_terms_args.search_terms); + new_params += base::UTF16ToUTF8(search_terms_args.search_terms); new_params += old_params.substr(search_terms_position.end()); url_canon::StdStringReplacements<std::string> replacements; if (search_term_component == url_parse::Parsed::REF) diff --git a/chrome/browser/search_engines/template_url_fetcher_unittest.cc b/chrome/browser/search_engines/template_url_fetcher_unittest.cc index 6216f74..b0b6ad8 100644 --- a/chrome/browser/search_engines/template_url_fetcher_unittest.cc +++ b/chrome/browser/search_engines/template_url_fetcher_unittest.cc @@ -20,6 +20,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" +using base::ASCIIToUTF16; + class TemplateURLFetcherTest; // Handles callbacks from TemplateURLFetcher. diff --git a/chrome/browser/search_engines/template_url_parser.cc b/chrome/browser/search_engines/template_url_parser.cc index f6ad098..93d11de 100644 --- a/chrome/browser/search_engines/template_url_parser.cc +++ b/chrome/browser/search_engines/template_url_parser.cc @@ -245,7 +245,7 @@ void TemplateURLParsingContext::EndElementImpl(void* ctx, const xmlChar* name) { context->data_.short_name = context->string_; break; case TemplateURLParsingContext::IMAGE: { - GURL image_url(UTF16ToUTF8(context->string_)); + GURL image_url(base::UTF16ToUTF8(context->string_)); if (image_url.SchemeIs(chrome::kDataScheme)) { // TODO (jcampan): bug 1169256: when dealing with data URL, we need to // decode the data URL in the renderer. For now, we'll just point to the @@ -280,7 +280,7 @@ void TemplateURLParsingContext::CharactersImpl(void* ctx, const xmlChar* ch, int len) { reinterpret_cast<TemplateURLParsingContext*>(ctx)->string_ += - UTF8ToUTF16(std::string(reinterpret_cast<const char*>(ch), len)); + base::UTF8ToUTF16(std::string(reinterpret_cast<const char*>(ch), len)); } TemplateURL* TemplateURLParsingContext::GetTemplateURL( diff --git a/chrome/browser/search_engines/template_url_parser_unittest.cc b/chrome/browser/search_engines/template_url_parser_unittest.cc index b602016..127f748 100644 --- a/chrome/browser/search_engines/template_url_parser_unittest.cc +++ b/chrome/browser/search_engines/template_url_parser_unittest.cc @@ -11,6 +11,8 @@ #include "chrome/common/chrome_paths.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + // ParamFilterImpl ------------------------------------------------------------ // Filters any param which as an occurrence of name_str_ in its name or an diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc index 14b7c77..c32f375 100644 --- a/chrome/browser/search_engines/template_url_prepopulate_data.cc +++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc @@ -1190,8 +1190,8 @@ TemplateURL* MakePrepopulatedTemplateURLFromPrepopulateEngine( alternate_urls.AppendString(std::string(engine.alternate_urls[i])); } - return MakePrepopulatedTemplateURL(profile, WideToUTF16(engine.name), - WideToUTF16(engine.keyword), engine.search_url, engine.suggest_url, + return MakePrepopulatedTemplateURL(profile, base::WideToUTF16(engine.name), + base::WideToUTF16(engine.keyword), engine.search_url, engine.suggest_url, engine.instant_url, engine.image_url, engine.new_tab_url, engine.search_url_post_params, engine.suggest_url_post_params, engine.instant_url_post_params, engine.image_url_post_params, @@ -1302,7 +1302,7 @@ SearchEngineType GetEngineType(const TemplateURL& url) { // can't be directly inspected (e.g. due to containing {google:baseURL}) can // be converted to GURLs we can look at. GURL gurl(url.url_ref().ReplaceSearchTerms(TemplateURLRef::SearchTermsArgs( - ASCIIToUTF16("x")))); + base::ASCIIToUTF16("x")))); return gurl.is_valid() ? GetEngineType(gurl) : SEARCH_ENGINE_OTHER; } diff --git a/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc b/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc index ffb53b3..294d823 100644 --- a/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc +++ b/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc @@ -19,6 +19,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/l10n/l10n_util.h" +using base::ASCIIToUTF16; + namespace { SearchEngineType GetEngineType(const std::string& url) { TemplateURLData data; diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc index a4d28d9..872588e 100644 --- a/chrome/browser/search_engines/template_url_service.cc +++ b/chrome/browser/search_engines/template_url_service.cc @@ -328,7 +328,7 @@ base::string16 TemplateURLService::GenerateKeyword(const GURL& url) { // perhaps with some weird intranet and custom DNS server?), ensure we at // least don't return the empty string. base::string16 keyword(net::StripWWWFromHost(url)); - return keyword.empty() ? ASCIIToUTF16("www") : keyword; + return keyword.empty() ? base::ASCIIToUTF16("www") : keyword; } // static @@ -338,22 +338,22 @@ base::string16 TemplateURLService::CleanUserInputKeyword( base::string16 result(base::i18n::ToLower(keyword)); TrimWhitespace(result, TRIM_ALL, &result); url_parse::Component scheme_component; - if (url_parse::ExtractScheme(UTF16ToUTF8(keyword).c_str(), + if (url_parse::ExtractScheme(base::UTF16ToUTF8(keyword).c_str(), static_cast<int>(keyword.length()), &scheme_component)) { // If the scheme isn't "http" or "https", bail. The user isn't trying to // type a web address, but rather an FTP, file:, or other scheme URL, or a // search query with some sort of initial operator (e.g. "site:"). if (result.compare(0, scheme_component.end(), - ASCIIToUTF16(content::kHttpScheme)) && + base::ASCIIToUTF16(content::kHttpScheme)) && result.compare(0, scheme_component.end(), - ASCIIToUTF16(content::kHttpsScheme))) + base::ASCIIToUTF16(content::kHttpsScheme))) return base::string16(); // Include trailing ':'. result.erase(0, scheme_component.end() + 1); // Many schemes usually have "//" after them, so strip it too. - const base::string16 after_scheme(ASCIIToUTF16("//")); + const base::string16 after_scheme(base::ASCIIToUTF16("//")); if (result.compare(0, after_scheme.length(), after_scheme) == 0) result.erase(0, after_scheme.length()); } @@ -392,7 +392,8 @@ GURL TemplateURLService::GenerateSearchURLUsingTermsData( // TODO(jnd): Add additional parameters to get post data when the search URL // has post parameters. return GURL(search_ref.ReplaceSearchTermsUsingTermsData( - TemplateURLRef::SearchTermsArgs(ASCIIToUTF16("blah.blah.blah.blah.blah")), + TemplateURLRef::SearchTermsArgs( + base::ASCIIToUTF16("blah.blah.blah.blah.blah")), search_terms_data, NULL)); } @@ -1275,8 +1276,8 @@ syncer::SyncData TemplateURLService::CreateSyncDataFromTemplateURL( sync_pb::EntitySpecifics specifics; sync_pb::SearchEngineSpecifics* se_specifics = specifics.mutable_search_engine(); - se_specifics->set_short_name(UTF16ToUTF8(turl.short_name())); - se_specifics->set_keyword(UTF16ToUTF8(turl.keyword())); + se_specifics->set_short_name(base::UTF16ToUTF8(turl.short_name())); + se_specifics->set_keyword(base::UTF16ToUTF8(turl.keyword())); se_specifics->set_favicon_url(turl.favicon_url().spec()); se_specifics->set_url(turl.url()); se_specifics->set_safe_for_autoreplace(turl.safe_for_autoreplace()); @@ -1337,9 +1338,9 @@ TemplateURL* TemplateURLService::CreateTemplateURLFromTemplateURLAndSyncData( TemplateURLData data(existing_turl ? existing_turl->data() : TemplateURLData()); - data.short_name = UTF8ToUTF16(specifics.short_name()); + data.short_name = base::UTF8ToUTF16(specifics.short_name()); data.originating_url = GURL(specifics.originating_url()); - base::string16 keyword(UTF8ToUTF16(specifics.keyword())); + base::string16 keyword(base::UTF8ToUTF16(specifics.keyword())); // NOTE: Once this code has shipped in a couple of stable releases, we can // probably remove the migration portion, comment out the // "autogenerate_keyword" field entirely in the .proto file, and fold the @@ -1347,7 +1348,7 @@ TemplateURL* TemplateURLService::CreateTemplateURLFromTemplateURLAndSyncData( bool reset_keyword = specifics.autogenerate_keyword() || specifics.keyword().empty(); if (reset_keyword) - keyword = ASCIIToUTF16("dummy"); // Will be replaced below. + keyword = base::ASCIIToUTF16("dummy"); // Will be replaced below. DCHECK(!keyword.empty()); data.SetKeyword(keyword); data.SetURL(specifics.url()); @@ -1470,8 +1471,8 @@ void TemplateURLService::Init(const Initializer* initializers, // TemplateURLService ends up owning the TemplateURL, don't try and free // it. TemplateURLData data; - data.short_name = UTF8ToUTF16(initializers[i].content); - data.SetKeyword(UTF8ToUTF16(initializers[i].keyword)); + data.short_name = base::UTF8ToUTF16(initializers[i].content); + data.SetKeyword(base::UTF8ToUTF16(initializers[i].keyword)); data.SetURL(initializers[i].url); TemplateURL* template_url = new TemplateURL(profile_, data); AddNoNotify(template_url, true); @@ -1644,8 +1645,8 @@ void TemplateURLService::SaveDefaultSearchProviderToPrefs( if (!icon_gurl.is_empty()) icon_url = icon_gurl.spec(); encodings = JoinString(t_url->input_encodings(), ';'); - short_name = UTF16ToUTF8(t_url->short_name()); - keyword = UTF16ToUTF8(t_url->keyword()); + short_name = base::UTF16ToUTF8(t_url->short_name()); + keyword = base::UTF16ToUTF8(t_url->keyword()); id_string = base::Int64ToString(t_url->id()); prepopulate_id = base::Int64ToString(t_url->prepopulate_id()); for (size_t i = 0; i < t_url->alternate_urls().size(); ++i) @@ -1695,16 +1696,16 @@ bool TemplateURLService::LoadDefaultSearchProviderFromPrefs( } base::string16 name = - UTF8ToUTF16(prefs->GetString(prefs::kDefaultSearchProviderName)); + base::UTF8ToUTF16(prefs->GetString(prefs::kDefaultSearchProviderName)); base::string16 keyword = - UTF8ToUTF16(prefs->GetString(prefs::kDefaultSearchProviderKeyword)); + base::UTF8ToUTF16(prefs->GetString(prefs::kDefaultSearchProviderKeyword)); // Force keyword to be non-empty. // TODO(pkasting): This is only necessary as long as we're potentially loading // older prefs where empty keywords are theoretically possible. Eventually // this code can be replaced with a DCHECK(!keyword.empty());. bool update_keyword = keyword.empty(); if (update_keyword) - keyword = ASCIIToUTF16("dummy"); + keyword = base::ASCIIToUTF16("dummy"); std::string search_url = prefs->GetString(prefs::kDefaultSearchProviderSearchURL); // Force URL to be non-empty. We've never supported this case, but past bugs @@ -1964,7 +1965,7 @@ void TemplateURLService::AddTabToSearchVisit(const TemplateURL& t_url) { if (!history) return; - GURL url(URLFixerUpper::FixupURL(UTF16ToUTF8(t_url.keyword()), + GURL url(URLFixerUpper::FixupURL(base::UTF16ToUTF8(t_url.keyword()), std::string())); if (!url.is_valid()) return; @@ -2384,7 +2385,7 @@ base::string16 TemplateURLService::UniquifyKeyword(const TemplateURL& turl, // keyword and let the user do what they will after our attempt. base::string16 keyword_candidate(turl.keyword()); do { - keyword_candidate.append(ASCIIToUTF16("_")); + keyword_candidate.append(base::ASCIIToUTF16("_")); } while (GetTemplateURLForKeyword(keyword_candidate)); return keyword_candidate; @@ -2684,8 +2685,8 @@ void TemplateURLService::EnsureDefaultSearchProviderExists() { TemplateURL* TemplateURLService::CreateTemplateURLForExtension( const ExtensionKeyword& extension_keyword) const { TemplateURLData data; - data.short_name = UTF8ToUTF16(extension_keyword.extension_name); - data.SetKeyword(UTF8ToUTF16(extension_keyword.extension_keyword)); + data.short_name = base::UTF8ToUTF16(extension_keyword.extension_name); + data.SetKeyword(base::UTF8ToUTF16(extension_keyword.extension_keyword)); // This URL is not actually used for navigation. It holds the extension's // ID, as well as forcing the TemplateURL to be treated as a search keyword. data.SetURL(std::string(extensions::kExtensionScheme) + "://" + diff --git a/chrome/browser/search_engines/template_url_service_sync_unittest.cc b/chrome/browser/search_engines/template_url_service_sync_unittest.cc index 64d0835..9509ecf 100644 --- a/chrome/browser/search_engines/template_url_service_sync_unittest.cc +++ b/chrome/browser/search_engines/template_url_service_sync_unittest.cc @@ -28,6 +28,7 @@ #include "sync/protocol/sync.pb.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; using base::Time; namespace { @@ -58,9 +59,9 @@ syncer::SyncData CreateCustomSyncData(const TemplateURL& turl, sync_pb::EntitySpecifics specifics; sync_pb::SearchEngineSpecifics* se_specifics = specifics.mutable_search_engine(); - se_specifics->set_short_name(UTF16ToUTF8(turl.short_name())); + se_specifics->set_short_name(base::UTF16ToUTF8(turl.short_name())); se_specifics->set_keyword( - autogenerate_keyword ? std::string() : UTF16ToUTF8(turl.keyword())); + autogenerate_keyword ? std::string() : base::UTF16ToUTF8(turl.keyword())); se_specifics->set_favicon_url(turl.favicon_url().spec()); se_specifics->set_url(url); se_specifics->set_safe_for_autoreplace(turl.safe_for_autoreplace()); @@ -1261,12 +1262,12 @@ TEST_F(TemplateURLServiceSyncTest, TwoAutogeneratedKeywordsUsingGoogleBaseURL) { syncer::SyncChange key1_change = processor()->change_for_guid("key1"); EXPECT_EQ(syncer::SyncChange::ACTION_UPDATE, key1_change.change_type()); EXPECT_EQ(keyword1->keyword(), - UTF8ToUTF16(GetKeyword(key1_change.sync_data()))); + base::UTF8ToUTF16(GetKeyword(key1_change.sync_data()))); ASSERT_TRUE(processor()->contains_guid("key2")); syncer::SyncChange key2_change = processor()->change_for_guid("key2"); EXPECT_EQ(syncer::SyncChange::ACTION_UPDATE, key2_change.change_type()); EXPECT_EQ(keyword2->keyword(), - UTF8ToUTF16(GetKeyword(key2_change.sync_data()))); + base::UTF8ToUTF16(GetKeyword(key2_change.sync_data()))); } TEST_F(TemplateURLServiceSyncTest, DuplicateEncodingsRemoved) { diff --git a/chrome/browser/search_engines/template_url_service_unittest.cc b/chrome/browser/search_engines/template_url_service_unittest.cc index a65a19e..5338d97 100644 --- a/chrome/browser/search_engines/template_url_service_unittest.cc +++ b/chrome/browser/search_engines/template_url_service_unittest.cc @@ -34,6 +34,7 @@ #include "extensions/common/manifest_constants.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; using base::Time; using base::TimeDelta; using content::BrowserThread; @@ -100,8 +101,8 @@ TemplateURL* CreateKeywordWithDate( Time date_created, Time last_modified) { TemplateURLData data; - data.short_name = UTF8ToUTF16(short_name); - data.SetKeyword(UTF8ToUTF16(keyword)); + data.short_name = base::UTF8ToUTF16(short_name); + data.SetKeyword(base::UTF8ToUTF16(keyword)); data.SetURL(url); data.suggestions_url = suggest_url; if (!alternate_url.empty()) diff --git a/chrome/browser/search_engines/template_url_service_util_unittest.cc b/chrome/browser/search_engines/template_url_service_util_unittest.cc index 163b6de..6f53721 100644 --- a/chrome/browser/search_engines/template_url_service_util_unittest.cc +++ b/chrome/browser/search_engines/template_url_service_util_unittest.cc @@ -20,7 +20,7 @@ TemplateURL* CreatePrepopulateTemplateURL(int prepopulate_id, TemplateURLID id) { TemplateURLData data; data.prepopulate_id = prepopulate_id; - data.SetKeyword(ASCIIToUTF16(keyword)); + data.SetKeyword(base::ASCIIToUTF16(keyword)); data.id = id; return new TemplateURL(NULL, data); } @@ -73,6 +73,8 @@ TEST(TemplateURLServiceUtilTest, RemoveDuplicatePrepopulateIDs) { EXPECT_EQ(local_turls.size(), prepopulated_turls.size() + num_non_prepopulated_urls); for (TemplateURLService::TemplateURLVector::const_iterator itr = - local_turls.begin(); itr != local_turls.end(); ++itr) - EXPECT_TRUE(StartsWith((*itr)->keyword(), ASCIIToUTF16("winner"), true)); + local_turls.begin(); itr != local_turls.end(); ++itr) { + EXPECT_TRUE( + StartsWith((*itr)->keyword(), base::ASCIIToUTF16("winner"), true)); + } } diff --git a/chrome/browser/search_engines/template_url_unittest.cc b/chrome/browser/search_engines/template_url_unittest.cc index a7bad67..68b907b 100644 --- a/chrome/browser/search_engines/template_url_unittest.cc +++ b/chrome/browser/search_engines/template_url_unittest.cc @@ -23,6 +23,8 @@ #include "chrome/browser/search_engines/search_terms_data_android.h" #endif +using base::ASCIIToUTF16; + // TestSearchTermsData -------------------------------------------------------- // Simple implementation of SearchTermsData. @@ -349,13 +351,14 @@ TEST_F(TemplateURLTest, URLRefTermToWide) { } to_wide_cases[] = { {"hello+world", ASCIIToUTF16("hello world")}, // Test some big-5 input. - {"%a7A%A6%6e+to+you", WideToUTF16(L"\x4f60\x597d to you")}, + {"%a7A%A6%6e+to+you", base::WideToUTF16(L"\x4f60\x597d to you")}, // Test some UTF-8 input. We should fall back to this when the encoding // doesn't look like big-5. We have a '5' in the middle, which is an invalid // Big-5 trailing byte. - {"%e4%bd%a05%e5%a5%bd+to+you", WideToUTF16(L"\x4f60\x35\x597d to you")}, + {"%e4%bd%a05%e5%a5%bd+to+you", + base::WideToUTF16(L"\x4f60\x35\x597d to you")}, // Undecodable input should stay escaped. - {"%91%01+abcd", WideToUTF16(L"%91%01 abcd")}, + {"%91%01+abcd", base::WideToUTF16(L"%91%01 abcd")}, // Make sure we convert %2B to +. {"C%2B%2B", ASCIIToUTF16("C++")}, // C%2B is escaped as C%252B, make sure we unescape it properly. @@ -457,16 +460,16 @@ TEST_F(TemplateURLTest, ReplaceArbitrarySearchTerms) { const std::string url; const std::string expected_result; } test_data[] = { - { "BIG5", WideToUTF16(L"\x60BD"), + { "BIG5", base::WideToUTF16(L"\x60BD"), "http://foo/?{searchTerms}{inputEncoding}", "http://foo/?%B1~BIG5" }, { "UTF-8", ASCIIToUTF16("blah"), "http://foo/?{searchTerms}{inputEncoding}", "http://foo/?blahUTF-8" }, - { "Shift_JIS", UTF8ToUTF16("\xe3\x81\x82"), + { "Shift_JIS", base::UTF8ToUTF16("\xe3\x81\x82"), "http://foo/{searchTerms}/bar", "http://foo/%82%A0/bar"}, - { "Shift_JIS", UTF8ToUTF16("\xe3\x81\x82 \xe3\x81\x84"), + { "Shift_JIS", base::UTF8ToUTF16("\xe3\x81\x82 \xe3\x81\x84"), "http://foo/{searchTerms}/bar", "http://foo/%82%A0%20%82%A2/bar"}, }; @@ -673,7 +676,7 @@ TEST_F(TemplateURLTest, RLZ) { ASSERT_TRUE(result.is_valid()); std::string expected_url = "http://bar/?"; if (!rlz_string.empty()) - expected_url += "rlz=" + UTF16ToUTF8(rlz_string) + "&"; + expected_url += "rlz=" + base::UTF16ToUTF8(rlz_string) + "&"; expected_url += "x"; EXPECT_EQ(expected_url, result.spec()); } diff --git a/chrome/browser/sessions/better_session_restore_browsertest.cc b/chrome/browser/sessions/better_session_restore_browsertest.cc index b7e6fac..66f0f58 100644 --- a/chrome/browser/sessions/better_session_restore_browsertest.cc +++ b/chrome/browser/sessions/better_session_restore_browsertest.cc @@ -125,10 +125,10 @@ class BetterSessionRestoreTest : public InProcessBrowserTest { BetterSessionRestoreTest() : fake_server_address_("http://www.test.com/"), test_path_("session_restore/"), - title_pass_(ASCIIToUTF16("PASS")), - title_storing_(ASCIIToUTF16("STORING")), - title_error_write_failed_(ASCIIToUTF16("ERROR_WRITE_FAILED")), - title_error_empty_(ASCIIToUTF16("ERROR_EMPTY")) { + title_pass_(base::ASCIIToUTF16("PASS")), + title_storing_(base::ASCIIToUTF16("STORING")), + title_error_write_failed_(base::ASCIIToUTF16("ERROR_WRITE_FAILED")), + title_error_empty_(base::ASCIIToUTF16("ERROR_EMPTY")) { // Set up the URL request filtering. std::vector<std::string> test_files; test_files.push_back("common.js"); diff --git a/chrome/browser/sessions/restore_on_startup_policy_handler_unittest.cc b/chrome/browser/sessions/restore_on_startup_policy_handler_unittest.cc index 7147b6b..8f635b4 100644 --- a/chrome/browser/sessions/restore_on_startup_policy_handler_unittest.cc +++ b/chrome/browser/sessions/restore_on_startup_policy_handler_unittest.cc @@ -53,8 +53,9 @@ TEST_F(RestoreOnStartupPolicyHandlerTest, CheckPolicySettings_FailsTypeCheck) { EXPECT_EQ(1U, errors().size()); EXPECT_EQ(l10n_util::GetStringFUTF16( IDS_POLICY_TYPE_ERROR, - ASCIIToUTF16(ConfigurationPolicyHandler::ValueTypeToString( - base::Value::TYPE_INTEGER))), + base::ASCIIToUTF16( + ConfigurationPolicyHandler::ValueTypeToString( + base::Value::TYPE_INTEGER))), errors().begin()->second); } @@ -78,7 +79,7 @@ TEST_F(RestoreOnStartupPolicyHandlerTest, CheckPolicySettings_UnknownValue) { EXPECT_EQ(1U, errors().size()); EXPECT_EQ(l10n_util::GetStringFUTF16( IDS_POLICY_OUT_OF_RANGE_ERROR, - ASCIIToUTF16(base::IntToString(impossible_value))), + base::ASCIIToUTF16(base::IntToString(impossible_value))), errors().begin()->second); } @@ -107,8 +108,9 @@ TEST_F(RestoreOnStartupPolicyHandlerTest, EXPECT_TRUE(CheckPolicySettings()); EXPECT_EQ(1U, errors().size()); EXPECT_TRUE(key::kCookiesSessionOnlyForUrls == errors().begin()->first); - EXPECT_EQ(l10n_util::GetStringFUTF16(IDS_POLICY_OVERRIDDEN, - ASCIIToUTF16(key::kRestoreOnStartup)), + EXPECT_EQ(l10n_util::GetStringFUTF16( + IDS_POLICY_OVERRIDDEN, + base::ASCIIToUTF16(key::kRestoreOnStartup)), errors().begin()->second); } @@ -123,8 +125,9 @@ TEST_F(RestoreOnStartupPolicyHandlerTest, EXPECT_TRUE(CheckPolicySettings()); EXPECT_EQ(1U, errors().size()); EXPECT_TRUE(key::kClearSiteDataOnExit == errors().begin()->first); - EXPECT_EQ(l10n_util::GetStringFUTF16(IDS_POLICY_OVERRIDDEN, - ASCIIToUTF16(key::kRestoreOnStartup)), + EXPECT_EQ(l10n_util::GetStringFUTF16( + IDS_POLICY_OVERRIDDEN, + base::ASCIIToUTF16(key::kRestoreOnStartup)), errors().begin()->second); } diff --git a/chrome/browser/sessions/session_types_unittest.cc b/chrome/browser/sessions/session_types_unittest.cc index aabeaf1..a4b522c 100644 --- a/chrome/browser/sessions/session_types_unittest.cc +++ b/chrome/browser/sessions/session_types_unittest.cc @@ -31,12 +31,12 @@ const content::Referrer kReferrer = content::Referrer(GURL("http://www.referrer.com"), blink::WebReferrerPolicyAlways); const GURL kVirtualURL("http://www.virtual-url.com"); -const base::string16 kTitle = ASCIIToUTF16("title"); +const base::string16 kTitle = base::ASCIIToUTF16("title"); const content::PageState kPageState = content::PageState::CreateFromEncodedData("page state"); const GURL kOriginalRequestURL("http://www.original-request.com"); const base::Time kTimestamp = syncer::ProtoTimeToTime(100); -const base::string16 kSearchTerms = ASCIIToUTF16("my search terms"); +const base::string16 kSearchTerms = base::ASCIIToUTF16("my search terms"); const GURL kFaviconURL("http://virtual-url.com/favicon.ico"); // Create a typical SessionTab protocol buffer and set an existing @@ -83,7 +83,7 @@ TEST(SessionTab, FromSyncData) { for (int i = 0; i < 5; ++i) { EXPECT_EQ(i, tab.navigations[i].index()); EXPECT_EQ(GURL("referrer"), tab.navigations[i].referrer().url); - EXPECT_EQ(ASCIIToUTF16("title"),tab.navigations[i].title()); + EXPECT_EQ(base::ASCIIToUTF16("title"),tab.navigations[i].title()); EXPECT_EQ(content::PAGE_TRANSITION_TYPED, tab.navigations[i].transition_type()); EXPECT_EQ(GURL("http://foo/" + base::IntToString(i)), @@ -120,7 +120,7 @@ TEST(SessionTab, ToSyncData) { for (int i = 0; i < 5; ++i) { EXPECT_EQ(tab.navigations[i].virtual_url().spec(), sync_data.navigation(i).virtual_url()); - EXPECT_EQ(UTF16ToUTF8(tab.navigations[i].title()), + EXPECT_EQ(base::UTF16ToUTF8(tab.navigations[i].title()), sync_data.navigation(i).title()); } EXPECT_FALSE(sync_data.has_favicon()); diff --git a/chrome/browser/sessions/tab_restore_browsertest.cc b/chrome/browser/sessions/tab_restore_browsertest.cc index 4d6e849..822dd92 100644 --- a/chrome/browser/sessions/tab_restore_browsertest.cc +++ b/chrome/browser/sessions/tab_restore_browsertest.cc @@ -546,8 +546,8 @@ IN_PROC_BROWSER_TEST_F(TabRestoreTest, RestoreTabWithSpecialURL) { // See if content is as expected. EXPECT_GT( - ui_test_utils::FindInPage(tab, ASCIIToUTF16("webkit"), true, false, NULL, - NULL), + ui_test_utils::FindInPage(tab, base::ASCIIToUTF16("webkit"), true, false, + NULL, NULL), 0); } @@ -578,7 +578,7 @@ IN_PROC_BROWSER_TEST_F(TabRestoreTest, RestoreTabWithSpecialURLOnBack) { // Go back, and see if content is as expected. GoBack(browser()); EXPECT_GT( - ui_test_utils::FindInPage(tab, ASCIIToUTF16("webkit"), true, false, NULL, - NULL), + ui_test_utils::FindInPage(tab, base::ASCIIToUTF16("webkit"), true, false, + NULL, NULL), 0); } diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc index eb4d999..16725ca 100644 --- a/chrome/browser/shell_integration_linux.cc +++ b/chrome/browser/shell_integration_linux.cc @@ -736,7 +736,7 @@ std::string GetDesktopFileContents( g_key_file_set_string(key_file, kDesktopEntry, "Type", "Application"); // Set the "Name" key. - std::string final_title = UTF16ToUTF8(title); + std::string final_title = base::UTF16ToUTF8(title); // Make sure no endline characters can slip in and possibly introduce // additional lines (like Exec, which makes it a security risk). Also // use the URL as a default when the title is empty. @@ -806,7 +806,7 @@ std::string GetDirectoryFileContents(const base::string16& title, g_key_file_set_string(key_file, kDesktopEntry, "Version", "1.0"); g_key_file_set_string(key_file, kDesktopEntry, "Type", "Directory"); - std::string final_title = UTF16ToUTF8(title); + std::string final_title = base::UTF16ToUTF8(title); g_key_file_set_string(key_file, kDesktopEntry, "Name", final_title.c_str()); if (!icon_name.empty()) { g_key_file_set_string(key_file, kDesktopEntry, "Icon", icon_name.c_str()); diff --git a/chrome/browser/shell_integration_linux_unittest.cc b/chrome/browser/shell_integration_linux_unittest.cc index b595e36..3bb6ba4 100644 --- a/chrome/browser/shell_integration_linux_unittest.cc +++ b/chrome/browser/shell_integration_linux_unittest.cc @@ -573,7 +573,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { GURL(test_cases[i].url), std::string(), base::FilePath(), - ASCIIToUTF16(test_cases[i].title), + base::ASCIIToUTF16(test_cases[i].title), test_cases[i].icon_name, base::FilePath(), test_cases[i].nodisplay)); @@ -618,7 +618,7 @@ TEST(ShellIntegrationTest, GetDirectoryFileContents) { EXPECT_EQ( test_cases[i].expected_output, ShellIntegrationLinux::GetDirectoryFileContents( - ASCIIToUTF16(test_cases[i].title), + base::ASCIIToUTF16(test_cases[i].title), test_cases[i].icon_name)); } } diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc index 3772dfb..816cd46 100644 --- a/chrome/browser/shell_integration_win.cc +++ b/chrome/browser/shell_integration_win.cc @@ -59,7 +59,7 @@ base::string16 GetProfileIdFromPath(const base::FilePath& profile_path) { if (chrome::GetDefaultUserDataDirectory(&default_user_data_dir) && profile_path.DirName() == default_user_data_dir && profile_path.BaseName().value() == - ASCIIToUTF16(chrome::kInitialProfile)) { + base::ASCIIToUTF16(chrome::kInitialProfile)) { return base::string16(); } @@ -106,18 +106,20 @@ base::string16 GetExpectedAppId(const CommandLine& command_line, profile_subdir = command_line.GetSwitchValuePath(switches::kProfileDirectory); } else { - profile_subdir = base::FilePath(ASCIIToUTF16(chrome::kInitialProfile)); + profile_subdir = + base::FilePath(base::ASCIIToUTF16(chrome::kInitialProfile)); } DCHECK(!profile_subdir.empty()); base::FilePath profile_path = user_data_dir.Append(profile_subdir); base::string16 app_name; if (command_line.HasSwitch(switches::kApp)) { - app_name = UTF8ToUTF16(web_app::GenerateApplicationNameFromURL( + app_name = base::UTF8ToUTF16(web_app::GenerateApplicationNameFromURL( GURL(command_line.GetSwitchValueASCII(switches::kApp)))); } else if (command_line.HasSwitch(switches::kAppId)) { - app_name = UTF8ToUTF16(web_app::GenerateApplicationNameFromExtensionId( - command_line.GetSwitchValueASCII(switches::kAppId))); + app_name = base::UTF8ToUTF16( + web_app::GenerateApplicationNameFromExtensionId( + command_line.GetSwitchValueASCII(switches::kAppId))); } else if (command_line.HasSwitch(switches::kShowAppList)) { app_name = GetAppListAppName(); } else { @@ -232,7 +234,7 @@ bool ShellIntegration::SetAsDefaultProtocolClient(const std::string& protocol) { return false; } - base::string16 wprotocol(UTF8ToUTF16(protocol)); + base::string16 wprotocol(base::UTF8ToUTF16(protocol)); BrowserDistribution* dist = BrowserDistribution::GetDistribution(); if (!ShellUtil::MakeChromeDefaultProtocolClient(dist, chrome_exe.value(), wprotocol)) { @@ -271,7 +273,7 @@ bool ShellIntegration::SetAsDefaultProtocolClientInteractive( } BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - base::string16 wprotocol(UTF8ToUTF16(protocol)); + base::string16 wprotocol(base::UTF8ToUTF16(protocol)); if (!ShellUtil::ShowMakeChromeDefaultProtocolClientSystemUI( dist, chrome_exe.value(), wprotocol)) { LOG(ERROR) << "Failed to launch the set-default-client Windows UI."; @@ -290,7 +292,8 @@ ShellIntegration::DefaultWebClientState ShellIntegration::GetDefaultBrowser() { ShellIntegration::DefaultWebClientState ShellIntegration::IsDefaultProtocolClient(const std::string& protocol) { return GetDefaultWebClientStateFromShellUtilDefaultState( - ShellUtil::GetChromeDefaultProtocolClientState(UTF8ToUTF16(protocol))); + ShellUtil::GetChromeDefaultProtocolClientState( + base::UTF8ToUTF16(protocol))); } std::string ShellIntegration::GetApplicationForProtocol(const GURL& url) { diff --git a/chrome/browser/shell_integration_win_unittest.cc b/chrome/browser/shell_integration_win_unittest.cc index 2c63b5c..fc432ff 100644 --- a/chrome/browser/shell_integration_win_unittest.cc +++ b/chrome/browser/shell_integration_win_unittest.cc @@ -67,8 +67,8 @@ class ShellIntegrationWinMigrateShortcutTest : public testing::Test { extension_id_ = L"chromiumexampleappidforunittests"; base::string16 app_name = - UTF8ToUTF16(web_app::GenerateApplicationNameFromExtensionId( - UTF16ToUTF8(extension_id_))); + base::UTF8ToUTF16(web_app::GenerateApplicationNameFromExtensionId( + base::UTF16ToUTF8(extension_id_))); extension_app_id_ = ShellIntegration::GetAppModelIdForProfile(app_name, default_profile_path); diff --git a/chrome/browser/signin/about_signin_internals.cc b/chrome/browser/signin/about_signin_internals.cc index cdec3db..d3af87b7 100644 --- a/chrome/browser/signin/about_signin_internals.cc +++ b/chrome/browser/signin/about_signin_internals.cc @@ -59,7 +59,8 @@ void AboutSigninInternals::NotifySigninValueChanged( field_index < signin_status_.timed_signin_fields.size()); Time now = Time::NowFromSystemTime(); - std::string time_as_str = UTF16ToUTF8(base::TimeFormatFriendlyDate(now)); + std::string time_as_str = + base::UTF16ToUTF8(base::TimeFormatFriendlyDate(now)); TimedSigninStatusValue timed_value(value, time_as_str); signin_status_.timed_signin_fields[field_index] = timed_value; diff --git a/chrome/browser/signin/signin_manager.cc b/chrome/browser/signin/signin_manager.cc index 72e446c3..d3dc64e 100644 --- a/chrome/browser/signin/signin_manager.cc +++ b/chrome/browser/signin/signin_manager.cc @@ -407,7 +407,7 @@ bool SigninManager::IsUsernameAllowedByPolicy(const std::string& username, // are not valid regular expressions - they should instead be ".*@foo.com"). // For convenience, detect these patterns and insert a "." character at the // front. - base::string16 pattern = UTF8ToUTF16(policy); + base::string16 pattern = base::UTF8ToUTF16(policy); if (pattern[0] == L'*') pattern.insert(pattern.begin(), L'.'); @@ -421,7 +421,7 @@ bool SigninManager::IsUsernameAllowedByPolicy(const std::string& username, // break signin than to quietly allow users to sign in). return false; } - base::string16 username16 = UTF8ToUTF16(username); + base::string16 username16 = base::UTF8ToUTF16(username); icu::UnicodeString icu_input(username16.data(), username16.length()); matcher.reset(icu_input); status = U_ZERO_ERROR; diff --git a/chrome/browser/signin/signin_names_io_thread.cc b/chrome/browser/signin/signin_names_io_thread.cc index e1f7b31..0a79509 100644 --- a/chrome/browser/signin/signin_names_io_thread.cc +++ b/chrome/browser/signin/signin_names_io_thread.cc @@ -65,13 +65,13 @@ void SigninNamesOnIOThread::Observe( case chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL: { const GoogleServiceSigninSuccessDetails* signin_details = content::Details<GoogleServiceSigninSuccessDetails>(details).ptr(); - PostTaskToIOThread(type, UTF8ToUTF16(signin_details->username)); + PostTaskToIOThread(type, base::UTF8ToUTF16(signin_details->username)); break; } case chrome::NOTIFICATION_GOOGLE_SIGNED_OUT: { const GoogleServiceSignoutDetails* signout_details = content::Details<GoogleServiceSignoutDetails>(details).ptr(); - PostTaskToIOThread(type, UTF8ToUTF16(signout_details->username)); + PostTaskToIOThread(type, base::UTF8ToUTF16(signout_details->username)); break; } default: diff --git a/chrome/browser/signin/signin_names_io_thread_unittest.cc b/chrome/browser/signin/signin_names_io_thread_unittest.cc index 24156ce..f946c29 100644 --- a/chrome/browser/signin/signin_names_io_thread_unittest.cc +++ b/chrome/browser/signin/signin_names_io_thread_unittest.cc @@ -52,7 +52,8 @@ void SigninNamesOnIOThreadTest::TearDown() { } void SigninNamesOnIOThreadTest::SimulateSignin(const base::string16& email) { - GoogleServiceSigninSuccessDetails details(UTF16ToUTF8(email), "password"); + GoogleServiceSigninSuccessDetails details( + base::UTF16ToUTF8(email), "password"); content::NotificationService::current()->Notify( chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, content::Source<Profile>(NULL), @@ -60,7 +61,7 @@ void SigninNamesOnIOThreadTest::SimulateSignin(const base::string16& email) { } void SigninNamesOnIOThreadTest::SimulateSignout(const base::string16& email) { - GoogleServiceSignoutDetails details(UTF16ToUTF8(email)); + GoogleServiceSignoutDetails details(base::UTF16ToUTF8(email)); content::NotificationService::current()->Notify( chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, content::Source<Profile>(NULL), @@ -72,7 +73,8 @@ void SigninNamesOnIOThreadTest::AddNewProfile(const base::string16& name, ProfileInfoCache* cache = testing_profile_manager_.profile_info_cache(); const base::FilePath& user_data_dir = cache->GetUserDataDir(); #if defined(OS_POSIX) - const base::FilePath profile_dir = user_data_dir.Append(UTF16ToUTF8(name)); + const base::FilePath profile_dir = + user_data_dir.Append(base::UTF16ToUTF8(name)); #else const base::FilePath profile_dir = user_data_dir.Append(name); #endif @@ -86,7 +88,7 @@ TEST_F(SigninNamesOnIOThreadTest, Basic) { } TEST_F(SigninNamesOnIOThreadTest, Signin) { - const base::string16 email = UTF8ToUTF16("foo@gmail.com"); + const base::string16 email = base::UTF8ToUTF16("foo@gmail.com"); SimulateSignin(email); const SigninNamesOnIOThread::EmailSet& emails = signin_names_.GetEmails(); @@ -95,7 +97,7 @@ TEST_F(SigninNamesOnIOThreadTest, Signin) { } TEST_F(SigninNamesOnIOThreadTest, Signout) { - const base::string16 email = UTF8ToUTF16("foo@gmail.com"); + const base::string16 email = base::UTF8ToUTF16("foo@gmail.com"); SimulateSignin(email); SimulateSignout(email); @@ -104,9 +106,9 @@ TEST_F(SigninNamesOnIOThreadTest, Signout) { } TEST_F(SigninNamesOnIOThreadTest, HandleUnknownSignout) { - const base::string16 email = UTF8ToUTF16("foo@gmail.com"); + const base::string16 email = base::UTF8ToUTF16("foo@gmail.com"); SimulateSignin(email); - SimulateSignout(UTF8ToUTF16("bar@gmail.com")); + SimulateSignout(base::UTF8ToUTF16("bar@gmail.com")); const SigninNamesOnIOThread::EmailSet& emails = signin_names_.GetEmails(); ASSERT_EQ(1u, emails.size()); @@ -115,11 +117,11 @@ TEST_F(SigninNamesOnIOThreadTest, HandleUnknownSignout) { TEST_F(SigninNamesOnIOThreadTest, StartWithConnectedProfiles) { // Setup a couple of connected profiles, and one unconnected. - const base::string16 email1 = UTF8ToUTF16("foo@gmail.com"); - const base::string16 email2 = UTF8ToUTF16("bar@gmail.com"); - AddNewProfile(UTF8ToUTF16("foo"), email1); - AddNewProfile(UTF8ToUTF16("bar"), email2); - AddNewProfile(UTF8ToUTF16("toto"), base::string16()); + const base::string16 email1 = base::UTF8ToUTF16("foo@gmail.com"); + const base::string16 email2 = base::UTF8ToUTF16("bar@gmail.com"); + AddNewProfile(base::UTF8ToUTF16("foo"), email1); + AddNewProfile(base::UTF8ToUTF16("bar"), email2); + AddNewProfile(base::UTF8ToUTF16("toto"), base::string16()); SigninNamesOnIOThread signin_names; diff --git a/chrome/browser/signin/signin_ui_util.cc b/chrome/browser/signin/signin_ui_util.cc index 818bd4c..314f67b 100644 --- a/chrome/browser/signin/signin_ui_util.cc +++ b/chrome/browser/signin/signin_ui_util.cc @@ -75,9 +75,8 @@ base::string16 GetSigninMenuLabel(Profile* profile) { if (signin_manager) username = signin_manager->GetAuthenticatedUsername(); if (!username.empty() && !signin_manager->AuthInProgress()) { - base::string16 elided_username = gfx::ElideEmail(UTF8ToUTF16(username), - gfx::FontList(), - kUsernameMaxWidth); + base::string16 elided_username = gfx::ElideEmail( + base::UTF8ToUTF16(username), gfx::FontList(), kUsernameMaxWidth); return l10n_util::GetStringFUTF16(IDS_SYNC_MENU_SYNCED_LABEL, elided_username); } @@ -93,7 +92,7 @@ void GetStatusLabelsForAuthError(Profile* profile, base::string16* status_label, base::string16* link_label) { base::string16 username = - UTF8ToUTF16(signin_manager.GetAuthenticatedUsername()); + base::UTF8ToUTF16(signin_manager.GetAuthenticatedUsername()); base::string16 product_name = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); if (link_label) link_label->assign(l10n_util::GetStringUTF16(IDS_SYNC_RELOGIN_LINK_LABEL)); diff --git a/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc b/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc index 9c27813..3f3d25d 100644 --- a/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc +++ b/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc @@ -99,10 +99,10 @@ class ChromeSpeechRecognitionManagerDelegate::OptionalRequestInfo base::string16 device_model = SpeechRecognitionManager::GetInstance()->GetAudioInputDeviceModel(); #if defined(OS_WIN) - value_ = UTF16ToUTF8( + value_ = base::UTF16ToUTF8( installer::WMIComputerSystem::GetModel() + L"|" + device_model); #else // defined(OS_WIN) - value_ = UTF16ToUTF8(device_model); + value_ = base::UTF16ToUTF8(device_model); #endif // defined(OS_WIN) } diff --git a/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc b/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc index f1380c9..0ee92b6 100644 --- a/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc +++ b/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc @@ -126,7 +126,7 @@ class SpeechRecognitionBubbleControllerTest static void ActivateBubble() { if (MockSpeechRecognitionBubble::type() != MockSpeechRecognitionBubble::BUBBLE_TEST_FOCUS_CHANGED) { - test_fixture_->controller_->SetBubbleMessage(ASCIIToUTF16("Test")); + test_fixture_->controller_->SetBubbleMessage(base::ASCIIToUTF16("Test")); } } diff --git a/chrome/browser/speech/tts_win.cc b/chrome/browser/speech/tts_win.cc index 1602fc2..f85cc4d 100644 --- a/chrome/browser/speech/tts_win.cc +++ b/chrome/browser/speech/tts_win.cc @@ -107,7 +107,7 @@ bool TtsPlatformImplWin::Speak( // TODO(dmazzoni): convert SSML to SAPI xml. http://crbug.com/88072 - utterance_ = UTF8ToWide(src_utterance); + utterance_ = base::UTF8ToWide(src_utterance); utterance_id_ = utterance_id; char_position_ = 0; std::wstring merged_utterance = prefix + utterance_ + suffix; diff --git a/chrome/browser/spellchecker/feedback.h b/chrome/browser/spellchecker/feedback.h index cbf1f20..91a0abd 100644 --- a/chrome/browser/spellchecker/feedback.h +++ b/chrome/browser/spellchecker/feedback.h @@ -23,8 +23,8 @@ namespace spellcheck { // Stores user feedback to spellcheck suggestions. Sample usage: // Feedback feedback; // feedback.AddMisspelling(renderer_process_id, Misspelling( -// ASCIIToUTF16("Helllo world"), 0, 6, std::vector<base::string16>(), -// GenerateRandomHash())); +// base::ASCIIToUTF16("Helllo world"), 0, 6, +// std::vector<base::string16>(), GenerateRandomHash())); // feedback.FinalizeRemovedMisspellings(renderer_process_id, // std::vector<uint32>()); // ProcessFeedback(feedback.GetMisspellingsInRenderer(renderer_process_id)); diff --git a/chrome/browser/spellchecker/feedback_sender_unittest.cc b/chrome/browser/spellchecker/feedback_sender_unittest.cc index 295a5eb..3c93034 100644 --- a/chrome/browser/spellchecker/feedback_sender_unittest.cc +++ b/chrome/browser/spellchecker/feedback_sender_unittest.cc @@ -41,7 +41,7 @@ SpellCheckResult BuildSpellCheckResult() { return SpellCheckResult(SpellCheckResult::SPELLING, kMisspellingStart, kMisspellingLength, - UTF8ToUTF16("Hello")); + base::UTF8ToUTF16("Hello")); } // Returns the number of times that |needle| appears in |haystack| without @@ -96,7 +96,7 @@ class FeedbackSenderTest : public testing::Test { uint32 AddPendingFeedback() { std::vector<SpellCheckResult> results(1, BuildSpellCheckResult()); feedback_->OnSpellcheckResults(kRendererProcessId, - UTF8ToUTF16(kText), + base::UTF8ToUTF16(kText), std::vector<SpellCheckMarker>(), &results); return results[0].hash; @@ -241,7 +241,7 @@ TEST_F(FeedbackSenderTest, IgnoreFeedbackMarkerNotInDocument) { TEST_F(FeedbackSenderTest, ManuallyCorrectedFeedback) { uint32 hash = AddPendingFeedback(); static const std::string kManualCorrection = "Howdy"; - feedback_->ManuallyCorrected(hash, ASCIIToUTF16(kManualCorrection)); + feedback_->ManuallyCorrected(hash, base::ASCIIToUTF16(kManualCorrection)); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, std::vector<uint32>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"MANUALLY_CORRECTED\"")); @@ -255,15 +255,15 @@ TEST_F(FeedbackSenderTest, BatchFeedback) { results.push_back(SpellCheckResult(SpellCheckResult::SPELLING, kMisspellingStart, kMisspellingLength, - ASCIIToUTF16("Hello"))); + base::ASCIIToUTF16("Hello"))); static const int kSecondMisspellingStart = 7; static const int kSecondMisspellingLength = 5; results.push_back(SpellCheckResult(SpellCheckResult::SPELLING, kSecondMisspellingStart, kSecondMisspellingLength, - ASCIIToUTF16("world"))); + base::ASCIIToUTF16("world"))); feedback_->OnSpellcheckResults(kRendererProcessId, - UTF8ToUTF16(kText), + base::UTF8ToUTF16(kText), std::vector<SpellCheckMarker>(), &results); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, @@ -310,9 +310,9 @@ TEST_F(FeedbackSenderTest, SessionExpirationFeedback) { SpellCheckResult(SpellCheckResult::SPELLING, kMisspellingStart, kMisspellingLength, - ASCIIToUTF16("Hello"))); + base::ASCIIToUTF16("Hello"))); feedback_->OnSpellcheckResults(kRendererProcessId, - UTF8ToUTF16(kText), + base::UTF8ToUTF16(kText), std::vector<SpellCheckMarker>(), &results); uint32 original_hash = results[0].hash; @@ -347,9 +347,9 @@ TEST_F(FeedbackSenderTest, SessionExpirationFeedback) { results[0] = SpellCheckResult(SpellCheckResult::SPELLING, kMisspellingStart, kMisspellingLength, - ASCIIToUTF16("Hello")); + base::ASCIIToUTF16("Hello")); feedback_->OnSpellcheckResults( - kRendererProcessId, UTF8ToUTF16(kText), original_markers, &results); + kRendererProcessId, base::UTF8ToUTF16(kText), original_markers, &results); uint32 updated_hash = results[0].hash; EXPECT_NE(updated_hash, original_hash); remaining_markers[0] = updated_hash; @@ -506,12 +506,12 @@ TEST_F(FeedbackSenderTest, MatchDupliateResultsWithExistingMarkers) { SpellCheckResult(SpellCheckResult::SPELLING, kMisspellingStart, kMisspellingLength, - ASCIIToUTF16("Hello"))); + base::ASCIIToUTF16("Hello"))); std::vector<SpellCheckMarker> markers( 1, SpellCheckMarker(hash, results[0].location)); EXPECT_EQ(static_cast<uint32>(0), results[0].hash); feedback_->OnSpellcheckResults( - kRendererProcessId, UTF8ToUTF16(kText), markers, &results); + kRendererProcessId, base::UTF8ToUTF16(kText), markers, &results); EXPECT_EQ(hash, results[0].hash); } @@ -522,12 +522,12 @@ TEST_F(FeedbackSenderTest, MultipleAddToDictFeedback) { static const int kSentenceLength = 14; static const int kNumberOfSentences = 2; static const base::string16 kTextWithDuplicates = - ASCIIToUTF16("Helllo world. Helllo world."); + base::ASCIIToUTF16("Helllo world. Helllo world."); for (int i = 0; i < kNumberOfSentences; ++i) { results.push_back(SpellCheckResult(SpellCheckResult::SPELLING, kMisspellingStart + i * kSentenceLength, kMisspellingLength, - ASCIIToUTF16("Hello"))); + base::ASCIIToUTF16("Hello"))); } static const int kNumberOfRenderers = 2; int last_renderer_process_id = -1; @@ -571,17 +571,17 @@ TEST_F(FeedbackSenderTest, AddToDictOnlyPending) { TEST_F(FeedbackSenderTest, IgnoreOutOfBounds) { std::vector<SpellCheckResult> results; results.push_back(SpellCheckResult( - SpellCheckResult::SPELLING, 0, 100, UTF8ToUTF16("Hello"))); + SpellCheckResult::SPELLING, 0, 100, base::UTF8ToUTF16("Hello"))); results.push_back(SpellCheckResult( - SpellCheckResult::SPELLING, 100, 3, UTF8ToUTF16("world"))); - results.push_back( - SpellCheckResult(SpellCheckResult::SPELLING, -1, 3, UTF8ToUTF16("how"))); - results.push_back( - SpellCheckResult(SpellCheckResult::SPELLING, 0, 0, UTF8ToUTF16("are"))); - results.push_back( - SpellCheckResult(SpellCheckResult::SPELLING, 2, -1, UTF8ToUTF16("you"))); + SpellCheckResult::SPELLING, 100, 3, base::UTF8ToUTF16("world"))); + results.push_back(SpellCheckResult( + SpellCheckResult::SPELLING, -1, 3, base::UTF8ToUTF16("how"))); + results.push_back(SpellCheckResult( + SpellCheckResult::SPELLING, 0, 0, base::UTF8ToUTF16("are"))); + results.push_back(SpellCheckResult( + SpellCheckResult::SPELLING, 2, -1, base::UTF8ToUTF16("you"))); feedback_->OnSpellcheckResults(kRendererProcessId, - UTF8ToUTF16(kText), + base::UTF8ToUTF16(kText), std::vector<SpellCheckMarker>(), &results); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, diff --git a/chrome/browser/spellchecker/feedback_unittest.cc b/chrome/browser/spellchecker/feedback_unittest.cc index d153603..e1c773d 100644 --- a/chrome/browser/spellchecker/feedback_unittest.cc +++ b/chrome/browser/spellchecker/feedback_unittest.cc @@ -9,6 +9,8 @@ #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace spellcheck { namespace { diff --git a/chrome/browser/spellchecker/misspelling.h b/chrome/browser/spellchecker/misspelling.h index 6fe98dd8..7db83f7 100644 --- a/chrome/browser/spellchecker/misspelling.h +++ b/chrome/browser/spellchecker/misspelling.h @@ -19,11 +19,11 @@ // Stores user feedback to a spellcheck suggestion. Sample usage: // Misspelling misspelling. -// misspelling.context = ASCIIToUTF16("Helllo world"); +// misspelling.context = base::ASCIIToUTF16("Helllo world"); // misspelling.location = 0; // misspelling.length = 6; // misspelling.suggestions = -// std::vector<base::string16>(1, ASCIIToUTF16("Hello")); +// std::vector<base::string16>(1, base::ASCIIToUTF16("Hello")); // misspelling.hash = GenerateRandomHash(); // misspelling.action.type = SpellcheckAction::TYPE_SELECT; // misspelling.action.index = 0; diff --git a/chrome/browser/spellchecker/misspelling_unittest.cc b/chrome/browser/spellchecker/misspelling_unittest.cc index 632b171..bfc1628 100644 --- a/chrome/browser/spellchecker/misspelling_unittest.cc +++ b/chrome/browser/spellchecker/misspelling_unittest.cc @@ -13,12 +13,12 @@ TEST(MisspellingTest, SerializeTest) { Misspelling misspelling; - misspelling.context = ASCIIToUTF16("How doe sit know"); + misspelling.context = base::ASCIIToUTF16("How doe sit know"); misspelling.location = 4; misspelling.length = 7; misspelling.timestamp = base::Time::FromJsTime(42); misspelling.hash = 9001; - misspelling.suggestions.push_back(ASCIIToUTF16("does it")); + misspelling.suggestions.push_back(base::ASCIIToUTF16("does it")); scoped_ptr<base::Value> expected(base::JSONReader::Read( "{\"originalText\": \"How doe sit know\"," @@ -35,10 +35,10 @@ TEST(MisspellingTest, SerializeTest) { TEST(MisspellingTest, GetMisspelledStringTest) { Misspelling misspelling; - misspelling.context = ASCIIToUTF16("How doe sit know"); + misspelling.context = base::ASCIIToUTF16("How doe sit know"); misspelling.location = 4; misspelling.length = 7; - EXPECT_EQ(ASCIIToUTF16("doe sit"), misspelling.GetMisspelledString()); + EXPECT_EQ(base::ASCIIToUTF16("doe sit"), misspelling.GetMisspelledString()); misspelling.length = 0; EXPECT_EQ(base::string16(), misspelling.GetMisspelledString()); diff --git a/chrome/browser/spellchecker/spellcheck_action_unittest.cc b/chrome/browser/spellchecker/spellcheck_action_unittest.cc index 5fd4522..ce3a86d 100644 --- a/chrome/browser/spellchecker/spellcheck_action_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_action_unittest.cc @@ -56,29 +56,33 @@ TEST(SpellcheckActionTest, SerializeTest) { std::string expected; } kTestCases[] = { { SpellcheckAction( - SpellcheckAction::TYPE_ADD_TO_DICT, -1, ASCIIToUTF16("nothing")), + SpellcheckAction::TYPE_ADD_TO_DICT, -1, + base::ASCIIToUTF16("nothing")), "{\"actionType\": \"ADD_TO_DICT\"}" }, { SpellcheckAction( - SpellcheckAction::TYPE_IGNORE, -1, ASCIIToUTF16("nothing")), + SpellcheckAction::TYPE_IGNORE, -1, base::ASCIIToUTF16("nothing")), "{\"actionType\": \"IGNORE\"}" }, { SpellcheckAction( - SpellcheckAction::TYPE_IN_DICTIONARY, -1, ASCIIToUTF16("nothing")), + SpellcheckAction::TYPE_IN_DICTIONARY, -1, + base::ASCIIToUTF16("nothing")), "{\"actionType\": \"IN_DICTIONARY\"}" }, { SpellcheckAction( - SpellcheckAction::TYPE_MANUALLY_CORRECTED, -1, ASCIIToUTF16("hello")), + SpellcheckAction::TYPE_MANUALLY_CORRECTED, -1, + base::ASCIIToUTF16("hello")), "{\"actionTargetValue\": \"hello\"," "\"actionType\": \"MANUALLY_CORRECTED\"}" }, { SpellcheckAction( - SpellcheckAction::TYPE_NO_ACTION, -1, ASCIIToUTF16("nothing")), + SpellcheckAction::TYPE_NO_ACTION, -1, base::ASCIIToUTF16("nothing")), "{\"actionType\": \"NO_ACTION\"}" }, { SpellcheckAction( - SpellcheckAction::TYPE_PENDING, -1, ASCIIToUTF16("nothing")), + SpellcheckAction::TYPE_PENDING, -1, base::ASCIIToUTF16("nothing")), "{\"actionType\": \"PENDING\"}" }, { SpellcheckAction( - SpellcheckAction::TYPE_PENDING_IGNORE, -1, ASCIIToUTF16("nothing")), + SpellcheckAction::TYPE_PENDING_IGNORE, -1, + base::ASCIIToUTF16("nothing")), "{\"actionType\": \"PENDING\"}" }, { SpellcheckAction( - SpellcheckAction::TYPE_SELECT, 42, ASCIIToUTF16("nothing")), + SpellcheckAction::TYPE_SELECT, 42, base::ASCIIToUTF16("nothing")), "{\"actionTargetIndex\": 42, \"actionType\": \"SELECT\"}" }, }; for (size_t i = 0; i < kNumTestCases; ++i) { diff --git a/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc b/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc index ab7348a..e24a9e5 100644 --- a/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc @@ -110,7 +110,7 @@ TEST_F(SpellcheckHostMetricsTest, RecordWordCountsDiscardsDuplicates) { }; // Ensure all histograms exist. - metrics()->RecordCheckedWordStats(ASCIIToUTF16("test"), false); + metrics()->RecordCheckedWordStats(base::ASCIIToUTF16("test"), false); RecordWordCountsForTesting(); // Get baselines for all affected histograms. diff --git a/chrome/browser/spellchecker/spellcheck_message_filter.cc b/chrome/browser/spellchecker/spellcheck_message_filter.cc index 778f7e3..091c342 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter.cc @@ -144,7 +144,7 @@ void SpellCheckMessageFilter::OnTextCheckComplete( // in-dictionary feedback. std::vector<SpellCheckResult>::iterator write_iter; std::vector<SpellCheckResult>::iterator iter; - std::string text_copy = UTF16ToUTF8(text); + std::string text_copy = base::UTF16ToUTF8(text); for (iter = write_iter = results_copy.begin(); iter != results_copy.end(); ++iter) { diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_mac_browsertest.cc b/chrome/browser/spellchecker/spellcheck_message_filter_mac_browsertest.cc index 149e192..4da3f1d 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_mac_browsertest.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter_mac_browsertest.cc @@ -44,7 +44,7 @@ IN_PROC_BROWSER_TEST_F(SpellCheckMessageFilterMacBrowserTest, new TestingSpellCheckMessageFilter(base::MessageLoopForUI::current())); SpellCheckHostMsg_RequestTextCheck to_be_received( - 123, 456, UTF8ToUTF16("zz."), std::vector<SpellCheckMarker>()); + 123, 456, base::UTF8ToUTF16("zz."), std::vector<SpellCheckMarker>()); bool handled = false; target->OnMessageReceived(to_be_received, &handled); EXPECT_TRUE(handled); diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_mac_unittest.cc b/chrome/browser/spellchecker/spellcheck_message_filter_mac_unittest.cc index 1d4055a..4cab6d6 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_mac_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter_mac_unittest.cc @@ -16,8 +16,8 @@ namespace { TEST(SpellcheckMessageFilterMacTest, CombineResults) { std::vector<SpellCheckResult> local_results; std::vector<SpellCheckResult> remote_results; - base::string16 remote_suggestion = ASCIIToUTF16("remote"); - base::string16 local_suggestion = ASCIIToUTF16("local"); + base::string16 remote_suggestion = base::ASCIIToUTF16("remote"); + base::string16 local_suggestion = base::ASCIIToUTF16("local"); // Remote-only result - must be flagged as GRAMMAR after combine remote_results.push_back( diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc b/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc index 4695297..ecde185 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc @@ -80,17 +80,17 @@ TEST(SpellCheckMessageFilterTest, OnTextCheckCompleteTestCustomDictionary) { static const int kRouteId = 0; static const int kCallbackId = 0; static const std::vector<SpellCheckMarker> kMarkers; - static const base::string16 kText = ASCIIToUTF16("Helllo warld."); + static const base::string16 kText = base::ASCIIToUTF16("Helllo warld."); static const bool kSuccess = true; static const SpellCheckResult::Decoration kDecoration = SpellCheckResult::SPELLING; static const int kLocation = 7; static const int kLength = 5; - static const base::string16 kReplacement = ASCIIToUTF16("world"); + static const base::string16 kReplacement = base::ASCIIToUTF16("world"); std::vector<SpellCheckResult> results; results.push_back(SpellCheckResult( - SpellCheckResult::SPELLING, 0, 6, ASCIIToUTF16("Hello"))); + SpellCheckResult::SPELLING, 0, 6, base::ASCIIToUTF16("Hello"))); results.push_back( SpellCheckResult(kDecoration, kLocation, kLength, kReplacement)); @@ -124,14 +124,14 @@ TEST(SpellCheckMessageFilterTest, OnTextCheckCompleteTestCustomDictionary) { TEST(SpellCheckMessageFilterTest, OnTextCheckCompleteTest) { std::vector<SpellCheckResult> results; results.push_back(SpellCheckResult( - SpellCheckResult::SPELLING, 0, 6, ASCIIToUTF16("Hello"))); + SpellCheckResult::SPELLING, 0, 6, base::ASCIIToUTF16("Hello"))); results.push_back(SpellCheckResult( - SpellCheckResult::SPELLING, 7, 7, ASCIIToUTF16("world"))); + SpellCheckResult::SPELLING, 7, 7, base::ASCIIToUTF16("world"))); scoped_refptr<TestingSpellCheckMessageFilter> filter( new TestingSpellCheckMessageFilter); filter->OnTextCheckComplete(1, 1, std::vector<SpellCheckMarker>(), - true, ASCIIToUTF16("Helllo walrd"), results); + true, base::ASCIIToUTF16("Helllo walrd"), results); EXPECT_EQ(static_cast<size_t>(1), filter->sent_messages.size()); int sent_identifier = -1; diff --git a/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc b/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc index 6692c81..a5510a6 100644 --- a/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc @@ -59,7 +59,7 @@ TEST_F(SpellcheckMacTest, IgnoreWords_EN_US) { }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { - const base::string16 word(ASCIIToUTF16(kTestCases[i])); + const base::string16 word(base::ASCIIToUTF16(kTestCases[i])); const int doc_tag = spellcheck_mac::GetDocumentTag(); // The word should show up as misspelled. @@ -354,7 +354,7 @@ TEST_F(SpellcheckMacTest, SpellCheckSuggestions_EN_US) { }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { - const base::string16 word(ASCIIToUTF16(kTestCases[i].input)); + const base::string16 word(base::ASCIIToUTF16(kTestCases[i].input)); EXPECT_FALSE(spellcheck_mac::CheckSpelling(word, 0)) << word; // Check if the suggested words occur. @@ -362,7 +362,7 @@ TEST_F(SpellcheckMacTest, SpellCheckSuggestions_EN_US) { spellcheck_mac::FillSuggestionList(word, &suggestions); bool suggested_word_is_present = false; const base::string16 suggested_word( - ASCIIToUTF16(kTestCases[i].suggested_word)); + base::ASCIIToUTF16(kTestCases[i].suggested_word)); for (size_t j = 0; j < suggestions.size(); j++) { if (suggestions[j].compare(suggested_word) == 0) { suggested_word_is_present = true; @@ -378,7 +378,7 @@ TEST_F(SpellcheckMacTest, SpellCheckSuggestions_EN_US) { // the language used in that sentence. Test that it is filtered out from // RequestTextCheck results. TEST_F(SpellcheckMacTest, SpellCheckIgnoresOrthography) { - base::string16 test_string(ASCIIToUTF16("Icland is awesome.")); + base::string16 test_string(base::ASCIIToUTF16("Icland is awesome.")); spellcheck_mac::RequestTextCheck(0, test_string, callback_); WaitForCallback(); EXPECT_TRUE(callback_finished_); diff --git a/chrome/browser/spellchecker/spelling_service_client_unittest.cc b/chrome/browser/spellchecker/spelling_service_client_unittest.cc index 8fcdc23..57c3936 100644 --- a/chrome/browser/spellchecker/spelling_service_client_unittest.cc +++ b/chrome/browser/spellchecker/spelling_service_client_unittest.cc @@ -140,7 +140,7 @@ class TestingSpellingServiceClient : public SpellingServiceClient { void SetExpectedTextCheckResult(bool success, const char* text) { success_ = success; - corrected_text_.assign(UTF8ToUTF16(text)); + corrected_text_.assign(base::UTF8ToUTF16(text)); } void CallOnURLFetchComplete() { @@ -153,7 +153,7 @@ class TestingSpellingServiceClient : public SpellingServiceClient { const base::string16& request_text, const std::vector<SpellCheckResult>& results) { EXPECT_EQ(success_, success); - base::string16 text(UTF8ToUTF16(request_text_)); + base::string16 text(base::UTF8ToUTF16(request_text_)); EXPECT_EQ(text, request_text); for (std::vector<SpellCheckResult>::const_iterator it = results.begin(); it != results.end(); ++it) { @@ -314,7 +314,7 @@ TEST_F(SpellingServiceClientTest, RequestTextCheck) { client_.RequestTextCheck( &profile_, kTests[i].request_type, - ASCIIToUTF16(kTests[i].request_text), + base::ASCIIToUTF16(kTests[i].request_text), base::Bind(&SpellingServiceClientTest::OnTextCheckComplete, base::Unretained(this), 0)); client_.CallOnURLFetchComplete(); diff --git a/chrome/browser/spellchecker/word_trimmer.h b/chrome/browser/spellchecker/word_trimmer.h index 3650dff..5b108d3 100644 --- a/chrome/browser/spellchecker/word_trimmer.h +++ b/chrome/browser/spellchecker/word_trimmer.h @@ -18,10 +18,10 @@ // size_t start = 14; // size_t end = 23; // base::string16 text = -// ASCIIToUTF16("one two three four five six seven eight"); +// base::ASCIIToUTF16("one two three four five six seven eight"); // int keep = 2; // base::string16 trimmed = TrimWords(&start, end, text, keep); -// DCHECK(trimmed == ASCIIToUTF16("two three four five six seven")); +// DCHECK(trimmed == base::ASCIIToUTF16("two three four five six seven")); // DCHECK(start == 10); // base::string16 TrimWords(size_t* start, diff --git a/chrome/browser/spellchecker/word_trimmer_unittest.cc b/chrome/browser/spellchecker/word_trimmer_unittest.cc index 6bea065..35b8e6a 100644 --- a/chrome/browser/spellchecker/word_trimmer_unittest.cc +++ b/chrome/browser/spellchecker/word_trimmer_unittest.cc @@ -7,6 +7,8 @@ #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + TEST(WordTrimmerTest, TrimWordsEmptyText) { size_t start = 0; size_t end = 0; diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc index 1e5d9c8..572ae94 100644 --- a/chrome/browser/ssl/ssl_blocking_page.cc +++ b/chrome/browser/ssl/ssl_blocking_page.cc @@ -41,6 +41,7 @@ #include "base/win/windows_version.h" #endif +using base::ASCIIToUTF16; using base::TimeTicks; using content::InterstitialPage; using content::NavigationController; diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index e1b2d01..bcf8cf1 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -48,6 +48,7 @@ #include "net/cert/nss_cert_database.h" #endif // defined(USE_NSS) +using base::ASCIIToUTF16; using content::InterstitialPage; using content::NavigationController; using content::NavigationEntry; diff --git a/chrome/browser/ssl/ssl_error_info.cc b/chrome/browser/ssl/ssl_error_info.cc index 3dae1d2..4a9060a 100644 --- a/chrome/browser/ssl/ssl_error_info.cc +++ b/chrome/browser/ssl/ssl_error_info.cc @@ -16,6 +16,8 @@ #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" +using base::UTF8ToUTF16; + SSLErrorInfo::SSLErrorInfo(const base::string16& title, const base::string16& details, const base::string16& short_description, diff --git a/chrome/browser/ssl/ssl_tab_helper.cc b/chrome/browser/ssl/ssl_tab_helper.cc index 5aec77c..51612f4 100644 --- a/chrome/browser/ssl/ssl_tab_helper.cc +++ b/chrome/browser/ssl/ssl_tab_helper.cc @@ -219,7 +219,8 @@ void SSLTabHelper::OnVerifyClientCertificateError( GetAddCertData(handler.get())->ShowInfoBar( l10n_util::GetStringFUTF16(IDS_ADD_CERT_ERR_INVALID_CERT, base::IntToString16(-error_code), - ASCIIToUTF16(net::ErrorToString(error_code))), + base::ASCIIToUTF16( + net::ErrorToString(error_code))), NULL); } @@ -234,7 +235,8 @@ void SSLTabHelper::OnAddClientCertificateSuccess( // TODO(evanm): GetDisplayName should return UTF-16. GetAddCertData(handler.get())->ShowInfoBar( l10n_util::GetStringFUTF16(IDS_ADD_CERT_SUCCESS_INFOBAR_LABEL, - UTF8ToUTF16(cert->issuer().GetDisplayName())), + base::UTF8ToUTF16( + cert->issuer().GetDisplayName())), cert); } @@ -245,7 +247,8 @@ void SSLTabHelper::OnAddClientCertificateError( GetAddCertData(handler.get())->ShowInfoBar( l10n_util::GetStringFUTF16(IDS_ADD_CERT_ERR_FAILED, base::IntToString16(-error_code), - ASCIIToUTF16(net::ErrorToString(error_code))), + base::ASCIIToUTF16( + net::ErrorToString(error_code))), NULL); } diff --git a/chrome/browser/status_icons/status_icon_menu_model_unittest.cc b/chrome/browser/status_icons/status_icon_menu_model_unittest.cc index 8c8286d..6a0e5bd 100644 --- a/chrome/browser/status_icons/status_icon_menu_model_unittest.cc +++ b/chrome/browser/status_icons/status_icon_menu_model_unittest.cc @@ -15,6 +15,8 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" +using base::ASCIIToUTF16; + class StatusIconMenuModelTest : public testing::Test, public StatusIconMenuModel::Observer { public: diff --git a/chrome/browser/status_icons/status_tray_unittest.cc b/chrome/browser/status_icons/status_tray_unittest.cc index b05cb1f..45066b7 100644 --- a/chrome/browser/status_icons/status_tray_unittest.cc +++ b/chrome/browser/status_icons/status_tray_unittest.cc @@ -41,7 +41,7 @@ TEST(StatusTrayTest, Create) { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); gfx::ImageSkia* image = rb.GetImageSkiaNamed(IDR_STATUS_TRAY_ICON); tray.CreateStatusIcon( - StatusTray::OTHER_ICON, *image, ASCIIToUTF16("tool tip")); + StatusTray::OTHER_ICON, *image, base::ASCIIToUTF16("tool tip")); EXPECT_EQ(1U, tray.GetStatusIconsForTest().size()); } @@ -51,7 +51,7 @@ TEST(StatusTrayTest, CreateRemove) { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); gfx::ImageSkia* image = rb.GetImageSkiaNamed(IDR_STATUS_TRAY_ICON); StatusIcon* icon = tray.CreateStatusIcon( - StatusTray::OTHER_ICON, *image, ASCIIToUTF16("tool tip")); + StatusTray::OTHER_ICON, *image, base::ASCIIToUTF16("tool tip")); EXPECT_EQ(1U, tray.GetStatusIconsForTest().size()); tray.RemoveStatusIcon(icon); EXPECT_EQ(0U, tray.GetStatusIconsForTest().size()); diff --git a/chrome/browser/storage_monitor/media_storage_util_unittest.cc b/chrome/browser/storage_monitor/media_storage_util_unittest.cc index 20216a1..cc38bd4 100644 --- a/chrome/browser/storage_monitor/media_storage_util_unittest.cc +++ b/chrome/browser/storage_monitor/media_storage_util_unittest.cc @@ -140,7 +140,7 @@ TEST_F(MediaStorageUtilTest, DetectDeviceFiltered) { event.Wait(); EXPECT_FALSE(devices.find(kImageCaptureDeviceId) != devices.end()); - ProcessAttach(kImageCaptureDeviceId, ASCIIToUTF16("name"), + ProcessAttach(kImageCaptureDeviceId, base::ASCIIToUTF16("name"), FILE_PATH_LITERAL("/location")); devices.insert(kImageCaptureDeviceId); event.Reset(); diff --git a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc b/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc index d0942f6..c336efe 100644 --- a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc +++ b/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc @@ -88,7 +88,7 @@ base::string16 GetDeviceLabelFromStorageInfo( device_label += GetFormattedIdString(data_store_id); } } - return UTF8ToUTF16(device_label); + return base::UTF8ToUTF16(device_label); } // Helper function to get the device storage details such as device id, label diff --git a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc b/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc index d3e63d5..45f84b4 100644 --- a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc +++ b/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc @@ -47,7 +47,7 @@ void GetStorageInfo(const std::string& storage_name, ASSERT_EQ(kStorageWithValidInfo, storage_name); *id = GetMtpDeviceId(kStorageUniqueId); - *label = ASCIIToUTF16(kStorageLabel); + *label = base::ASCIIToUTF16(kStorageLabel); *location = kStorageLocation; } @@ -135,7 +135,8 @@ TEST_F(MediaTransferProtocolDeviceObserverLinuxTest, BasicAttachDetach) { EXPECT_EQ(1, observer().attach_calls()); EXPECT_EQ(0, observer().detach_calls()); EXPECT_EQ(device_id, observer().last_attached().device_id()); - EXPECT_EQ(ASCIIToUTF16(kStorageLabel), observer().last_attached().name()); + EXPECT_EQ(base::ASCIIToUTF16(kStorageLabel), + observer().last_attached().name()); EXPECT_EQ(kStorageLocation, observer().last_attached().location()); // Detach the attached storage. diff --git a/chrome/browser/storage_monitor/portable_device_watcher_win.cc b/chrome/browser/storage_monitor/portable_device_watcher_win.cc index 0efc319..bef912d 100644 --- a/chrome/browser/storage_monitor/portable_device_watcher_win.cc +++ b/chrome/browser/storage_monitor/portable_device_watcher_win.cc @@ -250,7 +250,7 @@ bool ConstructDeviceStorageUniqueId(const base::string16& device_serial_num, DCHECK(device_storage_id); *device_storage_id = StorageInfo::MakeDeviceId( StorageInfo::MTP_OR_PTP, - UTF16ToUTF8(storage_id + L':' + device_serial_num)); + base::UTF16ToUTF8(storage_id + L':' + device_serial_num)); return true; } @@ -542,7 +542,7 @@ base::string16 PortableDeviceWatcherWin::GetStoragePathFromStorageId( // Construct a dummy device path using the storage name. This is only used // for registering the device media file system. DCHECK(!storage_unique_id.empty()); - return UTF8ToUTF16("\\\\" + storage_unique_id); + return base::UTF8ToUTF16("\\\\" + storage_unique_id); } void PortableDeviceWatcherWin::SetNotifications( diff --git a/chrome/browser/storage_monitor/storage_monitor.cc b/chrome/browser/storage_monitor/storage_monitor.cc index 9f9d4c2..380412d 100644 --- a/chrome/browser/storage_monitor/storage_monitor.cc +++ b/chrome/browser/storage_monitor/storage_monitor.cc @@ -147,7 +147,7 @@ void StorageMonitor::ProcessAttach(const StorageInfo& info) { storage_map_.insert(std::make_pair(info.device_id(), info)); } - DVLOG(1) << "StorageAttached with name " << UTF16ToUTF8(info.name()) + DVLOG(1) << "StorageAttached with name " << base::UTF16ToUTF8(info.name()) << " and id " << info.device_id(); if (StorageInfo::IsRemovableDevice(info.device_id())) { observer_list_->Notify( diff --git a/chrome/browser/storage_monitor/storage_monitor_chromeos.cc b/chrome/browser/storage_monitor/storage_monitor_chromeos.cc index c14e44c..6b090c3 100644 --- a/chrome/browser/storage_monitor/storage_monitor_chromeos.cc +++ b/chrome/browser/storage_monitor/storage_monitor_chromeos.cc @@ -58,7 +58,7 @@ bool GetDeviceInfo(const disks::DiskMountManager::MountPointInfo& mount_info, std::string unique_id = MakeDeviceUniqueId(*disk); // Keep track of device uuid and label, to see how often we receive empty // values. - base::string16 device_label = UTF8ToUTF16(disk->device_label()); + base::string16 device_label = base::UTF8ToUTF16(disk->device_label()); MediaStorageUtil::RecordDeviceInfoHistogram(true, unique_id, device_label); if (unique_id.empty()) return false; @@ -71,8 +71,8 @@ bool GetDeviceInfo(const disks::DiskMountManager::MountPointInfo& mount_info, base::string16(), mount_info.mount_path, device_label, - UTF8ToUTF16(disk->vendor_name()), - UTF8ToUTF16(disk->product_name()), + base::UTF8ToUTF16(disk->vendor_name()), + base::UTF8ToUTF16(disk->product_name()), disk->total_size_in_bytes()); return true; } diff --git a/chrome/browser/storage_monitor/storage_monitor_linux.cc b/chrome/browser/storage_monitor/storage_monitor_linux.cc index 5c5816f..5e2cba1 100644 --- a/chrome/browser/storage_monitor/storage_monitor_linux.cc +++ b/chrome/browser/storage_monitor/storage_monitor_linux.cc @@ -144,11 +144,11 @@ scoped_ptr<StorageInfo> GetDeviceInfo(const base::FilePath& device_path, return storage_info.Pass(); base::string16 volume_label = - UTF8ToUTF16(GetUdevDevicePropertyValue(device.get(), kLabel)); + base::UTF8ToUTF16(GetUdevDevicePropertyValue(device.get(), kLabel)); base::string16 vendor_name = - UTF8ToUTF16(GetUdevDevicePropertyValue(device.get(), kVendor)); + base::UTF8ToUTF16(GetUdevDevicePropertyValue(device.get(), kVendor)); base::string16 model_name = - UTF8ToUTF16(GetUdevDevicePropertyValue(device.get(), kModel)); + base::UTF8ToUTF16(GetUdevDevicePropertyValue(device.get(), kModel)); std::string unique_id = MakeDeviceUniqueId(device.get()); diff --git a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc index 4a161d2..d63c12d 100644 --- a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc @@ -90,9 +90,9 @@ scoped_ptr<StorageInfo> GetDeviceInfo(const base::FilePath& device_path, StorageInfo::MakeDeviceId(type, kTestDeviceData[i].unique_id), base::string16(), mount_point.value(), - ASCIIToUTF16("volume label"), - ASCIIToUTF16("vendor name"), - ASCIIToUTF16("model name"), + base::ASCIIToUTF16("volume label"), + base::ASCIIToUTF16("vendor name"), + base::ASCIIToUTF16("model name"), kTestDeviceData[i].partition_size_in_bytes)); return storage_info.Pass(); } @@ -612,9 +612,9 @@ TEST_F(StorageMonitorLinuxTest, DeviceLookUp) { EXPECT_EQ(test_path_a.value(), device_info.location()); EXPECT_EQ(base::string16(), device_info.name()); EXPECT_EQ(88788ULL, device_info.total_size_in_bytes()); - EXPECT_EQ(ASCIIToUTF16("volume label"), device_info.storage_label()); - EXPECT_EQ(ASCIIToUTF16("vendor name"), device_info.vendor_name()); - EXPECT_EQ(ASCIIToUTF16("model name"), device_info.model_name()); + EXPECT_EQ(base::ASCIIToUTF16("volume label"), device_info.storage_label()); + EXPECT_EQ(base::ASCIIToUTF16("vendor name"), device_info.vendor_name()); + EXPECT_EQ(base::ASCIIToUTF16("model name"), device_info.model_name()); EXPECT_TRUE(notifier()->GetStorageInfoForPath(test_path_b, &device_info)); EXPECT_EQ(GetDeviceId(kDeviceNoDCIM), device_info.device_id()); diff --git a/chrome/browser/storage_monitor/storage_monitor_mac.mm b/chrome/browser/storage_monitor/storage_monitor_mac.mm index 1ea52aa..16ea943 100644 --- a/chrome/browser/storage_monitor/storage_monitor_mac.mm +++ b/chrome/browser/storage_monitor/storage_monitor_mac.mm @@ -85,7 +85,7 @@ StorageInfo BuildStorageInfo( base::string16 unique_id2 = vendor; unique_id2 = JoinName(unique_id2, model); unique_id2 = JoinName(unique_id2, revision); - unique_id = UTF16ToUTF8(unique_id2); + unique_id = base::UTF16ToUTF8(unique_id2); } CFBooleanRef is_removable_ref = @@ -365,7 +365,7 @@ bool StorageMonitorMac::ShouldPostNotificationForDisk( // are removable. Also exclude disk images (DMGs). return !info.device_id().empty() && !info.location().empty() && - info.model_name() != ASCIIToUTF16(kDiskImageModelName) && + info.model_name() != base::ASCIIToUTF16(kDiskImageModelName) && StorageInfo::IsMassStorageDevice(info.device_id()); } diff --git a/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm b/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm index 0ac98a4..29f888e 100644 --- a/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm +++ b/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm @@ -29,7 +29,7 @@ StorageInfo CreateStorageInfo( uint64 size_bytes) { return StorageInfo( device_id, base::string16(), mount_point.value(), - base::string16(), base::string16(), UTF8ToUTF16(model_name), + base::string16(), base::string16(), base::UTF8ToUTF16(model_name), size_bytes); } diff --git a/chrome/browser/storage_monitor/storage_monitor_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_unittest.cc index 427c9d7..8466108 100644 --- a/chrome/browser/storage_monitor/storage_monitor_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_unittest.cc @@ -34,7 +34,7 @@ TEST(StorageMonitorTest, TestInitialize) { TEST(StorageMonitorTest, DeviceAttachDetachNotifications) { TestStorageMonitor::RemoveSingleton(); base::MessageLoop message_loop; - const base::string16 kDeviceName = ASCIIToUTF16("media device"); + const base::string16 kDeviceName = base::ASCIIToUTF16("media device"); const std::string kDeviceId1 = "dcim:UUID:FFF0-0001"; const std::string kDeviceId2 = "dcim:UUID:FFF0-0002"; MockRemovableStorageObserver observer1; @@ -92,7 +92,7 @@ TEST(StorageMonitorTest, GetAllAvailableStorageAttachDetach) { base::MessageLoop message_loop; TestStorageMonitor monitor; const std::string kDeviceId1 = "dcim:UUID:FFF0-0042"; - const base::string16 kDeviceName1 = ASCIIToUTF16("test"); + const base::string16 kDeviceName1 = base::ASCIIToUTF16("test"); const base::FilePath kDevicePath1(FILE_PATH_LITERAL("/testfoo")); StorageInfo info1(kDeviceId1, kDeviceName1, kDevicePath1.value(), base::string16(), base::string16(), base::string16(), 0); @@ -105,7 +105,7 @@ TEST(StorageMonitorTest, GetAllAvailableStorageAttachDetach) { EXPECT_EQ(kDevicePath1.value(), devices[0].location()); const std::string kDeviceId2 = "dcim:UUID:FFF0-0044"; - const base::string16 kDeviceName2 = ASCIIToUTF16("test2"); + const base::string16 kDeviceName2 = base::ASCIIToUTF16("test2"); const base::FilePath kDevicePath2(FILE_PATH_LITERAL("/testbar")); StorageInfo info2(kDeviceId2, kDeviceName2, kDevicePath2.value(), base::string16(), base::string16(), base::string16(), 0); diff --git a/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc index 72e6f75..8798dc5 100644 --- a/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc @@ -28,6 +28,7 @@ #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; using content::BrowserThread; typedef std::vector<int> DeviceIndices; diff --git a/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc b/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc index a79a915..c35254d 100644 --- a/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc +++ b/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc @@ -87,7 +87,7 @@ void TestPortableDeviceWatcherWin::GetMTPStorageDetails( std::string storage_unique_id = GetMTPStorageUniqueId(pnp_device_id, storage_object_id); if (device_location) - *device_location = UTF8ToUTF16("\\\\" + storage_unique_id); + *device_location = base::UTF8ToUTF16("\\\\" + storage_unique_id); if (unique_id) *unique_id = storage_unique_id; diff --git a/chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc b/chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc index d63cfc5..151bc1f 100644 --- a/chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc +++ b/chrome/browser/storage_monitor/test_volume_mount_watcher_win.cc @@ -64,8 +64,8 @@ bool GetMassStorageDeviceDetails(const base::FilePath& device_path, return false; StorageInfo::Type type = StorageInfo::FIXED_MASS_STORAGE; - if (path.value() != ASCIIToUTF16("N:\\") && - path.value() != ASCIIToUTF16("C:\\") && + if (path.value() != base::ASCIIToUTF16("N:\\") && + path.value() != base::ASCIIToUTF16("C:\\") && path.value() != GetTempRoot().value()) { type = StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM; } diff --git a/chrome/browser/storage_monitor/volume_mount_watcher_win.cc b/chrome/browser/storage_monitor/volume_mount_watcher_win.cc index ddcc09f..8dd811a 100644 --- a/chrome/browser/storage_monitor/volume_mount_watcher_win.cc +++ b/chrome/browser/storage_monitor/volume_mount_watcher_win.cc @@ -148,7 +148,7 @@ bool GetDeviceDetails(const base::FilePath& device_path, StorageInfo* info) { DeviceType device_type = GetDeviceType(mount_point); if (device_type == FLOPPY) { info->set_device_id(StorageInfo::MakeDeviceId( - StorageInfo::FIXED_MASS_STORAGE, UTF16ToUTF8(guid))); + StorageInfo::FIXED_MASS_STORAGE, base::UTF16ToUTF8(guid))); return true; } @@ -167,7 +167,8 @@ bool GetDeviceDetails(const base::FilePath& device_path, StorageInfo* info) { kMaxPathBufLen, NULL, NULL, NULL, NULL, 0); uint64 total_size_in_bytes = GetVolumeSize(mount_point); - std::string device_id = StorageInfo::MakeDeviceId(type, UTF16ToUTF8(guid)); + std::string device_id = + StorageInfo::MakeDeviceId(type, base::UTF16ToUTF8(guid)); // TODO(gbillock): if volume_label.empty(), get the vendor/model information // for the volume. diff --git a/chrome/browser/sync/about_sync_util_unittest.cc b/chrome/browser/sync/about_sync_util_unittest.cc index bf5befe..6755d1b 100644 --- a/chrome/browser/sync/about_sync_util_unittest.cc +++ b/chrome/browser/sync/about_sync_util_unittest.cc @@ -26,7 +26,7 @@ TEST(SyncUIUtilTestAbout, ConstructAboutInformationWithUnrecoverableErrorTest) { NiceMock<ProfileSyncServiceMock> service(profile.get()); // Will be released when the dictionary is destroyed - base::string16 str(ASCIIToUTF16("none")); + base::string16 str(base::ASCIIToUTF16("none")); browser_sync::SyncBackendHost::Status status; diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc index 9b0285f..fb26475 100644 --- a/chrome/browser/sync/glue/bookmark_change_processor.cc +++ b/chrome/browser/sync/glue/bookmark_change_processor.cc @@ -704,7 +704,7 @@ void BookmarkChangeProcessor::UpdateBookmarkWithSyncData( sync_node.GetBookmarkSpecifics(); if (!sync_node.GetIsFolder()) model->SetURL(node, GURL(specifics.url())); - model->SetTitle(node, UTF8ToUTF16(sync_node.GetTitle())); + model->SetTitle(node, base::UTF8ToUTF16(sync_node.GetTitle())); if (specifics.has_creation_time_us()) { model->SetDateAdded( node, @@ -740,7 +740,8 @@ const BookmarkNode* BookmarkChangeProcessor::CreateBookmarkNode( const BookmarkNode* node; if (sync_node->GetIsFolder()) { - node = model->AddFolder(parent, index, UTF8ToUTF16(sync_node->GetTitle())); + node = model->AddFolder( + parent, index, base::UTF8ToUTF16(sync_node->GetTitle())); } else { // 'creation_time_us' was added in m24. Assume a time of 0 means now. const sync_pb::BookmarkSpecifics& specifics = @@ -749,7 +750,8 @@ const BookmarkNode* BookmarkChangeProcessor::CreateBookmarkNode( base::Time create_time = (create_time_internal == 0) ? base::Time::Now() : base::Time::FromInternalValue(create_time_internal); node = model->AddURLWithCreationTime(parent, index, - UTF8ToUTF16(sync_node->GetTitle()), + base::UTF8ToUTF16( + sync_node->GetTitle()), GURL(specifics.url()), create_time); if (node) SetBookmarkFavicon(sync_node, node, model, profile); diff --git a/chrome/browser/sync/glue/bookmark_model_associator.cc b/chrome/browser/sync/glue/bookmark_model_associator.cc index a08669f..5e6a3c5 100644 --- a/chrome/browser/sync/glue/bookmark_model_associator.cc +++ b/chrome/browser/sync/glue/bookmark_model_associator.cc @@ -131,7 +131,7 @@ const BookmarkNode* BookmarkNodeFinder::FindBookmarkNode( const GURL& url, const std::string& title, bool is_folder) { // Create a bookmark node from the given bookmark attributes. BookmarkNode temp_node(url); - temp_node.SetTitle(UTF8ToUTF16(title)); + temp_node.SetTitle(base::UTF8ToUTF16(title)); if (is_folder) temp_node.set_type(BookmarkNode::FOLDER); else @@ -326,7 +326,7 @@ bool BookmarkModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) { bool BookmarkModelAssociator::NodesMatch( const BookmarkNode* bookmark, const syncer::BaseNode* sync_node) const { - if (bookmark->GetTitle() != UTF8ToUTF16(sync_node->GetTitle())) + if (bookmark->GetTitle() != base::UTF8ToUTF16(sync_node->GetTitle())) return false; if (bookmark->is_folder() != sync_node->GetIsFolder()) return false; diff --git a/chrome/browser/sync/glue/generic_change_processor.cc b/chrome/browser/sync/glue/generic_change_processor.cc index 6d6b6aa..9193192 100644 --- a/chrome/browser/sync/glue/generic_change_processor.cc +++ b/chrome/browser/sync/glue/generic_change_processor.cc @@ -411,7 +411,7 @@ syncer::SyncError GenericChangeProcessor::ProcessSyncChanges( } } } - sync_node.SetTitle(UTF8ToWide(change.sync_data().GetTitle())); + sync_node.SetTitle(base::UTF8ToWide(change.sync_data().GetTitle())); SetNodeSpecifics(change.sync_data().GetSpecifics(), &sync_node); if (merge_result_.get()) { merge_result_->set_num_items_added(merge_result_->num_items_added() + @@ -504,7 +504,7 @@ syncer::SyncError GenericChangeProcessor::ProcessSyncChanges( } } - sync_node.SetTitle(UTF8ToWide(change.sync_data().GetTitle())); + sync_node.SetTitle(base::UTF8ToWide(change.sync_data().GetTitle())); SetNodeSpecifics(change.sync_data().GetSpecifics(), &sync_node); if (merge_result_.get()) { merge_result_->set_num_items_modified( diff --git a/chrome/browser/sync/glue/password_model_associator.cc b/chrome/browser/sync/glue/password_model_associator.cc index 9abea43..ade8d6b 100644 --- a/chrome/browser/sync/glue/password_model_associator.cc +++ b/chrome/browser/sync/glue/password_model_associator.cc @@ -21,6 +21,8 @@ #include "sync/internal_api/public/write_transaction.h" #include "sync/protocol/password_specifics.pb.h" +using base::UTF8ToUTF16; +using base::UTF16ToUTF8; using content::BrowserThread; namespace browser_sync { diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc index 40711bd..9321542 100644 --- a/chrome/browser/sync/glue/session_model_associator.cc +++ b/chrome/browser/sync/glue/session_model_associator.cc @@ -635,7 +635,7 @@ syncer::SyncError SessionModelAssociator::AssociateModels( // Write the initial values to the specifics so that in case of a crash or // error we don't persist a half-written node. - write_node.SetTitle(UTF8ToWide(current_machine_tag_)); + write_node.SetTitle(base::UTF8ToWide(current_machine_tag_)); sync_pb::SessionSpecifics base_specifics; base_specifics.set_session_tag(current_machine_tag_); sync_pb::SessionHeader* header_s = base_specifics.mutable_header(); diff --git a/chrome/browser/sync/glue/session_sync_test_helper.cc b/chrome/browser/sync/glue/session_sync_test_helper.cc index 401db7c..d908288 100644 --- a/chrome/browser/sync/glue/session_sync_test_helper.cc +++ b/chrome/browser/sync/glue/session_sync_test_helper.cc @@ -84,7 +84,7 @@ void SessionSyncTestHelper::VerifySyncedSession( ASSERT_EQ(tab->navigations[0].virtual_url(), GURL(kVirtualUrl)); ASSERT_EQ(tab->navigations[0].referrer().url, GURL(kReferrer)); ASSERT_EQ(tab->navigations[0].title(), - base::string16(ASCIIToUTF16(kTitle))); + base::ASCIIToUTF16(kTitle)); ASSERT_EQ(tab->navigations[0].transition_type(), content::PAGE_TRANSITION_TYPED); } diff --git a/chrome/browser/sync/glue/synced_device_tracker.cc b/chrome/browser/sync/glue/synced_device_tracker.cc index fd38bc8..0c8085a 100644 --- a/chrome/browser/sync/glue/synced_device_tracker.cc +++ b/chrome/browser/sync/glue/synced_device_tracker.cc @@ -179,7 +179,7 @@ void SyncedDeviceTracker::WriteDeviceInfo( if (node.InitByClientTagLookup(syncer::DEVICE_INFO, tag) == syncer::BaseNode::INIT_OK) { node.SetDeviceInfoSpecifics(specifics); - node.SetTitle(UTF8ToWide(specifics.client_name())); + node.SetTitle(base::UTF8ToWide(specifics.client_name())); } else { syncer::ReadNode type_root(&trans); syncer::BaseNode::InitByLookupResult type_root_lookup_result = @@ -193,7 +193,7 @@ void SyncedDeviceTracker::WriteDeviceInfo( tag); DCHECK_EQ(syncer::WriteNode::INIT_SUCCESS, create_result); new_node.SetDeviceInfoSpecifics(specifics); - new_node.SetTitle(UTF8ToWide(specifics.client_name())); + new_node.SetTitle(base::UTF8ToWide(specifics.client_name())); } } diff --git a/chrome/browser/sync/glue/synced_session_tracker.cc b/chrome/browser/sync/glue/synced_session_tracker.cc index 6f6f3e4..1d2e770 100644 --- a/chrome/browser/sync/glue/synced_session_tracker.cc +++ b/chrome/browser/sync/glue/synced_session_tracker.cc @@ -197,7 +197,7 @@ bool SyncedSessionTracker::DeleteOldSessionTabIfNecessary( SessionTab* tab_ptr = tab_wrapper.tab_ptr; std::string title; if (tab_ptr->navigations.size() > 0) { - title = " (" + UTF16ToUTF8( + title = " (" + base::UTF16ToUTF8( tab_ptr->navigations[tab_ptr->navigations.size()-1].title()) + ")"; } DVLOG(1) << "Deleting closed tab " << tab_ptr->tab_id.id() << title @@ -341,7 +341,7 @@ SessionTab* SyncedSessionTracker::GetTabImpl( if (VLOG_IS_ON(1)) { std::string title; if (tab_ptr->navigations.size() > 0) { - title = " (" + UTF16ToUTF8( + title = " (" + base::UTF16ToUTF8( tab_ptr->navigations[tab_ptr->navigations.size()-1].title()) + ")"; } DVLOG(1) << "Getting " diff --git a/chrome/browser/sync/glue/tab_node_pool.cc b/chrome/browser/sync/glue/tab_node_pool.cc index a16bb57..9ece54a 100644 --- a/chrome/browser/sync/glue/tab_node_pool.cc +++ b/chrome/browser/sync/glue/tab_node_pool.cc @@ -88,7 +88,7 @@ int TabNodePool::GetFreeTabNode() { } // We fill the new node with just enough data so that in case of a crash/bug // we can identify the node as our own on re-association and reuse it. - tab_node.SetTitle(UTF8ToWide(tab_node_tag)); + tab_node.SetTitle(base::UTF8ToWide(tab_node_tag)); sync_pb::SessionSpecifics specifics; specifics.set_session_tag(machine_tag_); specifics.set_tab_node_id(tab_node_id); diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc index a5a2be8..0084eaf 100644 --- a/chrome/browser/sync/glue/typed_url_change_processor.cc +++ b/chrome/browser/sync/glue/typed_url_change_processor.cc @@ -173,7 +173,7 @@ bool TypedUrlChangeProcessor::CreateOrUpdateSyncNode( return false; } - create_node.SetTitle(UTF8ToWide(tag)); + create_node.SetTitle(base::UTF8ToWide(tag)); model_associator_->WriteToSyncNode(url, visit_vector, &create_node); } return true; diff --git a/chrome/browser/sync/glue/typed_url_model_associator.cc b/chrome/browser/sync/glue/typed_url_model_associator.cc index a2c989a..3c42750 100644 --- a/chrome/browser/sync/glue/typed_url_model_associator.cc +++ b/chrome/browser/sync/glue/typed_url_model_associator.cc @@ -304,7 +304,7 @@ syncer::SyncError TypedUrlModelAssociator::DoAssociateModels() { model_type()); } - node.SetTitle(UTF8ToWide(tag)); + node.SetTitle(base::UTF8ToWide(tag)); WriteToSyncNode(*ix, visits, &node); } @@ -573,7 +573,7 @@ TypedUrlModelAssociator::MergeResult TypedUrlModelAssociator::MergeUrls( return DIFF_UPDATE_NODE; // Convert these values only once. - base::string16 node_title(UTF8ToUTF16(node.title())); + base::string16 node_title(base::UTF8ToUTF16(node.title())); base::Time node_last_visit = base::Time::FromInternalValue( node.visits(node.visits_size() - 1)); @@ -690,7 +690,7 @@ void TypedUrlModelAssociator::WriteToTypedUrlSpecifics( visits.back().visit_time.ToInternalValue()); typed_url->set_url(url.url().spec()); - typed_url->set_title(UTF16ToUTF8(url.title())); + typed_url->set_title(base::UTF16ToUTF8(url.title())); typed_url->set_hidden(url.hidden()); DCHECK(CheckVisitOrdering(visits)); @@ -821,7 +821,7 @@ void TypedUrlModelAssociator::UpdateURLRowFromTypedUrlSpecifics( const sync_pb::TypedUrlSpecifics& typed_url, history::URLRow* new_url) { DCHECK_GT(typed_url.visits_size(), 0); CHECK_EQ(typed_url.visit_transitions_size(), typed_url.visits_size()); - new_url->set_title(UTF8ToUTF16(typed_url.title())); + new_url->set_title(base::UTF8ToUTF16(typed_url.title())); new_url->set_hidden(typed_url.hidden()); // Only provide the initial value for the last_visit field - after that, let // the history code update the last_visit field on its own. diff --git a/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc b/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc index e514876..9c899ff 100644 --- a/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc +++ b/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc @@ -31,7 +31,7 @@ class SyncTypedUrlModelAssociatorTest : public testing::Test { history::VisitVector* visits) { GURL gurl(url); history::URLRow history_url(gurl); - history_url.set_title(UTF8ToUTF16(title)); + history_url.set_title(base::UTF8ToUTF16(title)); history_url.set_typed_count(typed_count); history_url.set_last_visit( base::Time::FromInternalValue(last_visit)); diff --git a/chrome/browser/sync/profile_sync_service_android.cc b/chrome/browser/sync/profile_sync_service_android.cc index c0ce961..42e1929 100644 --- a/chrome/browser/sync/profile_sync_service_android.cc +++ b/chrome/browser/sync/profile_sync_service_android.cc @@ -324,7 +324,7 @@ ScopedJavaLocalRef<jstring> return base::android::ConvertUTF16ToJavaString(env, l10n_util::GetStringFUTF16( IDS_SYNC_ACCOUNT_SYNCING_TO_USER, - ASCIIToUTF16(sync_username))); + base::ASCIIToUTF16(sync_username))); } ScopedJavaLocalRef<jstring> diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc index 9d8cbf3..3e73988 100644 --- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc @@ -624,7 +624,8 @@ class ProfileSyncServiceAutofillTest syncer::WriteNode node(&trans); std::string tag = AutocompleteSyncableService::KeyToTag( - UTF16ToUTF8(entry.key().name()), UTF16ToUTF8(entry.key().value())); + base::UTF16ToUTF8(entry.key().name()), + base::UTF16ToUTF8(entry.key().value())); syncer::WriteNode::InitUniqueByCreationResult result = node.InitUniqueByCreation(syncer::AUTOFILL, autofill_root, tag); if (result != syncer::WriteNode::INIT_SUCCESS) @@ -680,8 +681,8 @@ class ProfileSyncServiceAutofillTest const sync_pb::AutofillSpecifics& autofill( child_node.GetAutofillSpecifics()); if (autofill.has_value()) { - AutofillKey key(UTF8ToUTF16(autofill.name()), - UTF8ToUTF16(autofill.value())); + AutofillKey key(base::UTF8ToUTF16(autofill.name()), + base::UTF8ToUTF16(autofill.value())); std::vector<base::Time> timestamps; int timestamps_count = autofill.usage_timestamp_size(); for (int i = 0; i < timestamps_count; ++i) { @@ -748,7 +749,8 @@ class ProfileSyncServiceAutofillTest if (time_shift1 > 0) timestamps.push_back(base_time + TimeDelta::FromSeconds(time_shift1)); return AutofillEntry( - AutofillKey(ASCIIToUTF16(name), ASCIIToUTF16(value)), timestamps); + AutofillKey(base::ASCIIToUTF16(name), base::ASCIIToUTF16(value)), + timestamps); } static AutofillEntry MakeAutofillEntry(const char* name, @@ -845,10 +847,11 @@ class FakeServerUpdater : public base::RefCountedThreadSafe<FakeServerUpdater> { // Create autofill protobuf. std::string tag = AutocompleteSyncableService::KeyToTag( - UTF16ToUTF8(entry_.key().name()), UTF16ToUTF8(entry_.key().value())); + base::UTF16ToUTF8(entry_.key().name()), + base::UTF16ToUTF8(entry_.key().value())); sync_pb::AutofillSpecifics new_autofill; - new_autofill.set_name(UTF16ToUTF8(entry_.key().name())); - new_autofill.set_value(UTF16ToUTF8(entry_.key().value())); + new_autofill.set_name(base::UTF16ToUTF8(entry_.key().name())); + new_autofill.set_value(base::UTF16ToUTF8(entry_.key().value())); const std::vector<base::Time>& ts(entry_.timestamps()); for (std::vector<base::Time>::const_iterator timestamp = ts.begin(); timestamp != ts.end(); ++timestamp) { diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc index ab34e66..c8e7be8 100644 --- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc @@ -183,7 +183,7 @@ class FakeServerChange { std::string old_title = node.GetTitle(); node.SetTitle(new_title); SetModified(id); - return UTF8ToWide(old_title); + return base::UTF8ToWide(old_title); } // Set a new parent and predecessor value. Return the old parent id. @@ -354,7 +354,7 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { syncer::WriteNode node(trans); EXPECT_TRUE(node.InitBookmarkByCreation(bookmark_bar, NULL)); node.SetIsFolder(true); - node.SetTitle(ASCIIToWide(title)); + node.SetTitle(base::ASCIIToWide(title)); return node.GetId(); } @@ -382,7 +382,7 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { syncer::WriteNode node(trans); EXPECT_TRUE(node.InitBookmarkByCreation(parent, NULL)); node.SetIsFolder(false); - node.SetTitle(ASCIIToWide(title)); + node.SetTitle(base::ASCIIToWide(title)); node.SetBookmarkSpecifics(specifics); return node.GetId(); @@ -468,7 +468,7 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { return false; node.SetIsFolder(true); node.GetMutableEntryForTest()->PutUniqueServerTag(permanent_tags[i]); - node.SetTitle(UTF8ToWide(permanent_tags[i])); + node.SetTitle(base::UTF8ToWide(permanent_tags[i])); node.SetExternalId(0); last_child_id = node.GetId(); } @@ -565,7 +565,7 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { ASSERT_TRUE(InitSyncNodeFromChromeNode(bnode, &gnode)); // Non-root node titles and parents must match. if (!model_->is_permanent_node(bnode)) { - EXPECT_EQ(bnode->GetTitle(), UTF8ToUTF16(gnode.GetTitle())); + EXPECT_EQ(bnode->GetTitle(), base::UTF8ToUTF16(gnode.GetTitle())); EXPECT_EQ( model_associator_->GetChromeNodeFromSyncId(gnode.GetParentId()), bnode->parent()); @@ -789,44 +789,45 @@ TEST_F(ProfileSyncServiceBookmarkTest, BookmarkModelOperations) { // Test addition. const BookmarkNode* folder = - model_->AddFolder(model_->other_node(), 0, ASCIIToUTF16("foobar")); + model_->AddFolder(model_->other_node(), 0, base::ASCIIToUTF16("foobar")); ExpectSyncerNodeMatching(folder); ExpectModelMatch(); const BookmarkNode* folder2 = - model_->AddFolder(folder, 0, ASCIIToUTF16("nested")); + model_->AddFolder(folder, 0, base::ASCIIToUTF16("nested")); ExpectSyncerNodeMatching(folder2); ExpectModelMatch(); const BookmarkNode* url1 = model_->AddURL( - folder, 0, ASCIIToUTF16("Internets #1 Pies Site"), + folder, 0, base::ASCIIToUTF16("Internets #1 Pies Site"), GURL("http://www.easypie.com/")); ExpectSyncerNodeMatching(url1); ExpectModelMatch(); const BookmarkNode* url2 = model_->AddURL( - folder, 1, ASCIIToUTF16("Airplanes"), GURL("http://www.easyjet.com/")); + folder, 1, base::ASCIIToUTF16("Airplanes"), + GURL("http://www.easyjet.com/")); ExpectSyncerNodeMatching(url2); ExpectModelMatch(); // Test addition. const BookmarkNode* mobile_folder = - model_->AddFolder(model_->mobile_node(), 0, ASCIIToUTF16("pie")); + model_->AddFolder(model_->mobile_node(), 0, base::ASCIIToUTF16("pie")); ExpectSyncerNodeMatching(mobile_folder); ExpectModelMatch(); // Test modification. - model_->SetTitle(url2, ASCIIToUTF16("EasyJet")); + model_->SetTitle(url2, base::ASCIIToUTF16("EasyJet")); ExpectModelMatch(); model_->Move(url1, folder2, 0); ExpectModelMatch(); model_->Move(folder2, model_->bookmark_bar_node(), 0); ExpectModelMatch(); - model_->SetTitle(folder2, ASCIIToUTF16("Not Nested")); + model_->SetTitle(folder2, base::ASCIIToUTF16("Not Nested")); ExpectModelMatch(); model_->Move(folder, folder2, 0); ExpectModelMatch(); - model_->SetTitle(folder, ASCIIToUTF16("who's nested now?")); + model_->SetTitle(folder, base::ASCIIToUTF16("who's nested now?")); ExpectModelMatch(); model_->Copy(url2, model_->bookmark_bar_node(), 0); ExpectModelMatch(); - model_->SetTitle(mobile_folder, ASCIIToUTF16("strawberry")); + model_->SetTitle(mobile_folder, base::ASCIIToUTF16("strawberry")); ExpectModelMatch(); // Test deletion. @@ -1076,8 +1077,8 @@ TEST_F(ProfileSyncServiceBookmarkTest, CornerCaseNames) { // Create both folders and bookmarks using each name. GURL url("http://www.doublemint.com"); for (size_t i = 0; i < arraysize(names); ++i) { - model_->AddFolder(model_->other_node(), 0, ASCIIToUTF16(names[i])); - model_->AddURL(model_->other_node(), 0, ASCIIToUTF16(names[i]), url); + model_->AddFolder(model_->other_node(), 0, base::ASCIIToUTF16(names[i])); + model_->AddURL(model_->other_node(), 0, base::ASCIIToUTF16(names[i]), url); } // Verify that the browser model matches the sync model. @@ -1096,15 +1097,15 @@ TEST_F(ProfileSyncServiceBookmarkTest, RepeatedMiddleInsertion) { static const int kTimesToInsert = 256; // Create two book-end nodes to insert between. - model_->AddFolder(model_->other_node(), 0, ASCIIToUTF16("Alpha")); - model_->AddFolder(model_->other_node(), 1, ASCIIToUTF16("Omega")); + model_->AddFolder(model_->other_node(), 0, base::ASCIIToUTF16("Alpha")); + model_->AddFolder(model_->other_node(), 1, base::ASCIIToUTF16("Omega")); int count = 2; // Test insertion in first half of range by repeatedly inserting in second // position. for (int i = 0; i < kTimesToInsert; ++i) { base::string16 title = - ASCIIToUTF16("Pre-insertion ") + base::IntToString16(i); + base::ASCIIToUTF16("Pre-insertion ") + base::IntToString16(i); model_->AddFolder(model_->other_node(), 1, title); count++; } @@ -1113,7 +1114,7 @@ TEST_F(ProfileSyncServiceBookmarkTest, RepeatedMiddleInsertion) { // second-to-last position. for (int i = 0; i < kTimesToInsert; ++i) { base::string16 title = - ASCIIToUTF16("Post-insertion ") + base::IntToString16(i); + base::ASCIIToUTF16("Post-insertion ") + base::IntToString16(i); model_->AddFolder(model_->other_node(), count - 1, title); count++; } @@ -1134,7 +1135,7 @@ TEST_F(ProfileSyncServiceBookmarkTest, UnrecoverableErrorSuspendsService) { // Add a node which will be the target of the consistency violation. const BookmarkNode* node = - model_->AddFolder(model_->other_node(), 0, ASCIIToUTF16("node")); + model_->AddFolder(model_->other_node(), 0, base::ASCIIToUTF16("node")); ExpectSyncerNodeMatching(node); // Now destroy the syncer node as if we were the ProfileSyncService without @@ -1152,7 +1153,7 @@ TEST_F(ProfileSyncServiceBookmarkTest, UnrecoverableErrorSuspendsService) { // Add a child to the inconsistent node. This should cause detection of the // problem and the syncer should stop processing changes. - model_->AddFolder(node, 0, ASCIIToUTF16("nested")); + model_->AddFolder(node, 0, base::ASCIIToUTF16("nested")); } // See what happens if we run model association when there are two exact URL @@ -1162,9 +1163,9 @@ TEST_F(ProfileSyncServiceBookmarkTest, MergeDuplicates) { LoadBookmarkModel(DELETE_EXISTING_STORAGE, SAVE_TO_STORAGE); StartSync(); - model_->AddURL(model_->other_node(), 0, ASCIIToUTF16("Dup"), + model_->AddURL(model_->other_node(), 0, base::ASCIIToUTF16("Dup"), GURL("http://dup.com/")); - model_->AddURL(model_->other_node(), 0, ASCIIToUTF16("Dup"), + model_->AddURL(model_->other_node(), 0, base::ASCIIToUTF16("Dup"), GURL("http://dup.com/")); EXPECT_EQ(2, model_->other_node()->child_count()); @@ -1230,7 +1231,7 @@ TEST_F(ProfileSyncServiceBookmarkTest, ApplySyncDeletesFromJournal) { // Add a bookmark under f1 when sync is off so that f1 will not be // deleted even when f1 matches delete journal because it's not empty. model_->AddURL(model_->bookmark_bar_node()->GetChild(1), - 0, UTF8ToUTF16("local"), GURL("http://www.youtube.com")); + 0, base::UTF8ToUTF16("local"), GURL("http://www.youtube.com")); // Sync model has fixed bookmarks nodes and u3. EXPECT_EQ(fixed_sync_bk_count + 1, GetSyncBookmarkCount()); StartSync(); @@ -1238,11 +1239,11 @@ TEST_F(ProfileSyncServiceBookmarkTest, ApplySyncDeletesFromJournal) { // by delete journal, f1 is not removed by delete journal because it's // not empty due to www.youtube.com added above. EXPECT_EQ(4, model_->bookmark_bar_node()->GetTotalNodeCount()); - EXPECT_EQ(UTF8ToUTF16("URL 0"), + EXPECT_EQ(base::UTF8ToUTF16("URL 0"), model_->bookmark_bar_node()->GetChild(0)->GetTitle()); - EXPECT_EQ(UTF8ToUTF16("Folder 1"), + EXPECT_EQ(base::UTF8ToUTF16("Folder 1"), model_->bookmark_bar_node()->GetChild(1)->GetTitle()); - EXPECT_EQ(UTF8ToUTF16("local"), + EXPECT_EQ(base::UTF8ToUTF16("local"), model_->bookmark_bar_node()->GetChild(1)->GetChild(0)->GetTitle()); StopSync(); @@ -1776,7 +1777,7 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, // the situation where bookmark model is different from sync model and // make sure model associator correctly rebuilds associations. const BookmarkNode* bookmark_bar_node = model_->bookmark_bar_node(); - model_->AddURL(bookmark_bar_node, 0, ASCIIToUTF16("xtra"), + model_->AddURL(bookmark_bar_node, 0, base::ASCIIToUTF16("xtra"), GURL("http://www.xtra.com")); // Now restart sync. This time it will try to use the persistent // associations and realize that they are invalid and hence will rebuild @@ -1956,9 +1957,9 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, UpdateMetaInfoFromModel) { const BookmarkNode* folder_node = model_->AddFolder(model_->bookmark_bar_node(), 0, - ASCIIToUTF16("folder title")); + base::ASCIIToUTF16("folder title")); const BookmarkNode* node = model_->AddURL(folder_node, 0, - ASCIIToUTF16("node title"), + base::ASCIIToUTF16("node title"), GURL("http://www.foo.com")); ExpectModelMatch(); diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc index 9721a9e..4dd1efd 100644 --- a/chrome/browser/sync/profile_sync_service_password_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc @@ -50,6 +50,7 @@ using autofill::PasswordForm; using base::Time; +using base::UTF8ToUTF16; using browser_sync::PasswordChangeProcessor; using browser_sync::PasswordDataTypeController; using browser_sync::PasswordModelAssociator; diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc index 2e43f4c..6e3fa48 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -267,7 +267,7 @@ class ProfileSyncServiceTypedUrlTest : public AbstractProfileSyncServiceTest { child_node.GetTypedUrlSpecifics()); history::URLRow new_url(GURL(typed_url.url())); - new_url.set_title(UTF8ToUTF16(typed_url.title())); + new_url.set_title(base::UTF8ToUTF16(typed_url.title())); DCHECK(typed_url.visits_size()); DCHECK_EQ(typed_url.visits_size(), typed_url.visit_transitions_size()); new_url.set_last_visit(base::Time::FromInternalValue( @@ -306,7 +306,7 @@ class ProfileSyncServiceTypedUrlTest : public AbstractProfileSyncServiceTest { static int unique_url_id = 0; GURL gurl(url); URLRow history_url(gurl, ++unique_url_id); - history_url.set_title(UTF8ToUTF16(title)); + history_url.set_title(base::UTF8ToUTF16(title)); history_url.set_typed_count(typed_count); history_url.set_last_visit( base::Time::FromInternalValue(last_visit)); diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc index d35bfd4..46f7072 100644 --- a/chrome/browser/sync/sync_ui_util.cc +++ b/chrome/browser/sync/sync_ui_util.cc @@ -47,7 +47,8 @@ namespace { base::string16 GetSyncedStateStatusLabel(ProfileSyncService* service, const SigninManagerBase& signin, StatusLabelStyle style) { - base::string16 user_name = UTF8ToUTF16(signin.GetAuthenticatedUsername()); + base::string16 user_name = + base::UTF8ToUTF16(signin.GetAuthenticatedUsername()); if (!user_name.empty()) { if (!service || service->IsManaged()) { @@ -78,7 +79,7 @@ base::string16 GetSyncedStateStatusLabel(ProfileSyncService* service, return l10n_util::GetStringFUTF16( IDS_SYNC_ACCOUNT_SYNCING_TO_USER_WITH_MANAGE_LINK, user_name, - ASCIIToUTF16(chrome::kSyncGoogleDashboardURL)); + base::ASCIIToUTF16(chrome::kSyncGoogleDashboardURL)); default: NOTREACHED(); return NULL; @@ -253,8 +254,8 @@ MessageType GetStatusInfo(ProfileSyncService* service, // The user is signed in, but sync has been stopped. if (status_label) { base::string16 label = l10n_util::GetStringFUTF16( - IDS_SIGNED_IN_WITH_SYNC_SUPPRESSED, - UTF8ToUTF16(signin.GetAuthenticatedUsername())); + IDS_SIGNED_IN_WITH_SYNC_SUPPRESSED, + base::UTF8ToUTF16(signin.GetAuthenticatedUsername())); status_label->assign(label); result_type = PRE_SYNCED; } diff --git a/chrome/browser/sync/sync_ui_util_unittest.cc b/chrome/browser/sync/sync_ui_util_unittest.cc index 6ff6d99..7728606 100644 --- a/chrome/browser/sync/sync_ui_util_unittest.cc +++ b/chrome/browser/sync/sync_ui_util_unittest.cc @@ -348,7 +348,7 @@ TEST_F(SyncUIUtilTest, DistinctCasesReportUniqueMessageSets) { EXPECT_FALSE(status_label.empty()) << "Empty status label returned for case #" << idx; base::string16 combined_label = - status_label + base::string16(ASCIIToUTF16("#")) + link_label; + status_label + base::ASCIIToUTF16("#") + link_label; EXPECT_TRUE(messages.find(combined_label) == messages.end()) << "Duplicate message for case #" << idx << ": " << combined_label; messages.insert(combined_label); @@ -387,7 +387,7 @@ TEST_F(SyncUIUtilTest, HtmlNotIncludedInStatusIfNotRequested) { // found in an English language message) fails when links are excluded from // the status label. EXPECT_FALSE(status_label.empty()); - EXPECT_EQ(status_label.find(base::string16(ASCIIToUTF16("href"))), + EXPECT_EQ(status_label.find(base::ASCIIToUTF16("href")), base::string16::npos); testing::Mock::VerifyAndClearExpectations(&service); testing::Mock::VerifyAndClearExpectations(&signin); diff --git a/chrome/browser/sync/test/integration/bookmarks_helper.cc b/chrome/browser/sync/test/integration/bookmarks_helper.cc index 27d5e56..7ecb916 100644 --- a/chrome/browser/sync/test/integration/bookmarks_helper.cc +++ b/chrome/browser/sync/test/integration/bookmarks_helper.cc @@ -427,7 +427,7 @@ const BookmarkNode* AddURL(int profile, return NULL; } const BookmarkNode* result = GetBookmarkModel(profile)-> - AddURL(parent, index, WideToUTF16(title), url); + AddURL(parent, index, base::WideToUTF16(title), url); if (!result) { LOG(ERROR) << "Could not add bookmark " << title << " to Profile " << profile; @@ -437,7 +437,7 @@ const BookmarkNode* AddURL(int profile, const BookmarkNode* v_parent = NULL; FindNodeInVerifier(GetBookmarkModel(profile), parent, &v_parent); const BookmarkNode* v_node = GetVerifierBookmarkModel()-> - AddURL(v_parent, index, WideToUTF16(title), url); + AddURL(v_parent, index, base::WideToUTF16(title), url); if (!v_node) { LOG(ERROR) << "Could not add bookmark " << title << " to the verifier"; return NULL; @@ -467,8 +467,8 @@ const BookmarkNode* AddFolder(int profile, << "Profile " << profile; return NULL; } - const BookmarkNode* result = - GetBookmarkModel(profile)->AddFolder(parent, index, WideToUTF16(title)); + const BookmarkNode* result = GetBookmarkModel(profile)->AddFolder( + parent, index, base::WideToUTF16(title)); EXPECT_TRUE(result); if (!result) { LOG(ERROR) << "Could not add folder " << title << " to Profile " @@ -479,7 +479,7 @@ const BookmarkNode* AddFolder(int profile, const BookmarkNode* v_parent = NULL; FindNodeInVerifier(GetBookmarkModel(profile), parent, &v_parent); const BookmarkNode* v_node = GetVerifierBookmarkModel()->AddFolder( - v_parent, index, WideToUTF16(title)); + v_parent, index, base::WideToUTF16(title)); if (!v_node) { LOG(ERROR) << "Could not add folder " << title << " to the verifier"; return NULL; @@ -498,9 +498,9 @@ void SetTitle(int profile, if (test()->use_verifier()) { const BookmarkNode* v_node = NULL; FindNodeInVerifier(GetBookmarkModel(profile), node, &v_node); - GetVerifierBookmarkModel()->SetTitle(v_node, WideToUTF16(new_title)); + GetVerifierBookmarkModel()->SetTitle(v_node, base::WideToUTF16(new_title)); } - GetBookmarkModel(profile)->SetTitle(node, WideToUTF16(new_title)); + GetBookmarkModel(profile)->SetTitle(node, base::WideToUTF16(new_title)); } void SetFavicon(int profile, @@ -698,13 +698,13 @@ const BookmarkNode* GetUniqueNodeByURL(int profile, const GURL& url) { int CountBookmarksWithTitlesMatching(int profile, const std::wstring& title) { return CountNodesWithTitlesMatching(GetBookmarkModel(profile), BookmarkNode::URL, - WideToUTF16(title)); + base::WideToUTF16(title)); } int CountFoldersWithTitlesMatching(int profile, const std::wstring& title) { return CountNodesWithTitlesMatching(GetBookmarkModel(profile), BookmarkNode::FOLDER, - WideToUTF16(title)); + base::WideToUTF16(title)); } gfx::Image CreateFavicon(SkColor color) { diff --git a/chrome/browser/sync/test/integration/multiple_client_typed_urls_sync_test.cc b/chrome/browser/sync/test/integration/multiple_client_typed_urls_sync_test.cc index 16d7407..ec81db8 100644 --- a/chrome/browser/sync/test/integration/multiple_client_typed_urls_sync_test.cc +++ b/chrome/browser/sync/test/integration/multiple_client_typed_urls_sync_test.cc @@ -27,7 +27,7 @@ class MultipleClientTypedUrlsSyncTest : public SyncTest { // TCM: 3728323 IN_PROC_BROWSER_TEST_F(MultipleClientTypedUrlsSyncTest, AddToOne) { const base::string16 kHistoryUrl( - ASCIIToUTF16("http://www.add-one-history.google.com/")); + base::ASCIIToUTF16("http://www.add-one-history.google.com/")); ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; // Populate one client with a URL, should sync to all others. @@ -46,7 +46,7 @@ IN_PROC_BROWSER_TEST_F(MultipleClientTypedUrlsSyncTest, AddToOne) { IN_PROC_BROWSER_TEST_F(MultipleClientTypedUrlsSyncTest, AddToAll) { const base::string16 kHistoryUrl( - ASCIIToUTF16("http://www.add-all-history.google.com/")); + base::ASCIIToUTF16("http://www.add-all-history.google.com/")); ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; // Populate clients with the same URL. diff --git a/chrome/browser/sync/test/integration/passwords_helper.cc b/chrome/browser/sync/test/integration/passwords_helper.cc index ccab9ef..ba78470 100644 --- a/chrome/browser/sync/test/integration/passwords_helper.cc +++ b/chrome/browser/sync/test/integration/passwords_helper.cc @@ -216,8 +216,10 @@ PasswordForm CreateTestPasswordForm(int index) { PasswordForm form; form.signon_realm = kFakeSignonRealm; form.origin = GURL(base::StringPrintf(kIndexedFakeOrigin, index)); - form.username_value = ASCIIToUTF16(base::StringPrintf("username%d", index)); - form.password_value = ASCIIToUTF16(base::StringPrintf("password%d", index)); + form.username_value = + base::ASCIIToUTF16(base::StringPrintf("username%d", index)); + form.password_value = + base::ASCIIToUTF16(base::StringPrintf("password%d", index)); form.date_created = base::Time::Now(); return form; } diff --git a/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc index 3a06587..5a74e7d 100644 --- a/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc @@ -104,7 +104,7 @@ void AutofillSyncPerfTest::UpdateProfiles(int profile) { for (size_t i = 0; i < all_profiles.size(); ++i) { autofill_profiles.push_back(*all_profiles[i]); autofill_profiles.back().SetRawInfo(autofill::NAME_FIRST, - UTF8ToUTF16(NextName())); + base::UTF8ToUTF16(NextName())); } SetProfiles(profile, &autofill_profiles); } diff --git a/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc index 74928a7..4a9b7bd7 100644 --- a/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc @@ -54,7 +54,7 @@ void PasswordsSyncPerfTest::UpdateLogins(int profile) { GetLogins(GetPasswordStore(profile), logins); for (std::vector<autofill::PasswordForm>::iterator it = logins.begin(); it != logins.end(); ++it) { - (*it).password_value = ASCIIToUTF16(NextPassword()); + (*it).password_value = base::ASCIIToUTF16(NextPassword()); UpdateLogin(GetPasswordStore(profile), (*it)); } } diff --git a/chrome/browser/sync/test/integration/search_engines_helper.cc b/chrome/browser/sync/test/integration/search_engines_helper.cc index 5445d95..2a1baa1 100644 --- a/chrome/browser/sync/test/integration/search_engines_helper.cc +++ b/chrome/browser/sync/test/integration/search_engines_helper.cc @@ -108,7 +108,7 @@ bool ServicesMatch(int profile_a, int profile_b) { // Convenience helper for consistently generating the same keyword for a given // seed. base::string16 CreateKeyword(int seed) { - return ASCIIToUTF16(base::StringPrintf("test%d", seed)); + return base::ASCIIToUTF16(base::StringPrintf("test%d", seed)); } } // namespace diff --git a/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc b/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc index fe2373c..ab876a2 100644 --- a/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc @@ -108,8 +108,8 @@ IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, AddUnicodeProfile) { ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; std::set<AutofillKey> keys; - keys.insert(AutofillKey(WideToUTF16(L"Sigur R\u00F3s"), - WideToUTF16(L"\u00C1g\u00E6tis byrjun"))); + keys.insert(AutofillKey(base::WideToUTF16(L"Sigur R\u00F3s"), + base::WideToUTF16(L"\u00C1g\u00E6tis byrjun"))); AddKeys(0, keys); ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AwaitQuiescence()); @@ -188,7 +188,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, UpdateProfile(0, GetAllProfiles(0)[0]->guid(), AutofillType(autofill::NAME_FIRST), - ASCIIToUTF16("Bart")); + base::ASCIIToUTF16("Bart")); MakeABookmarkChange(0); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); ASSERT_TRUE(ProfilesMatch(0, 1)); @@ -221,7 +221,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, SameProfileWithConflict) { AutofillProfile profile0 = CreateAutofillProfile(PROFILE_HOMER); AutofillProfile profile1 = CreateAutofillProfile(PROFILE_HOMER); profile1.SetRawInfo(autofill::PHONE_HOME_WHOLE_NUMBER, - ASCIIToUTF16("1234567890")); + base::ASCIIToUTF16("1234567890")); AddProfile(0, profile0); AddProfile(1, profile1); @@ -308,11 +308,11 @@ IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, UpdateFields) { UpdateProfile(0, GetAllProfiles(0)[0]->guid(), AutofillType(autofill::NAME_FIRST), - ASCIIToUTF16("Lisa")); + base::ASCIIToUTF16("Lisa")); UpdateProfile(0, GetAllProfiles(0)[0]->guid(), AutofillType(autofill::EMAIL_ADDRESS), - ASCIIToUTF16("grrrl@TV.com")); + base::ASCIIToUTF16("grrrl@TV.com")); MakeABookmarkChange(0); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); ASSERT_TRUE(ProfilesMatch(0, 1)); @@ -332,12 +332,12 @@ IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, DISABLED_ConflictingFields) { UpdateProfile(0, GetAllProfiles(0)[0]->guid(), AutofillType(autofill::NAME_FIRST), - ASCIIToUTF16("Lisa")); + base::ASCIIToUTF16("Lisa")); MakeABookmarkChange(0); UpdateProfile(1, GetAllProfiles(1)[0]->guid(), AutofillType(autofill::NAME_FIRST), - ASCIIToUTF16("Bart")); + base::ASCIIToUTF16("Bart")); MakeABookmarkChange(1); ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(ProfilesMatch(0, 1)); @@ -467,7 +467,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, NoCreditCardSync) { CreditCard card; card.SetRawInfo(autofill::CREDIT_CARD_NUMBER, - ASCIIToUTF16("6011111111111117")); + base::ASCIIToUTF16("6011111111111117")); std::vector<CreditCard> credit_cards; credit_cards.push_back(card); SetCreditCards(0, &credit_cards); diff --git a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc index 1d4c7f9..b3bd68d 100644 --- a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc @@ -61,7 +61,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Race) { AddLogin(GetPasswordStore(0), form0); PasswordForm form1 = form0; - form1.password_value = ASCIIToUTF16("new_password"); + form1.password_value = base::ASCIIToUTF16("new_password"); AddLogin(GetPasswordStore(1), form1); ASSERT_TRUE(AwaitQuiescence()); @@ -155,7 +155,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Update) { AddLogin(GetPasswordStore(0), form); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); - form.password_value = ASCIIToUTF16("new_password"); + form.password_value = base::ASCIIToUTF16("new_password"); UpdateLogin(GetVerifierPasswordStore(), form); UpdateLogin(GetPasswordStore(1), form); ASSERT_TRUE(AwaitQuiescence()); diff --git a/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc b/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc index 1719bd0..69811b9 100644 --- a/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc @@ -11,6 +11,8 @@ #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" #include "chrome/browser/sync/test/integration/sync_test.h" +using base::ASCIIToUTF16; + class TwoClientSearchEnginesSyncTest : public SyncTest { public: TwoClientSearchEnginesSyncTest() : SyncTest(TWO_CLIENT) {} diff --git a/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc b/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc index ca5026e..85bd98c 100644 --- a/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc @@ -12,6 +12,7 @@ #include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/browser/sync/test/integration/typed_urls_helper.h" +using base::ASCIIToUTF16; using typed_urls_helper::AddUrlToHistory; using typed_urls_helper::AddUrlToHistoryWithTimestamp; using typed_urls_helper::AddUrlToHistoryWithTransition; diff --git a/chrome/browser/sync/test/integration/typed_urls_helper.cc b/chrome/browser/sync/test/integration/typed_urls_helper.cc index c297fef..0c60665 100644 --- a/chrome/browser/sync/test/integration/typed_urls_helper.cc +++ b/chrome/browser/sync/test/integration/typed_urls_helper.cc @@ -165,7 +165,7 @@ void AddToHistory(HistoryService* service, transition, source, false); - service->SetPageTitle(url, ASCIIToUTF16(url.spec() + " - title")); + service->SetPageTitle(url, base::ASCIIToUTF16(url.spec() + " - title")); } history::URLRows GetTypedUrlsFromHistoryService(HistoryService* service) { diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index 9d22b4c..8dc4040 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -372,7 +372,7 @@ void DevToolsInspectElementAt(RenderViewHost* rvh, int x, int y) { // Helper function to escape "&" as "&&". void EscapeAmpersands(base::string16* text) { const char16 ampersand[] = {'&', 0}; - base::ReplaceChars(*text, ampersand, ASCIIToUTF16("&&"), text); + base::ReplaceChars(*text, ampersand, base::ASCIIToUTF16("&&"), text); } } // namespace @@ -1016,7 +1016,7 @@ void RenderViewContextMenu::AppendSearchProvider() { return; base::ReplaceChars(params_.selection_text, AutocompleteMatch::kInvalidChars, - ASCIIToUTF16(" "), ¶ms_.selection_text); + base::ASCIIToUTF16(" "), ¶ms_.selection_text); AutocompleteMatch match; AutocompleteClassifierFactory::GetForProfile(profile_)->Classify( diff --git a/chrome/browser/tab_contents/render_view_context_menu.h b/chrome/browser/tab_contents/render_view_context_menu.h index 4591d58..e3673e4d 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.h +++ b/chrome/browser/tab_contents/render_view_context_menu.h @@ -72,7 +72,7 @@ struct WebPluginAction; // const std::string& data) { // bool enabled = response == 200; // const char* text = enabled ? "OK" : "ERROR"; -// proxy_->UpdateMenuItem(id_, enabled, ASCIIToUTF16(text)); +// proxy_->UpdateMenuItem(id_, enabled, base::ASCIIToUTF16(text)); // } // void Start(const GURL* url, net::URLRequestContextGetter* context) { // fetcher_.reset(new URLFetcher(url, URLFetcher::GET, this)); diff --git a/chrome/browser/tab_contents/spelling_menu_observer.cc b/chrome/browser/tab_contents/spelling_menu_observer.cc index 46f3e14..c1eb6cf 100644 --- a/chrome/browser/tab_contents/spelling_menu_observer.cc +++ b/chrome/browser/tab_contents/spelling_menu_observer.cc @@ -288,7 +288,7 @@ void SpellingMenuObserver::ExecuteCommand(int command_id) { SpellcheckService* spellcheck = SpellcheckServiceFactory::GetForContext(profile); if (spellcheck) { - spellcheck->GetCustomDictionary()->AddWord(UTF16ToUTF8( + spellcheck->GetCustomDictionary()->AddWord(base::UTF16ToUTF8( misspelled_word_)); spellcheck->GetFeedbackSender()->AddedToDictionary(misspelling_hash_); } diff --git a/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc b/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc index 940c4f4..c523a43 100644 --- a/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc +++ b/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc @@ -225,10 +225,10 @@ class SpellingMenuObserverTest : public InProcessBrowserTest { void InitMenu(const char* word, const char* suggestion) { content::ContextMenuParams params; params.is_editable = true; - params.misspelled_word = ASCIIToUTF16(word); + params.misspelled_word = base::ASCIIToUTF16(word); params.dictionary_suggestions.clear(); if (suggestion) - params.dictionary_suggestions.push_back(ASCIIToUTF16(suggestion)); + params.dictionary_suggestions.push_back(base::ASCIIToUTF16(suggestion)); observer_->InitMenu(params); } diff --git a/chrome/browser/tab_contents/view_source_browsertest.cc b/chrome/browser/tab_contents/view_source_browsertest.cc index 83f43b9..332c7c9 100644 --- a/chrome/browser/tab_contents/view_source_browsertest.cc +++ b/chrome/browser/tab_contents/view_source_browsertest.cc @@ -40,7 +40,7 @@ IN_PROC_BROWSER_TEST_F(ViewSourceTest, DoesBrowserRenderInViewSource) { // Check that the title didn't get set. It should not be there (because we // are in view-source mode). - EXPECT_NE(ASCIIToUTF16("foo"), + EXPECT_NE(base::ASCIIToUTF16("foo"), browser()->tab_strip_model()->GetActiveWebContents()->GetTitle()); } diff --git a/chrome/browser/task_manager/background_resource_provider.cc b/chrome/browser/task_manager/background_resource_provider.cc index a25548c..0aeb3e83 100644 --- a/chrome/browser/task_manager/background_resource_provider.cc +++ b/chrome/browser/task_manager/background_resource_provider.cc @@ -101,7 +101,7 @@ base::string16 BackgroundContentsResource::GetTitle() const { // No title (can't locate the parent app for some reason) so just display // the URL (properly forced to be LTR). title = base::i18n::GetDisplayStringInLTRDirectionality( - UTF8ToUTF16(background_contents_->GetURL().spec())); + base::UTF8ToUTF16(background_contents_->GetURL().spec())); } return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_BACKGROUND_PREFIX, title); } @@ -181,9 +181,9 @@ void BackgroundContentsResourceProvider::StartUpdating() { const base::string16& application_id = background_contents_service->GetParentApplicationId(*iterator); const Extension* extension = extension_service->GetExtensionById( - UTF16ToUTF8(application_id), false); + base::UTF16ToUTF8(application_id), false); if (extension) - application_name = UTF8ToUTF16(extension->name()); + application_name = base::UTF8ToUTF16(extension->name()); } Add(*iterator, application_name); } @@ -277,14 +277,14 @@ void BackgroundContentsResourceProvider::Observe( ExtensionService* service = content::Source<Profile>(source)->GetExtensionService(); if (service) { - std::string application_id = UTF16ToUTF8( + std::string application_id = base::UTF16ToUTF8( content::Details<BackgroundContentsOpenedDetails>(details)-> application_id); const Extension* extension = service->GetExtensionById(application_id, false); // Extension can be NULL when running unit tests. if (extension) - application_name = UTF8ToUTF16(extension->name()); + application_name = base::UTF8ToUTF16(extension->name()); } Add(content::Details<BackgroundContentsOpenedDetails>(details)->contents, application_name); diff --git a/chrome/browser/task_manager/extension_process_resource_provider.cc b/chrome/browser/task_manager/extension_process_resource_provider.cc index 11ebdf0..7ace7f6 100644 --- a/chrome/browser/task_manager/extension_process_resource_provider.cc +++ b/chrome/browser/task_manager/extension_process_resource_provider.cc @@ -87,7 +87,7 @@ ExtensionProcessResource::ExtensionProcessResource( process_handle_ = render_view_host_->GetProcess()->GetHandle(); unique_process_id_ = render_view_host->GetProcess()->GetID(); pid_ = base::GetProcId(process_handle_); - base::string16 extension_name = UTF8ToUTF16(GetExtension()->name()); + base::string16 extension_name = base::UTF8ToUTF16(GetExtension()->name()); DCHECK(!extension_name.empty()); Profile* profile = Profile::FromBrowserContext( diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc index e04211c..8ceb778 100644 --- a/chrome/browser/task_manager/task_manager.cc +++ b/chrome/browser/task_manager/task_manager.cc @@ -403,14 +403,14 @@ base::string16 TaskManagerModel::GetResourceNetworkUsage(int index) const { if (net_usage == -1) return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT); if (net_usage == 0) - return ASCIIToUTF16("0"); + return base::ASCIIToUTF16("0"); base::string16 net_byte = ui::FormatSpeed(net_usage); // Force number string to have LTR directionality. return base::i18n::GetDisplayStringInLTRDirectionality(net_byte); } base::string16 TaskManagerModel::GetResourceCPUUsage(int index) const { - return UTF8ToUTF16(base::StringPrintf( + return base::UTF8ToUTF16(base::StringPrintf( #if defined(OS_MACOSX) // Activity Monitor shows %cpu with one decimal digit -- be // consistent with that. @@ -424,14 +424,14 @@ base::string16 TaskManagerModel::GetResourceCPUUsage(int index) const { base::string16 TaskManagerModel::GetResourcePrivateMemory(int index) const { size_t private_mem; if (!GetPrivateMemory(index, &private_mem)) - return ASCIIToUTF16("N/A"); + return base::ASCIIToUTF16("N/A"); return GetMemCellText(private_mem); } base::string16 TaskManagerModel::GetResourceSharedMemory(int index) const { size_t shared_mem; if (!GetSharedMemory(index, &shared_mem)) - return ASCIIToUTF16("N/A"); + return base::ASCIIToUTF16("N/A"); return GetMemCellText(shared_mem); } @@ -485,9 +485,9 @@ base::string16 TaskManagerModel::GetResourceVideoMemory(int index) const { size_t video_memory; bool has_duplicates; if (!GetVideoMemory(index, &video_memory, &has_duplicates) || !video_memory) - return ASCIIToUTF16("N/A"); + return base::ASCIIToUTF16("N/A"); if (has_duplicates) { - return GetMemCellText(video_memory) + ASCIIToUTF16("*"); + return GetMemCellText(video_memory) + base::ASCIIToUTF16("*"); } return GetMemCellText(video_memory); } @@ -497,7 +497,7 @@ base::string16 TaskManagerModel::GetResourceFPS( float fps = 0; if (!GetFPS(index, &fps)) return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT); - return UTF8ToUTF16(base::StringPrintf("%.0f", fps)); + return base::UTF8ToUTF16(base::StringPrintf("%.0f", fps)); } base::string16 TaskManagerModel::GetResourceSqliteMemoryUsed(int index) const { diff --git a/chrome/browser/task_manager/task_manager_notification_browsertest.cc b/chrome/browser/task_manager/task_manager_notification_browsertest.cc index c4cf92a..c9ee629 100644 --- a/chrome/browser/task_manager/task_manager_notification_browsertest.cc +++ b/chrome/browser/task_manager/task_manager_notification_browsertest.cc @@ -62,16 +62,16 @@ IN_PROC_BROWSER_TEST_F(TaskManagerNotificationBrowserTest, g_browser_process->notification_ui_manager(); base::string16 content = DesktopNotificationService::CreateDataUrl( - GURL(), ASCIIToUTF16("Hello World!"), base::string16(), + GURL(), base::ASCIIToUTF16("Hello World!"), base::string16(), blink::WebTextDirectionDefault); scoped_refptr<NotificationDelegate> del1(new MockNotificationDelegate("n1")); Notification n1( - GURL(), GURL(content), ASCIIToUTF16("Test 1"), base::string16(), + GURL(), GURL(content), base::ASCIIToUTF16("Test 1"), base::string16(), del1.get()); scoped_refptr<NotificationDelegate> del2(new MockNotificationDelegate("n2")); Notification n2( - GURL(), GURL(content), ASCIIToUTF16("Test 2"), base::string16(), + GURL(), GURL(content), base::ASCIIToUTF16("Test 2"), base::string16(), del2.get()); notifications->Add(n1, browser()->profile()); diff --git a/chrome/browser/task_manager/task_manager_unittest.cc b/chrome/browser/task_manager/task_manager_unittest.cc index 314d485..f0614a4 100644 --- a/chrome/browser/task_manager/task_manager_unittest.cc +++ b/chrome/browser/task_manager/task_manager_unittest.cc @@ -15,6 +15,8 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/image/image_skia.h" +using base::ASCIIToUTF16; + namespace { #if defined(OS_MACOSX) diff --git a/chrome/browser/task_manager/task_manager_util.cc b/chrome/browser/task_manager/task_manager_util.cc index 6192696..d584f90 100644 --- a/chrome/browser/task_manager/task_manager_util.cc +++ b/chrome/browser/task_manager/task_manager_util.cc @@ -66,7 +66,7 @@ base::string16 GetTitleFromWebContents(content::WebContents* web_contents) { base::string16 title = web_contents->GetTitle(); if (title.empty()) { GURL url = web_contents->GetURL(); - title = UTF8ToUTF16(url.spec()); + title = base::UTF8ToUTF16(url.spec()); // Force URL to be LTR. title = base::i18n::GetDisplayStringInLTRDirectionality(title); } else { diff --git a/chrome/browser/task_manager/worker_resource_provider.cc b/chrome/browser/task_manager/worker_resource_provider.cc index ae86370..7aee456 100644 --- a/chrome/browser/task_manager/worker_resource_provider.cc +++ b/chrome/browser/task_manager/worker_resource_provider.cc @@ -83,9 +83,9 @@ SharedWorkerResource::SharedWorkerResource( : process_id_(process_id), routing_id_(routing_id), handle_(process_handle) { - title_ = UTF8ToUTF16(url.spec()); + title_ = base::UTF8ToUTF16(url.spec()); if (!name.empty()) - title_ += ASCIIToUTF16(" (") + name + ASCIIToUTF16(")"); + title_ += base::ASCIIToUTF16(" (") + name + base::ASCIIToUTF16(")"); } SharedWorkerResource::~SharedWorkerResource() { diff --git a/chrome/browser/translate/translate_browsertest.cc b/chrome/browser/translate/translate_browsertest.cc index e6ce383..ea76a23 100644 --- a/chrome/browser/translate/translate_browsertest.cc +++ b/chrome/browser/translate/translate_browsertest.cc @@ -142,8 +142,8 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, TranslateInIsolatedWorld) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); ASSERT_TRUE(web_contents); - content::TitleWatcher watcher(web_contents, ASCIIToUTF16("PASS")); - watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); + content::TitleWatcher watcher(web_contents, base::ASCIIToUTF16("PASS")); + watcher.AlsoWaitForTitle(base::ASCIIToUTF16("FAIL")); // Visit non-secure page which is going to be translated. ui_test_utils::NavigateToURL(browser(), GetNonSecureURL(kFrenchTestPath)); @@ -205,8 +205,8 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, IgnoreRefreshMetaTag) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); ASSERT_TRUE(web_contents); - content::TitleWatcher watcher(web_contents, ASCIIToUTF16("PASS")); - watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); + content::TitleWatcher watcher(web_contents, base::ASCIIToUTF16("PASS")); + watcher.AlsoWaitForTitle(base::ASCIIToUTF16("FAIL")); // Visit a test page. ui_test_utils::NavigateToURL( @@ -240,8 +240,8 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); ASSERT_TRUE(web_contents); - content::TitleWatcher watcher(web_contents, ASCIIToUTF16("PASS")); - watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); + content::TitleWatcher watcher(web_contents, base::ASCIIToUTF16("PASS")); + watcher.AlsoWaitForTitle(base::ASCIIToUTF16("FAIL")); // Visit a test page. ui_test_utils::NavigateToURL( @@ -274,8 +274,8 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, IgnoreRefreshMetaTagAtOnload) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); ASSERT_TRUE(web_contents); - content::TitleWatcher watcher(web_contents, ASCIIToUTF16("PASS")); - watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); + content::TitleWatcher watcher(web_contents, base::ASCIIToUTF16("PASS")); + watcher.AlsoWaitForTitle(base::ASCIIToUTF16("FAIL")); // Visit a test page. ui_test_utils::NavigateToURL( @@ -308,8 +308,8 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, UpdateLocation) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); ASSERT_TRUE(web_contents); - content::TitleWatcher watcher(web_contents, ASCIIToUTF16("PASS")); - watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); + content::TitleWatcher watcher(web_contents, base::ASCIIToUTF16("PASS")); + watcher.AlsoWaitForTitle(base::ASCIIToUTF16("FAIL")); // Visit a test page. ui_test_utils::NavigateToURL( @@ -342,8 +342,8 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, UpdateLocationAtOnload) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); ASSERT_TRUE(web_contents); - content::TitleWatcher watcher(web_contents, ASCIIToUTF16("PASS")); - watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); + content::TitleWatcher watcher(web_contents, base::ASCIIToUTF16("PASS")); + watcher.AlsoWaitForTitle(base::ASCIIToUTF16("FAIL")); // Visit a test page. ui_test_utils::NavigateToURL( diff --git a/chrome/browser/ui/android/infobars/auto_login_infobar_delegate_android.cc b/chrome/browser/ui/android/infobars/auto_login_infobar_delegate_android.cc index 7351baf..87bd52d1 100644 --- a/chrome/browser/ui/android/infobars/auto_login_infobar_delegate_android.cc +++ b/chrome/browser/ui/android/infobars/auto_login_infobar_delegate_android.cc @@ -55,7 +55,7 @@ bool AutoLoginInfoBarDelegateAndroid::AttachAccount( base::string16 AutoLoginInfoBarDelegateAndroid::GetMessageText() const { return l10n_util::GetStringFUTF16(IDS_AUTOLOGIN_INFOBAR_MESSAGE, - UTF8ToUTF16(user_)); + base::UTF8ToUTF16(user_)); } bool AutoLoginInfoBarDelegateAndroid::Accept() { diff --git a/chrome/browser/ui/android/login_prompt_android.cc b/chrome/browser/ui/android/login_prompt_android.cc index 6048f68..8dd465b 100644 --- a/chrome/browser/ui/android/login_prompt_android.cc +++ b/chrome/browser/ui/android/login_prompt_android.cc @@ -55,8 +55,8 @@ class LoginHandlerAndroid : public LoginHandler { tab_android->OnReceivedHttpAuthRequest( chrome_http_auth_handler_.get()->GetJavaObject(), - ASCIIToUTF16(auth_info()->challenger.ToString()), - UTF8ToUTF16(auth_info()->realm)); + base::ASCIIToUTF16(auth_info()->challenger.ToString()), + base::UTF8ToUTF16(auth_info()->realm)); // Register to receive a callback to OnAutofillDataAvailable(). SetModel(manager); diff --git a/chrome/browser/ui/app_list/app_list_controller_browsertest.cc b/chrome/browser/ui/app_list/app_list_controller_browsertest.cc index cc5eb01..77477b9 100644 --- a/chrome/browser/ui/app_list/app_list_controller_browsertest.cc +++ b/chrome/browser/ui/app_list/app_list_controller_browsertest.cc @@ -61,7 +61,7 @@ class AppListControllerSearchResultsBrowserTest EXPECT_FALSE(observed_results_list_); observed_results_list_ = search_results; observed_results_list_->AddObserver(this); - item_to_observe_ = ASCIIToUTF16(extension_name); + item_to_observe_ = base::ASCIIToUTF16(extension_name); } void StopWatchingResults() { @@ -144,7 +144,7 @@ IN_PROC_BROWSER_TEST_F(AppListControllerSearchResultsBrowserTest, // Ensure a search finds the extension. EXPECT_FALSE(observed_result_); - model->search_box()->SetText(ASCIIToUTF16("minimal")); + model->search_box()->SetText(base::ASCIIToUTF16("minimal")); EXPECT_TRUE(observed_result_); // Ensure the UI is updated. This is via PostTask in views. diff --git a/chrome/browser/ui/app_list/app_list_service_interactive_uitest.cc b/chrome/browser/ui/app_list/app_list_service_interactive_uitest.cc index 45feac2..1ac9be8 100644 --- a/chrome/browser/ui/app_list/app_list_service_interactive_uitest.cc +++ b/chrome/browser/ui/app_list/app_list_service_interactive_uitest.cc @@ -133,7 +133,7 @@ IN_PROC_BROWSER_TEST_F(AppListServiceInteractiveTest, app_list::AppListModel* model = test::GetAppListModel(service); ASSERT_TRUE(model); - model->search_box()->SetText(ASCIIToUTF16("minimal")); + model->search_box()->SetText(base::ASCIIToUTF16("minimal")); base::RunLoop().RunUntilIdle(); // Switch to the second profile. diff --git a/chrome/browser/ui/app_list/search/app_search_provider.cc b/chrome/browser/ui/app_list/search/app_search_provider.cc index 83e6257..99f5c72 100644 --- a/chrome/browser/ui/app_list/search/app_search_provider.cc +++ b/chrome/browser/ui/app_list/search/app_search_provider.cc @@ -26,7 +26,7 @@ class AppSearchProvider::App { public: explicit App(const extensions::Extension* extension) : app_id_(extension->id()), - indexed_name_(UTF8ToUTF16(extension->name())) { + indexed_name_(base::UTF8ToUTF16(extension->name())) { } ~App() {} diff --git a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc index f25b09b..5aa6842 100644 --- a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc +++ b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc @@ -50,7 +50,7 @@ class AppSearchProviderTest : public ExtensionServiceTestBase { } std::string RunQuery(const std::string& query) { - app_search_->Start(UTF8ToUTF16(query)); + app_search_->Start(base::UTF8ToUTF16(query)); app_search_->Stop(); std::string result_str; @@ -59,7 +59,7 @@ class AppSearchProviderTest : public ExtensionServiceTestBase { if (!result_str.empty()) result_str += ','; - result_str += UTF16ToUTF8(results[i]->title()); + result_str += base::UTF16ToUTF8(results[i]->title()); } return result_str; } diff --git a/chrome/browser/ui/app_list/search/history.cc b/chrome/browser/ui/app_list/search/history.cc index ec8fd00..534fda7 100644 --- a/chrome/browser/ui/app_list/search/history.cc +++ b/chrome/browser/ui/app_list/search/history.cc @@ -18,8 +18,8 @@ namespace { // Normalize the given string by joining all its tokens with a space. std::string NormalizeString(const std::string& utf8) { - TokenizedString tokenized(UTF8ToUTF16(utf8)); - return UTF16ToUTF8(JoinString(tokenized.tokens(), ' ')); + TokenizedString tokenized(base::UTF8ToUTF16(utf8)); + return base::UTF16ToUTF8(JoinString(tokenized.tokens(), ' ')); } } // namespace diff --git a/chrome/browser/ui/app_list/search/mixer_unittest.cc b/chrome/browser/ui/app_list/search/mixer_unittest.cc index 98fa049..036dcfa 100644 --- a/chrome/browser/ui/app_list/search/mixer_unittest.cc +++ b/chrome/browser/ui/app_list/search/mixer_unittest.cc @@ -22,7 +22,7 @@ class TestSearchResult : public ChromeSearchResult { public: TestSearchResult(const std::string& id, double relevance) { set_id(id); - set_title(UTF8ToUTF16(id)); + set_title(base::UTF8ToUTF16(id)); set_relevance(relevance); } virtual ~TestSearchResult() {} @@ -111,7 +111,7 @@ class MixerTest : public testing::Test { if (!result.empty()) result += ','; - result += UTF16ToUTF8(results_->GetItemAt(i)->title()); + result += base::UTF16ToUTF8(results_->GetItemAt(i)->title()); } return result; diff --git a/chrome/browser/ui/app_list/search/people/people_provider.cc b/chrome/browser/ui/app_list/search/people/people_provider.cc index b5a4793..906edb2 100644 --- a/chrome/browser/ui/app_list/search/people/people_provider.cc +++ b/chrome/browser/ui/app_list/search/people/people_provider.cc @@ -56,7 +56,7 @@ void PeopleProvider::Start(const base::string16& query) { return; } - query_ = UTF16ToUTF8(query); + query_ = base::UTF16ToUTF8(query); const CacheResult result = cache_->Get(WebserviceCache::PEOPLE, query_); if (result.second) { diff --git a/chrome/browser/ui/app_list/search/people/people_provider_browsertest.cc b/chrome/browser/ui/app_list/search/people/people_provider_browsertest.cc index 5b2b156..b1c51f1 100644 --- a/chrome/browser/ui/app_list/search/people/people_provider_browsertest.cc +++ b/chrome/browser/ui/app_list/search/people/people_provider_browsertest.cc @@ -190,7 +190,7 @@ class PeopleProviderTest : public InProcessBrowserTest { std::string RunQuery(const std::string& query, const std::string& mock_server_response) { - people_provider_->Start(UTF8ToUTF16(query)); + people_provider_->Start(base::UTF8ToUTF16(query)); if (people_provider_->people_search_ && !mock_server_response.empty()) { mock_server_response_ = mock_server_response; @@ -215,7 +215,7 @@ class PeopleProviderTest : public InProcessBrowserTest { ++it) { if (!results.empty()) results += ','; - results += UTF16ToUTF8((*it)->title()); + results += base::UTF16ToUTF8((*it)->title()); } return results; } diff --git a/chrome/browser/ui/app_list/search/people/people_result.cc b/chrome/browser/ui/app_list/search/people/people_result.cc index 4a4bb21..5c0c977 100644 --- a/chrome/browser/ui/app_list/search/people/people_result.cc +++ b/chrome/browser/ui/app_list/search/people/people_result.cc @@ -61,9 +61,9 @@ namespace app_list { PeopleResult::PeopleResult(Profile* profile, scoped_ptr<Person> person) : profile_(profile), person_(person.Pass()), weak_factory_(this) { set_id(person_->id); - set_title(UTF8ToUTF16(person_->display_name)); + set_title(base::UTF8ToUTF16(person_->display_name)); set_relevance(person_->interaction_rank); - set_details(UTF8ToUTF16(person_->email)); + set_details(base::UTF8ToUTF16(person_->email)); RefreshHangoutsExtensionId(); SetDefaultActions(); diff --git a/chrome/browser/ui/app_list/search/search_controller.cc b/chrome/browser/ui/app_list/search/search_controller.cc index 2431e20..d2f3fe4 100644 --- a/chrome/browser/ui/app_list/search/search_controller.cc +++ b/chrome/browser/ui/app_list/search/search_controller.cc @@ -128,7 +128,7 @@ void SearchController::OpenResult(SearchResult* result, int event_flags) { chrome_result->Open(event_flags); if (history_ && history_->IsReady()) { - history_->AddLaunchEvent(UTF16ToUTF8(search_box_->text()), + history_->AddLaunchEvent(base::UTF16ToUTF8(search_box_->text()), chrome_result->id()); } } @@ -156,7 +156,7 @@ void SearchController::OnResultsChanged() { KnownResults known_results; if (history_ && history_->IsReady()) { - history_->GetKnownResults(UTF16ToUTF8(search_box_->text())) + history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text())) ->swap(known_results); } diff --git a/chrome/browser/ui/app_list/search/search_webstore_result.cc b/chrome/browser/ui/app_list/search/search_webstore_result.cc index e544523..e53acf5 100644 --- a/chrome/browser/ui/app_list/search/search_webstore_result.cc +++ b/chrome/browser/ui/app_list/search/search_webstore_result.cc @@ -24,7 +24,7 @@ SearchWebstoreResult::SearchWebstoreResult(Profile* profile, set_id(launch_url_.spec()); set_relevance(0.0); - set_title(UTF8ToUTF16(query)); + set_title(base::UTF8ToUTF16(query)); const base::string16 details = l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE); diff --git a/chrome/browser/ui/app_list/search/term_break_iterator_unittest.cc b/chrome/browser/ui/app_list/search/term_break_iterator_unittest.cc index fbd298f..cedf24b 100644 --- a/chrome/browser/ui/app_list/search/term_break_iterator_unittest.cc +++ b/chrome/browser/ui/app_list/search/term_break_iterator_unittest.cc @@ -7,6 +7,8 @@ #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" +using base::UTF8ToUTF16; + namespace app_list { namespace test { diff --git a/chrome/browser/ui/app_list/search/tokenized_string_char_iterator_unittest.cc b/chrome/browser/ui/app_list/search/tokenized_string_char_iterator_unittest.cc index a6a370e8..3ffef9b 100644 --- a/chrome/browser/ui/app_list/search/tokenized_string_char_iterator_unittest.cc +++ b/chrome/browser/ui/app_list/search/tokenized_string_char_iterator_unittest.cc @@ -23,7 +23,8 @@ namespace { // last one is optional and only shows up when IsFirstCharOfToken returns true. std::string GetIterateState(const TokenizedStringCharIterator& iter) { return base::StringPrintf("%s%d%s", - UTF16ToUTF8(base::string16(1, iter.Get())).c_str(), + base::UTF16ToUTF8( + base::string16(1, iter.Get())).c_str(), iter.GetArrayPos(), iter.IsFirstCharOfToken() ? "!" : ""); } @@ -38,7 +39,7 @@ void TestBeyondTheEnd(TokenizedStringCharIterator* iter) { } void TestEveryChar(const std::string& text, const std::string& expects) { - TokenizedString tokens(UTF8ToUTF16(text)); + TokenizedString tokens(base::UTF8ToUTF16(text)); TokenizedStringCharIterator iter(tokens); std::vector<std::string> results; @@ -52,7 +53,7 @@ void TestEveryChar(const std::string& text, const std::string& expects) { } void TestNextToken(const std::string& text, const std::string& expects) { - TokenizedString tokens(UTF8ToUTF16(text)); + TokenizedString tokens(base::UTF8ToUTF16(text)); TokenizedStringCharIterator iter(tokens); std::vector<std::string> results; @@ -67,7 +68,7 @@ void TestNextToken(const std::string& text, const std::string& expects) { void TestFirstTwoCharInEveryToken(const std::string& text, const std::string& expects) { - TokenizedString tokens(UTF8ToUTF16(text)); + TokenizedString tokens(base::UTF8ToUTF16(text)); TokenizedStringCharIterator iter(tokens); std::vector<std::string> results; diff --git a/chrome/browser/ui/app_list/search/tokenized_string_match_unittest.cc b/chrome/browser/ui/app_list/search/tokenized_string_match_unittest.cc index b167a29..339d24f 100644 --- a/chrome/browser/ui/app_list/search/tokenized_string_match_unittest.cc +++ b/chrome/browser/ui/app_list/search/tokenized_string_match_unittest.cc @@ -26,7 +26,7 @@ std::string MatchHit(const base::string16& text, marked.insert(hit.start(), 1, '['); } - return UTF16ToUTF8(marked); + return base::UTF16ToUTF8(marked); } TEST(TokenizedStringMatchTest, NotMatch) { @@ -44,8 +44,8 @@ TEST(TokenizedStringMatchTest, NotMatch) { TokenizedStringMatch match; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { - const base::string16 text(UTF8ToUTF16(kTestCases[i].text)); - EXPECT_FALSE(match.Calculate(UTF8ToUTF16(kTestCases[i].query), text)) + const base::string16 text(base::UTF8ToUTF16(kTestCases[i].text)); + EXPECT_FALSE(match.Calculate(base::UTF8ToUTF16(kTestCases[i].query), text)) << "Test case " << i << " : text=" << kTestCases[i].text << ", query=" << kTestCases[i].query; @@ -70,8 +70,8 @@ TEST(TokenizedStringMatchTest, Match) { TokenizedStringMatch match; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { - const base::string16 text(UTF8ToUTF16(kTestCases[i].text)); - EXPECT_TRUE(match.Calculate(UTF8ToUTF16(kTestCases[i].query), text)); + const base::string16 text(base::UTF8ToUTF16(kTestCases[i].text)); + EXPECT_TRUE(match.Calculate(base::UTF8ToUTF16(kTestCases[i].query), text)); EXPECT_EQ(kTestCases[i].expect, MatchHit(text, match)); } } @@ -98,11 +98,11 @@ TEST(TokenizedStringMatchTest, Relevance) { TokenizedStringMatch match_low; TokenizedStringMatch match_high; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { - const base::string16 text(UTF8ToUTF16(kTestCases[i].text)); + const base::string16 text(base::UTF8ToUTF16(kTestCases[i].text)); EXPECT_TRUE( - match_low.Calculate(UTF8ToUTF16(kTestCases[i].query_low), text)); - EXPECT_TRUE( - match_high.Calculate(UTF8ToUTF16(kTestCases[i].query_high), text)); + match_low.Calculate(base::UTF8ToUTF16(kTestCases[i].query_low), text)); + EXPECT_TRUE(match_high.Calculate( + base::UTF8ToUTF16(kTestCases[i].query_high), text)); EXPECT_LT(match_low.relevance(), match_high.relevance()) << "Test case " << i << " : text=" << kTestCases[i].text diff --git a/chrome/browser/ui/app_list/search/tokenized_string_unittest.cc b/chrome/browser/ui/app_list/search/tokenized_string_unittest.cc index 480f846..d5706a1 100644 --- a/chrome/browser/ui/app_list/search/tokenized_string_unittest.cc +++ b/chrome/browser/ui/app_list/search/tokenized_string_unittest.cc @@ -21,7 +21,7 @@ base::string16 GetContent(const TokenizedString& tokenized) { if (i > 0) str += ' '; str += tokens[i]; - str += UTF8ToUTF16(mappings[i].ToString()); + str += base::UTF8ToUTF16(mappings[i].ToString()); } return str; } @@ -36,51 +36,51 @@ TEST(TokenizedStringTest, Empty) { TEST(TokenizedStringTest, Basic) { { - base::string16 text(UTF8ToUTF16("ScratchPad")); + base::string16 text(base::UTF8ToUTF16("ScratchPad")); TokenizedString tokens(text); - EXPECT_EQ(UTF8ToUTF16("scratch{0,7} pad{7,10}"), + EXPECT_EQ(base::UTF8ToUTF16("scratch{0,7} pad{7,10}"), GetContent(tokens)); } { - base::string16 text(UTF8ToUTF16("Chess2.0")); + base::string16 text(base::UTF8ToUTF16("Chess2.0")); TokenizedString tokens(text); - EXPECT_EQ(UTF8ToUTF16("chess{0,5} 2.0{5,8}"), + EXPECT_EQ(base::UTF8ToUTF16("chess{0,5} 2.0{5,8}"), GetContent(tokens)); } { - base::string16 text(UTF8ToUTF16("Cut the rope")); + base::string16 text(base::UTF8ToUTF16("Cut the rope")); TokenizedString tokens(text); - EXPECT_EQ(UTF8ToUTF16("cut{0,3} the{4,7} rope{8,12}"), + EXPECT_EQ(base::UTF8ToUTF16("cut{0,3} the{4,7} rope{8,12}"), GetContent(tokens)); } { - base::string16 text(UTF8ToUTF16("AutoCAD WS")); + base::string16 text(base::UTF8ToUTF16("AutoCAD WS")); TokenizedString tokens(text); - EXPECT_EQ(UTF8ToUTF16("auto{0,4} cad{4,7} ws{8,10}"), + EXPECT_EQ(base::UTF8ToUTF16("auto{0,4} cad{4,7} ws{8,10}"), GetContent(tokens)); } { - base::string16 text(UTF8ToUTF16("Great TweetDeck")); + base::string16 text(base::UTF8ToUTF16("Great TweetDeck")); TokenizedString tokens(text); - EXPECT_EQ(UTF8ToUTF16("great{0,5} tweet{6,11} deck{11,15}"), + EXPECT_EQ(base::UTF8ToUTF16("great{0,5} tweet{6,11} deck{11,15}"), GetContent(tokens)); } { - base::string16 text(UTF8ToUTF16("Draw-It!")); + base::string16 text(base::UTF8ToUTF16("Draw-It!")); TokenizedString tokens(text); - EXPECT_EQ(UTF8ToUTF16("draw{0,4} it{5,7}"), + EXPECT_EQ(base::UTF8ToUTF16("draw{0,4} it{5,7}"), GetContent(tokens)); } { - base::string16 text(UTF8ToUTF16("Faxing & Signing")); + base::string16 text(base::UTF8ToUTF16("Faxing & Signing")); TokenizedString tokens(text); - EXPECT_EQ(UTF8ToUTF16("faxing{0,6} signing{9,16}"), + EXPECT_EQ(base::UTF8ToUTF16("faxing{0,6} signing{9,16}"), GetContent(tokens)); } { - base::string16 text(UTF8ToUTF16("!@#$%^&*()<<<**>>>")); + base::string16 text(base::UTF8ToUTF16("!@#$%^&*()<<<**>>>")); TokenizedString tokens(text); - EXPECT_EQ(UTF8ToUTF16(""), + EXPECT_EQ(base::UTF8ToUTF16(""), GetContent(tokens)); } } diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc b/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc index 88a7008..e52f981 100644 --- a/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc +++ b/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc @@ -52,7 +52,7 @@ void WebstoreProvider::Start(const base::string16& query) { return; } - query_ = UTF16ToUTF8(query); + query_ = base::UTF16ToUTF8(query); const CacheResult result = cache_->Get(WebserviceCache::WEBSTORE, query_); if (result.second) { ProcessWebstoreSearchResults(result.second); diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_provider_browsertest.cc b/chrome/browser/ui/app_list/search/webstore/webstore_provider_browsertest.cc index 981251c..0661c1c 100644 --- a/chrome/browser/ui/app_list/search/webstore/webstore_provider_browsertest.cc +++ b/chrome/browser/ui/app_list/search/webstore/webstore_provider_browsertest.cc @@ -100,7 +100,7 @@ class WebstoreProviderTest : public InProcessBrowserTest { std::string RunQuery(const std::string& query, const std::string& mock_server_response) { - webstore_provider_->Start(UTF8ToUTF16(query)); + webstore_provider_->Start(base::UTF8ToUTF16(query)); if (webstore_provider_->webstore_search_ && !mock_server_response.empty()) { mock_server_response_ = mock_server_response; @@ -125,7 +125,7 @@ class WebstoreProviderTest : public InProcessBrowserTest { ++it) { if (!results.empty()) results += ','; - results += UTF16ToUTF8((*it)->title()); + results += base::UTF16ToUTF8((*it)->title()); } return results; } diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_result.cc b/chrome/browser/ui/app_list/search/webstore/webstore_result.cc index 394530b..ab68865 100644 --- a/chrome/browser/ui/app_list/search/webstore/webstore_result.cc +++ b/chrome/browser/ui/app_list/search/webstore/webstore_result.cc @@ -78,7 +78,7 @@ WebstoreResult::WebstoreResult(Profile* profile, set_id(extensions::Extension::GetBaseURLFromExtensionId(app_id_).spec()); set_relevance(0.0); // What is the right value to use? - set_title(UTF8ToUTF16(localized_name_)); + set_title(base::UTF8ToUTF16(localized_name_)); SetDefaultDetails(); UpdateActions(); |