diff options
Diffstat (limited to 'chrome/browser')
103 files changed, 289 insertions, 314 deletions
diff --git a/chrome/browser/about_flags_unittest.cc b/chrome/browser/about_flags_unittest.cc index 2c2039d..9c2245e 100644 --- a/chrome/browser/about_flags_unittest.cc +++ b/chrome/browser/about_flags_unittest.cc @@ -251,7 +251,7 @@ TEST_F(AboutFlagsTest, CheckValues) { #if defined(OS_WIN) EXPECT_EQ(std::wstring::npos, command_line.GetCommandLineString().find( - base::ASCIIToWide(switch1_with_equals))); + ASCIIToWide(switch1_with_equals))); #else EXPECT_EQ(std::string::npos, command_line.GetCommandLineString().find(switch1_with_equals)); @@ -264,7 +264,7 @@ TEST_F(AboutFlagsTest, CheckValues) { #if defined(OS_WIN) EXPECT_NE(std::wstring::npos, command_line.GetCommandLineString().find( - base::ASCIIToWide(switch2_with_equals))); + ASCIIToWide(switch2_with_equals))); #else EXPECT_NE(std::string::npos, command_line.GetCommandLineString().find(switch2_with_equals)); diff --git a/chrome/browser/accessibility/accessibility_win_browsertest.cc b/chrome/browser/accessibility/accessibility_win_browsertest.cc index e49fd9b..5b980a1 100644 --- a/chrome/browser/accessibility/accessibility_win_browsertest.cc +++ b/chrome/browser/accessibility/accessibility_win_browsertest.cc @@ -176,7 +176,7 @@ void RecursiveFindNodeInAccessibilityTree( for (int i = 0; i < depth; i++) { printf(" "); } - printf("role=%d name=%s\n", role.lVal, base::WideToUTF8(name).c_str()); + printf("role=%d name=%s\n", role.lVal, WideToUTF8(name).c_str()); if (expected_role == role.lVal && expected_name == name) { *found = true; diff --git a/chrome/browser/autocomplete/autocomplete_input_unittest.cc b/chrome/browser/autocomplete/autocomplete_input_unittest.cc index 73cbbf3..e7f9291 100644 --- a/chrome/browser/autocomplete/autocomplete_input_unittest.cc +++ b/chrome/browser/autocomplete/autocomplete_input_unittest.cc @@ -106,7 +106,7 @@ TEST(AutocompleteInputTest, InputType) { { ASCIIToUTF16("127.0.1"), AutocompleteInput::UNKNOWN }, { ASCIIToUTF16("127.0.1/"), AutocompleteInput::URL }, { ASCIIToUTF16("browser.tabs.closeButtons"), AutocompleteInput::UNKNOWN }, - { base::WideToUTF16(L"\u6d4b\u8bd5"), AutocompleteInput::UNKNOWN }, + { WideToUTF16(L"\u6d4b\u8bd5"), AutocompleteInput::UNKNOWN }, { ASCIIToUTF16("[2001:]"), AutocompleteInput::QUERY }, { ASCIIToUTF16("[2001:dB8::1]"), AutocompleteInput::URL }, { ASCIIToUTF16("192.168.0.256"), AutocompleteInput::QUERY }, @@ -150,9 +150,8 @@ TEST(AutocompleteInputTest, InputTypeWithDesiredTLD) { // This tests for a regression where certain input in the omnibox caused us to // crash. As long as the test completes without crashing, we're fine. TEST(AutocompleteInputTest, InputCrash) { - AutocompleteInput input(base::WideToUTF16(L"\uff65@s"), string16::npos, - string16(), true, false, true, - AutocompleteInput::ALL_MATCHES); + AutocompleteInput input(WideToUTF16(L"\uff65@s"), string16::npos, string16(), + true, false, true, AutocompleteInput::ALL_MATCHES); } TEST(AutocompleteInputTest, ParseForEmphasizeComponent) { @@ -171,7 +170,7 @@ TEST(AutocompleteInputTest, ParseForEmphasizeComponent) { { ASCIIToUTF16("http://foo/bar baz"), Component(0, 4), Component(7, 3) }, { ASCIIToUTF16("link:foo.com"), Component(0, 4), kInvalidComponent }, { ASCIIToUTF16("www.foo.com:81"), kInvalidComponent, Component(0, 11) }, - { base::WideToUTF16(L"\u6d4b\u8bd5"), kInvalidComponent, Component(0, 2) }, + { WideToUTF16(L"\u6d4b\u8bd5"), kInvalidComponent, Component(0, 2) }, { ASCIIToUTF16("view-source:http://www.foo.com/"), Component(12, 4), Component(19, 11) }, { ASCIIToUTF16("view-source:https://example.com/"), diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc index 6d06310..b7a14bc 100644 --- a/chrome/browser/autocomplete/history_url_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc @@ -485,10 +485,9 @@ TEST_F(HistoryURLProviderTest, Fixup) { RunTest(ASCIIToUTF16("#"), string16(), false, NULL, 0); RunTest(ASCIIToUTF16("%20"), string16(), false, NULL, 0); const std::string fixup_crash[] = {"http://%EF%BD%A5@s/"}; - RunTest(base::WideToUTF16(L"\uff65@s"), string16(), false, fixup_crash, + RunTest(WideToUTF16(L"\uff65@s"), string16(), false, fixup_crash, arraysize(fixup_crash)); - RunTest(base::WideToUTF16(L"\u2015\u2015@ \uff7c"), string16(), false, - NULL, 0); + RunTest(WideToUTF16(L"\u2015\u2015@ \uff7c"), string16(), false, NULL, 0); // Fixing up "file:" should result in an inline autocomplete offset of just // after "file:", not just after "file://". @@ -529,7 +528,7 @@ TEST_F(HistoryURLProviderTest, Fixup) { } TEST_F(HistoryURLProviderTest, AdjustOffset) { - RunAdjustOffsetTest(base::WideToUTF16(L"http://www.\uAD50\uC721"), 13); + RunAdjustOffsetTest(WideToUTF16(L"http://www.\uAD50\uC721"), 13); RunAdjustOffsetTest(ASCIIToUTF16("http://spaces.com/path%20with%20spa"), 31); RunAdjustOffsetTest(ASCIIToUTF16("http://ms/c++ s"), 15); } diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc index 771f60d..4c56770 100644 --- a/chrome/browser/autofill/autofill_browsertest.cc +++ b/chrome/browser/autofill/autofill_browsertest.cc @@ -47,7 +47,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/keycodes/keyboard_codes.h" -using base::WideToUTF16; using content::RenderViewHost; using content::RenderViewHostTester; using content::WebContents; diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 1c37f6a..b1af9f2 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -989,7 +989,7 @@ void TestingAutomationProvider::GetTabTitle(int handle, NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); if (entry != NULL) { - *title = base::UTF16ToWideHack(entry->GetTitleForDisplay("")); + *title = UTF16ToWideHack(entry->GetTitleForDisplay("")); } else { *title = std::wstring(); } @@ -1050,9 +1050,8 @@ void TestingAutomationProvider::ExecuteJavascript( } new DomOperationMessageSender(this, reply_message, false); - ExecuteJavascriptInRenderViewFrame(base::WideToUTF16Hack(frame_xpath), - base::WideToUTF16Hack(script), - reply_message, + ExecuteJavascriptInRenderViewFrame(WideToUTF16Hack(frame_xpath), + WideToUTF16Hack(script), reply_message, web_contents->GetRenderViewHost()); } diff --git a/chrome/browser/bookmarks/bookmark_index_unittest.cc b/chrome/browser/bookmarks/bookmark_index_unittest.cc index 94004ac..f9ae84e 100644 --- a/chrome/browser/bookmarks/bookmark_index_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_index_unittest.cc @@ -220,7 +220,7 @@ TEST_F(BookmarkIndexTest, HonorMax) { // than the upper case string no match positions are returned. TEST_F(BookmarkIndexTest, EmptyMatchOnMultiwideLowercaseString) { const BookmarkNode* n1 = model_->AddURL(model_->other_node(), 0, - base::WideToUTF16(L"\u0130 i"), + WideToUTF16(L"\u0130 i"), GURL("http://www.google.com")); std::vector<bookmark_utils::TitleMatch> matches; diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc index dba5080..cc1939c 100644 --- a/chrome/browser/bookmarks/bookmark_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc @@ -291,7 +291,7 @@ TEST_F(BookmarkModelTest, AddURL) { TEST_F(BookmarkModelTest, AddURLWithUnicodeTitle) { const BookmarkNode* root = model_.bookmark_bar_node(); - const string16 title(base::WideToUTF16( + const string16 title(WideToUTF16( L"\u767e\u5ea6\u4e00\u4e0b\uff0c\u4f60\u5c31\u77e5\u9053")); const GURL url("https://www.baidu.com/"); diff --git a/chrome/browser/bookmarks/bookmark_utils_unittest.cc b/chrome/browser/bookmarks/bookmark_utils_unittest.cc index b394c0f..e83a86b 100644 --- a/chrome/browser/bookmarks/bookmark_utils_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_utils_unittest.cc @@ -78,7 +78,7 @@ TEST_F(BookmarkUtilsTest, DoesBookmarkContainText) { EXPECT_FALSE(DoesBookmarkContainText(node, ASCIIToUTF16("cnn"), string())); // Tests for a Japanese IDN. - const string16 kDecodedIdn = base::WideToUTF16(L"\x30B0\x30FC\x30B0\x30EB"); + const string16 kDecodedIdn = WideToUTF16(L"\x30B0\x30FC\x30B0\x30EB"); node = model.AddURL(model.other_node(), 0, ASCIIToUTF16("foo bar"), @@ -108,24 +108,24 @@ TEST_F(BookmarkUtilsTest, DoesBookmarkContainText) { // Test with accents. node = model.AddURL(model.other_node(), 0, - base::WideToUTF16(L"fr\u00E4n\u00E7\u00F3s\u00EA"), + WideToUTF16(L"fr\u00E4n\u00E7\u00F3s\u00EA"), GURL("http://www.google.com/search?q=FBA")); EXPECT_TRUE(DoesBookmarkContainText(node, ASCIIToUTF16("francose"), string())); EXPECT_TRUE(DoesBookmarkContainText(node, ASCIIToUTF16("FrAnCoSe"), string())); - EXPECT_TRUE(DoesBookmarkContainText(node, base::WideToUTF16(L"fr\u00E4ncose"), + EXPECT_TRUE(DoesBookmarkContainText(node, WideToUTF16(L"fr\u00E4ncose"), string())); - EXPECT_TRUE(DoesBookmarkContainText(node, base::WideToUTF16(L"fran\u00E7ose"), + EXPECT_TRUE(DoesBookmarkContainText(node, WideToUTF16(L"fran\u00E7ose"), string())); - EXPECT_TRUE(DoesBookmarkContainText(node, base::WideToUTF16(L"franc\u00F3se"), + EXPECT_TRUE(DoesBookmarkContainText(node, WideToUTF16(L"franc\u00F3se"), string())); - EXPECT_TRUE(DoesBookmarkContainText(node, base::WideToUTF16(L"francos\u00EA"), + EXPECT_TRUE(DoesBookmarkContainText(node, WideToUTF16(L"francos\u00EA"), string())); EXPECT_TRUE(DoesBookmarkContainText( - node, base::WideToUTF16(L"Fr\u00C4n\u00C7\u00F3S\u00EA"), string())); + node, WideToUTF16(L"Fr\u00C4n\u00C7\u00F3S\u00EA"), string())); EXPECT_TRUE(DoesBookmarkContainText( - node, base::WideToUTF16(L"fr\u00C4n\u00C7\u00D3s\u00CA"), string())); + node, WideToUTF16(L"fr\u00C4n\u00C7\u00D3s\u00CA"), string())); EXPECT_TRUE(DoesBookmarkContainText(node, ASCIIToUTF16("fba"), string())); EXPECT_TRUE(DoesBookmarkContainText(node, ASCIIToUTF16("FBA"), string())); } diff --git a/chrome/browser/browser_keyevents_browsertest.cc b/chrome/browser/browser_keyevents_browsertest.cc index 7fdfde3..6704bc1 100644 --- a/chrome/browser/browser_keyevents_browsertest.cc +++ b/chrome/browser/browser_keyevents_browsertest.cc @@ -205,7 +205,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { browser()->tab_strip_model()->GetWebContentsAt(tab_index), kGetFocusedElementJS, &actual)); - ASSERT_EQ(base::WideToUTF8(focused), actual); + ASSERT_EQ(WideToUTF8(focused), actual); } void SetFocusedElement(int tab_index, const wchar_t* focused) { @@ -226,7 +226,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { browser()->tab_strip_model()->GetWebContentsAt(tab_index), base::StringPrintf(kGetTextBoxValueJS, id), &actual)); - ASSERT_EQ(base::WideToUTF8(value), actual); + ASSERT_EQ(WideToUTF8(value), actual); } void SetTextBoxValue(int tab_index, const wchar_t* id, @@ -237,7 +237,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { browser()->tab_strip_model()->GetWebContentsAt(tab_index), base::StringPrintf(kSetTextBoxValueJS, id, value), &actual)); - ASSERT_EQ(base::WideToUTF8(value), actual); + ASSERT_EQ(WideToUTF8(value), actual); } void StartTest(int tab_index, int result_length) { diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 1361fe6..995060b 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -278,7 +278,7 @@ PrefService* InitializeLocalState( std::wstring install_lang; if (GoogleUpdateSettings::GetLanguage(&install_lang)) { local_state->SetString(prefs::kApplicationLocale, - base::WideToASCII(install_lang)); + WideToASCII(install_lang)); } #endif // defined(OS_WIN) } @@ -1186,7 +1186,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { case ProcessSingleton::PROCESS_NOTIFIED: #if defined(OS_POSIX) && !defined(OS_MACOSX) - printf("%s\n", base::SysWideToNativeMB(base::UTF16ToWide( + printf("%s\n", base::SysWideToNativeMB(UTF16ToWide( l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str()); #endif // Having a differentiated return type for testing allows for tests to diff --git a/chrome/browser/chromeos/login/version_info_updater.cc b/chrome/browser/chromeos/login/version_info_updater.cc index 3676e9f..cc596f5 100644 --- a/chrome/browser/chromeos/login/version_info_updater.cc +++ b/chrome/browser/chromeos/login/version_info_updater.cc @@ -159,7 +159,7 @@ void VersionInfoUpdater::OnBootTimes( boot_times.pre_startup, boot_times.system); } - // Use base::UTF8ToWide once this string is localized. + // Use UTF8ToWide once this string is localized. if (delegate_) delegate_->OnBootTimesLabelTextUpdated(boot_times_text); } diff --git a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc index 2f99625..bc35174 100644 --- a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc @@ -84,14 +84,14 @@ IN_PROC_BROWSER_TEST_F(WizardControllerTest, SwitchLanguage) { EXPECT_STREQ("en", icu::Locale::getDefault().getLanguage()); EXPECT_FALSE(base::i18n::IsRTL()); const std::wstring en_str = - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_NETWORK_SELECTION_TITLE)); + UTF16ToWide(l10n_util::GetStringUTF16(IDS_NETWORK_SELECTION_TITLE)); LanguageSwitchMenu::SwitchLanguage("fr"); EXPECT_EQ("fr", g_browser_process->GetApplicationLocale()); EXPECT_STREQ("fr", icu::Locale::getDefault().getLanguage()); EXPECT_FALSE(base::i18n::IsRTL()); const std::wstring fr_str = - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_NETWORK_SELECTION_TITLE)); + UTF16ToWide(l10n_util::GetStringUTF16(IDS_NETWORK_SELECTION_TITLE)); EXPECT_NE(en_str, fr_str); @@ -100,7 +100,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerTest, SwitchLanguage) { EXPECT_STREQ("ar", icu::Locale::getDefault().getLanguage()); EXPECT_TRUE(base::i18n::IsRTL()); const std::wstring ar_str = - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_NETWORK_SELECTION_TITLE)); + UTF16ToWide(l10n_util::GetStringUTF16(IDS_NETWORK_SELECTION_TITLE)); EXPECT_NE(fr_str, ar_str); } diff --git a/chrome/browser/crash_upload_list_win.cc b/chrome/browser/crash_upload_list_win.cc index 58fecbf..7c4e948 100644 --- a/chrome/browser/crash_upload_list_win.cc +++ b/chrome/browser/crash_upload_list_win.cc @@ -73,7 +73,7 @@ void CrashUploadListWin::ProcessPossibleCrashLogRecord(EVENTLOGRECORD* record) { std::wstring crash_id = message.substr(start_index, end_index - start_index); crashes().push_back( - CrashInfo(base::Sysbase::WideToUTF8(crash_id), + CrashInfo(base::SysWideToUTF8(crash_id), base::Time::FromDoubleT(record->TimeGenerated))); } } diff --git a/chrome/browser/diagnostics/diagnostics_main.cc b/chrome/browser/diagnostics/diagnostics_main.cc index 02ef604..cb44bc0 100644 --- a/chrome/browser/diagnostics/diagnostics_main.cc +++ b/chrome/browser/diagnostics/diagnostics_main.cc @@ -216,7 +216,7 @@ class TestWriter { } bool WriteInfoText(const std::string& txt) { - return WriteInfoText(base::UTF8ToWide(txt)); + return WriteInfoText(UTF8ToWide(txt)); } // Write a result block. It consist of two lines. The first line @@ -318,8 +318,8 @@ class TestController : public DiagnosticsModel::Observer { private: void ShowResult(DiagnosticsModel::TestInfo* test_info) { bool success = (DiagnosticsModel::TEST_OK == test_info->GetResult()); - writer_->WriteResult(success, base::UTF16ToWide(test_info->GetTitle()), - base::UTF16ToWide(test_info->GetAdditionalInfo())); + writer_->WriteResult(success, UTF16ToWide(test_info->GetTitle()), + UTF16ToWide(test_info->GetAdditionalInfo())); } DiagnosticsModel* model_; diff --git a/chrome/browser/download/download_extensions.cc b/chrome/browser/download/download_extensions.cc index 85a22e4..5cb782d 100644 --- a/chrome/browser/download/download_extensions.cc +++ b/chrome/browser/download/download_extensions.cc @@ -219,7 +219,7 @@ DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path) { if (!IsStringASCII(extension)) return NotDangerous; #if defined(OS_WIN) - std::string ascii_extension = base::WideToASCII(extension); + std::string ascii_extension = WideToASCII(extension); #elif defined(OS_POSIX) std::string ascii_extension = extension; #endif diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc index 3d48741..abd8dff 100644 --- a/chrome/browser/download/download_prefs.cc +++ b/chrome/browser/download/download_prefs.cc @@ -69,7 +69,7 @@ DownloadPrefs::DownloadPrefs(Profile* profile) : profile_(profile) { #if defined(OS_POSIX) base::FilePath path(extensions[i]); #elif defined(OS_WIN) - base::FilePath path(base::UTF8ToWide(extensions[i])); + base::FilePath path(UTF8ToWide(extensions[i])); #endif if (!extensions[i].empty() && download_util::GetFileDangerLevel(path) == download_util::NotDangerous) @@ -196,7 +196,7 @@ void DownloadPrefs::SaveAutoOpenState() { std::string this_extension = *it; #elif defined(OS_WIN) // TODO(phajdan.jr): Why we're using Sys conversion here, but not in ctor? - std::string this_extension = base::Sysbase::WideToUTF8(*it); + std::string this_extension = base::SysWideToUTF8(*it); #endif extensions += this_extension + ":"; } diff --git a/chrome/browser/download/save_package_file_picker.cc b/chrome/browser/download/save_package_file_picker.cc index cac3990..6ed710e 100644 --- a/chrome/browser/download/save_package_file_picker.cc +++ b/chrome/browser/download/save_package_file_picker.cc @@ -211,7 +211,7 @@ void SavePackageFilePicker::FileSelected(const base::FilePath& path, #if defined(OS_POSIX) std::string path_string = path.DirName().value(); #elif defined(OS_WIN) - std::string path_string = base::WideToUTF8(path.DirName().value()); + std::string path_string = WideToUTF8(path.DirName().value()); #endif // If user change the default saving directory, we will remember it just // like IE and FireFox. diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc index c19dd55..b6818de 100644 --- a/chrome/browser/enumerate_modules_model_win.cc +++ b/chrome/browser/enumerate_modules_model_win.cc @@ -335,8 +335,8 @@ ModuleEnumerator::ModuleStatus ModuleEnumerator::Match( DCHECK(!strstr(blacklisted.version_to, " ")); std::string filename_hash, location_hash; - GenerateHash(base::WideToUTF8(module.name), &filename_hash); - GenerateHash(base::WideToUTF8(module.location), &location_hash); + GenerateHash(WideToUTF8(module.name), &filename_hash); + GenerateHash(WideToUTF8(module.location), &location_hash); // Filenames are mandatory. Location is mandatory if given. if (filename_hash == blacklisted.filename && @@ -364,8 +364,8 @@ ModuleEnumerator::ModuleStatus ModuleEnumerator::Match( std::string desc_or_signer(blacklisted.desc_or_signer); std::string signer_hash, description_hash; - GenerateHash(base::WideToUTF8(module.digital_signer), &signer_hash); - GenerateHash(base::WideToUTF8(module.description), &description_hash); + GenerateHash(WideToUTF8(module.digital_signer), &signer_hash); + GenerateHash(WideToUTF8(module.description), &description_hash); // If signatures match (or both are empty), then we have a winner. if (signer_hash == desc_or_signer) @@ -606,7 +606,7 @@ void ModuleEnumerator::PreparePathMappings() { for (std::vector<string16>::const_iterator variable = env_vars.begin(); variable != env_vars.end(); ++variable) { std::string path; - if (environment->GetVar(base::WideToASCII(*variable).c_str(), &path)) { + if (environment->GetVar(WideToASCII(*variable).c_str(), &path)) { path_mapping_.push_back( std::make_pair(base::i18n::ToLower(UTF8ToUTF16(path)) + L"\\", L"%" + base::i18n::ToLower(*variable) + L"%")); @@ -834,16 +834,16 @@ ListValue* EnumerateModulesModel::GetModuleList() const { if ((module->type & ModuleEnumerator::LOADED_MODULE) == 0) { // Module is not loaded, denote type of module. if (module->type & ModuleEnumerator::SHELL_EXTENSION) - type_string = base::ASCIIToWide("Shell Extension"); + type_string = ASCIIToWide("Shell Extension"); if (module->type & ModuleEnumerator::WINSOCK_MODULE_REGISTRATION) { if (!type_string.empty()) - type_string += base::ASCIIToWide(", "); - type_string += base::ASCIIToWide("Winsock"); + type_string += ASCIIToWide(", "); + type_string += ASCIIToWide("Winsock"); } // Must be one of the above type. DCHECK(!type_string.empty()); if (!limited_mode_) { - type_string += base::ASCIIToWide(" -- "); + type_string += ASCIIToWide(" -- "); type_string += l10n_util::GetStringUTF16(IDS_CONFLICTS_NOT_LOADED_YET); } } @@ -859,9 +859,9 @@ ListValue* EnumerateModulesModel::GetModuleList() const { if (!limited_mode_) { // Figure out the possible resolution help string. string16 actions; - string16 separator = base::ASCIIToWide(" ") + l10n_util::GetStringUTF16( + string16 separator = ASCIIToWide(" ") + l10n_util::GetStringUTF16( IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_SEPERATOR) + - base::ASCIIToWide(" "); + ASCIIToWide(" "); if (module->recommended_action & ModuleEnumerator::NONE) { actions = l10n_util::GetStringUTF16( @@ -885,9 +885,9 @@ ListValue* EnumerateModulesModel::GetModuleList() const { actions += l10n_util::GetStringUTF16( IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_DISABLE); } - string16 possible_resolution = actions.empty() ? base::ASCIIToWide("") : + string16 possible_resolution = actions.empty() ? ASCIIToWide("") : l10n_util::GetStringUTF16(IDS_CONFLICTS_CHECK_POSSIBLE_ACTIONS) + - base::ASCIIToWide(" ") + + ASCIIToWide(" ") + actions; data->SetString("possibleResolution", possible_resolution); data->SetString("help_url", @@ -970,10 +970,10 @@ GURL EnumerateModulesModel::ConstructHelpCenterUrl( // Construct the needed hashes. std::string filename, location, description, signer; - GenerateHash(base::WideToUTF8(module.name), &filename); - GenerateHash(base::WideToUTF8(module.location), &location); - GenerateHash(base::WideToUTF8(module.description), &description); - GenerateHash(base::WideToUTF8(module.digital_signer), &signer); + GenerateHash(WideToUTF8(module.name), &filename); + GenerateHash(WideToUTF8(module.location), &location); + GenerateHash(WideToUTF8(module.description), &description); + GenerateHash(WideToUTF8(module.digital_signer), &signer); string16 url = l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, ASCIIToUTF16(filename), ASCIIToUTF16(location), diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index f5aff18..fb75d20 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -635,10 +635,10 @@ bool DeveloperPrivatePackDirectoryFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(2, &flags)); base::FilePath root_directory = - base::FilePath::FromWStringHack(base::UTF8ToWide(item_path_str_)); + base::FilePath::FromWStringHack(UTF8ToWide(item_path_str_)); base::FilePath key_file = - base::FilePath::FromWStringHack(base::UTF8ToWide(key_path_str_)); + base::FilePath::FromWStringHack(UTF8ToWide(key_path_str_)); developer::PackDirectoryResponse response; if (root_directory.empty()) { diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc index 014c324..5435410 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api.cc +++ b/chrome/browser/extensions/api/file_system/file_system_api.cc @@ -231,7 +231,7 @@ bool GetFileTypesFromAcceptOption( std::string extension = *iter; StringToLowerASCII(&extension); #if defined(OS_WIN) - extension_set.insert(base::UTF8ToWide(*iter)); + extension_set.insert(UTF8ToWide(*iter)); #else extension_set.insert(*iter); #endif diff --git a/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc b/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc index 3334ff5..dafa230 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc +++ b/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc @@ -48,7 +48,7 @@ AcceptOption* BuildAcceptOption(std::string description, } #if defined(OS_WIN) -#define ToStringType base::UTF8ToWide +#define ToStringType UTF8ToWide #else #define ToStringType #endif diff --git a/chrome/browser/extensions/api/serial/serial_port_enumerator_win.cc b/chrome/browser/extensions/api/serial/serial_port_enumerator_win.cc index ffb4988..090dccb 100644 --- a/chrome/browser/extensions/api/serial/serial_port_enumerator_win.cc +++ b/chrome/browser/extensions/api/serial/serial_port_enumerator_win.cc @@ -22,7 +22,7 @@ SerialPortEnumerator::GenerateValidSerialPortNames() { for (; iter_key.Valid(); ++iter_key) { string16 str(iter_key.Value()); - std::string device_string(base::WideToASCII(str)); + std::string device_string(WideToASCII(str)); name_set.insert(device_string); } return name_set; diff --git a/chrome/browser/extensions/api/system_info_storage/storage_info_provider_win.cc b/chrome/browser/extensions/api/system_info_storage/storage_info_provider_win.cc index 1cd8ea8..a8c8088 100644 --- a/chrome/browser/extensions/api/system_info_storage/storage_info_provider_win.cc +++ b/chrome/browser/extensions/api/system_info_storage/storage_info_provider_win.cc @@ -47,8 +47,7 @@ bool StorageInfoProviderWin::QueryInfo(StorageInfo* info) { // Iterate the drive string by 4 wchars each step for (unsigned int i = 0; i < string_length; i += 4) { linked_ptr<StorageUnitInfo> unit(new StorageUnitInfo()); - if (QueryUnitInfo(base::WideToUTF8(&logical_drive_strings[i]), - unit.get())) { + if (QueryUnitInfo(WideToUTF8(&logical_drive_strings[i]), unit.get())) { info->push_back(unit); } } diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index f91a7b7..f3afc2a 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc @@ -2100,7 +2100,7 @@ void ExecuteCodeInTabFunction::DidLoadAndLocalizeFile(bool success, resource_.relative_path().value()); #elif defined(OS_WIN) error_ = ErrorUtils::FormatErrorMessage(keys::kLoadFileError, - base::WideToUTF8(resource_.relative_path().value())); + WideToUTF8(resource_.relative_path().value())); #endif // OS_WIN SendResponse(false); } diff --git a/chrome/browser/extensions/app_notification_storage.cc b/chrome/browser/extensions/app_notification_storage.cc index 2c586ad..30d7977 100644 --- a/chrome/browser/extensions/app_notification_storage.cc +++ b/chrome/browser/extensions/app_notification_storage.cc @@ -214,7 +214,7 @@ bool LevelDbAppNotificationStorage::OpenDbIfNeeded(bool create_if_missing) { #if defined(OS_POSIX) std::string os_path = path_.value(); #elif defined(OS_WIN) - std::string os_path = base::Sysbase::WideToUTF8(path_.value()); + std::string os_path = base::SysWideToUTF8(path_.value()); #endif leveldb::Options options; diff --git a/chrome/browser/extensions/browser_action_apitest.cc b/chrome/browser/extensions/browser_action_apitest.cc index 2b3a220..c09a3d2 100644 --- a/chrome/browser/extensions/browser_action_apitest.cc +++ b/chrome/browser/extensions/browser_action_apitest.cc @@ -19,13 +19,12 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TitleLocalizationBrowserAction) { ASSERT_EQ(size_before + 1, service->extensions()->size()); - EXPECT_STREQ( - base::WideToUTF8(L"Hreggvi\u00F0ur: l10n browser action").c_str(), - extension->description().c_str()); - EXPECT_STREQ(base::WideToUTF8(L"Hreggvi\u00F0ur is my name").c_str(), + EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur: l10n browser action").c_str(), + extension->description().c_str()); + EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur is my name").c_str(), extension->name().c_str()); int tab_id = ExtensionTabUtil::GetTabId( browser()->tab_strip_model()->GetActiveWebContents()); - EXPECT_STREQ(base::WideToUTF8(L"Hreggvi\u00F0ur").c_str(), + EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur").c_str(), extension->browser_action()->GetTitle(tab_id).c_str()); } diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc index 2895378..5e226d1 100644 --- a/chrome/browser/extensions/extension_prefs.cc +++ b/chrome/browser/extensions/extension_prefs.cc @@ -1551,7 +1551,7 @@ base::FilePath ExtensionPrefs::GetExtensionPath( return base::FilePath(); return install_directory_.Append( - base::FilePath::FromWStringHack(base::UTF8ToWide(path))); + base::FilePath::FromWStringHack(UTF8ToWide(path))); } void ExtensionPrefs::UpdateExtensionPref(const std::string& extension_id, diff --git a/chrome/browser/extensions/external_pref_loader.cc b/chrome/browser/extensions/external_pref_loader.cc index f030223..b0c89d2 100644 --- a/chrome/browser/extensions/external_pref_loader.cc +++ b/chrome/browser/extensions/external_pref_loader.cc @@ -40,7 +40,7 @@ std::set<base::FilePath> GetPrefsCandidateFilesFromFolder( false, // Recursive. file_util::FileEnumerator::FILES); #if defined(OS_WIN) - base::FilePath::StringType extension = base::UTF8ToWide(std::string(".json")); + base::FilePath::StringType extension = UTF8ToWide(std::string(".json")); #elif defined(OS_POSIX) base::FilePath::StringType extension(".json"); #endif @@ -210,7 +210,7 @@ void ExternalPrefLoader::ReadStandaloneExtensionPrefFiles( std::string id = #if defined(OS_WIN) - base::WideToASCII( + WideToASCII( extension_candidate_path.RemoveExtension().BaseName().value()); #elif defined(OS_POSIX) extension_candidate_path.RemoveExtension().BaseName().value().c_str(); diff --git a/chrome/browser/extensions/external_registry_loader_win.cc b/chrome/browser/extensions/external_registry_loader_win.cc index 21f54f5..23ed0ab 100644 --- a/chrome/browser/extensions/external_registry_loader_win.cc +++ b/chrome/browser/extensions/external_registry_loader_win.cc @@ -56,11 +56,11 @@ void ExternalRegistryLoader::LoadOnFileThread() { // A map of IDs, to weed out duplicates between HKCU and HKLM. std::set<string16> keys; base::win::RegistryKeyIterator iterator_machine_key( - HKEY_LOCAL_MACHINE, base::ASCIIToWide(kRegistryExtensions).c_str()); + HKEY_LOCAL_MACHINE, ASCIIToWide(kRegistryExtensions).c_str()); for (; iterator_machine_key.Valid(); ++iterator_machine_key) keys.insert(iterator_machine_key.Name()); base::win::RegistryKeyIterator iterator_user_key( - HKEY_CURRENT_USER, base::ASCIIToWide(kRegistryExtensions).c_str()); + HKEY_CURRENT_USER, ASCIIToWide(kRegistryExtensions).c_str()); for (; iterator_user_key.Valid(); ++iterator_user_key) keys.insert(iterator_user_key.Name()); @@ -70,7 +70,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { for (std::set<string16>::const_iterator it = keys.begin(); it != keys.end(); ++it) { base::win::RegKey key; - string16 key_path = base::ASCIIToWide(kRegistryExtensions); + string16 key_path = ASCIIToWide(kRegistryExtensions); key_path.append(L"\\"); key_path.append(*it); if (key.Open(HKEY_LOCAL_MACHINE, @@ -124,7 +124,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { continue; } - std::string id = base::WideToASCII(*it); + std::string id = WideToASCII(*it); StringToLowerASCII(&id); if (!Extension::IdIsValid(id)) { LOG(ERROR) << "Invalid id value " << id @@ -132,7 +132,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { continue; } - Version version(base::WideToASCII(extension_version)); + Version version(WideToASCII(extension_version)); if (!version.IsValid()) { LOG(ERROR) << "Invalid version value " << extension_version << " for key " << key_path << "."; @@ -141,7 +141,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { prefs->SetString( id + "." + ExternalProviderImpl::kExternalVersion, - base::WideToASCII(extension_version)); + WideToASCII(extension_version)); prefs->SetString( id + "." + ExternalProviderImpl::kExternalCrx, extension_path_str); diff --git a/chrome/browser/extensions/page_action_browsertest.cc b/chrome/browser/extensions/page_action_browsertest.cc index aa8262ff..75a4525 100644 --- a/chrome/browser/extensions/page_action_browsertest.cc +++ b/chrome/browser/extensions/page_action_browsertest.cc @@ -190,13 +190,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TitleLocalizationPageAction) { ASSERT_EQ(size_before + 1, service->extensions()->size()); - EXPECT_STREQ(base::WideToUTF8(L"Hreggvi\u00F0ur: l10n page action").c_str(), + EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur: l10n page action").c_str(), extension->description().c_str()); - EXPECT_STREQ(base::WideToUTF8(L"Hreggvi\u00F0ur is my name").c_str(), + EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur is my name").c_str(), extension->name().c_str()); int tab_id = ExtensionTabUtil::GetTabId( browser()->tab_strip_model()->GetActiveWebContents()); - EXPECT_STREQ(base::WideToUTF8(L"Hreggvi\u00F0ur").c_str(), + EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur").c_str(), ExtensionActionManager::Get(browser()->profile())-> GetPageAction(*extension)-> GetTitle(tab_id).c_str()); diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc index 9dfba7a..d772d2a 100644 --- a/chrome/browser/extensions/sandboxed_unpacker.cc +++ b/chrome/browser/extensions/sandboxed_unpacker.cc @@ -749,7 +749,7 @@ bool SandboxedUnpacker::RewriteCatalogFiles() { // TODO(viettrungluu): Fix the |FilePath::FromWStringHack(UTF8ToWide())| // hack and remove the corresponding #include. base::FilePath relative_path = - base::FilePath::FromWStringHack(base::UTF8ToWide(*key_it)); + base::FilePath::FromWStringHack(UTF8ToWide(*key_it)); relative_path = relative_path.Append(Extension::kMessagesFilename); if (relative_path.IsAbsolute() || relative_path.ReferencesParent()) { // Invalid path for catalog. diff --git a/chrome/browser/first_run/first_run_posix.cc b/chrome/browser/first_run/first_run_posix.cc index cd3bf12..f71cf81 100644 --- a/chrome/browser/first_run/first_run_posix.cc +++ b/chrome/browser/first_run/first_run_posix.cc @@ -126,7 +126,7 @@ void SetImportPreferencesAndLaunchImport( &import_bookmarks_path); if (!import_bookmarks_path.empty()) { // There are bookmarks to import from a file. - base::FilePath path = base::FilePath::FromWStringHack(base::UTF8ToWide( + base::FilePath path = base::FilePath::FromWStringHack(UTF8ToWide( import_bookmarks_path)); if (!ImportBookmarks(path)) { LOG(WARNING) << "silent bookmark import failed"; diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc index 6d8ab51..766ac29 100644 --- a/chrome/browser/first_run/first_run_win.cc +++ b/chrome/browser/first_run/first_run_win.cc @@ -448,9 +448,8 @@ void SetImportPreferencesAndLaunchImport( importer_list->DetectSourceProfilesHack(); if (!ImportSettingsWin( NULL, importer_list->GetSourceProfileAt(0).importer_type, - out_prefs->do_import_items, - base::FilePath::FromWStringHack( - base::UTF8ToWide(import_bookmarks_path)), true)) { + out_prefs->do_import_items, base::FilePath::FromWStringHack(UTF8ToWide( + import_bookmarks_path)), true)) { LOG(WARNING) << "silent import failed"; } } diff --git a/chrome/browser/first_run/upgrade_util_win.cc b/chrome/browser/first_run/upgrade_util_win.cc index 6f01283..59754ad 100644 --- a/chrome/browser/first_run/upgrade_util_win.cc +++ b/chrome/browser/first_run/upgrade_util_win.cc @@ -210,7 +210,7 @@ bool SwapNewChromeExeIfPresent() { std::wstring pv_value; if (key.ReadValue(google_update::kRegVersionField, &pv_value) == ERROR_SUCCESS) { - Version pv_version(base::WideToASCII(pv_value)); + Version pv_version(WideToASCII(pv_value)); if (cmd_version.IsValid() && pv_version.IsValid() && !cmd_version.Equals(pv_version)) { return false; diff --git a/chrome/browser/google/google_update_settings_posix.cc b/chrome/browser/google/google_update_settings_posix.cc index 1aeb455..f593a9e 100644 --- a/chrome/browser/google/google_update_settings_posix.cc +++ b/chrome/browser/google/google_update_settings_posix.cc @@ -65,7 +65,7 @@ bool GoogleUpdateSettings::SetMetricsId(const std::wstring& client_id) { return false; // Since user has consented, write the metrics id to the file. - google_update::posix_guid() = base::WideToASCII(client_id); + google_update::posix_guid() = WideToASCII(client_id); return GoogleUpdateSettings::SetCollectStatsConsent(true); } diff --git a/chrome/browser/google/google_util.cc b/chrome/browser/google/google_util.cc index d91ea85..f3d0575 100644 --- a/chrome/browser/google/google_util.cc +++ b/chrome/browser/google/google_util.cc @@ -120,7 +120,7 @@ bool GetBrand(std::string* brand) { string16 brand16; bool ret = GoogleUpdateSettings::GetBrand(&brand16); if (ret) - brand->assign(base::WideToASCII(brand16)); + brand->assign(WideToASCII(brand16)); return ret; } @@ -128,7 +128,7 @@ bool GetReactivationBrand(std::string* brand) { string16 brand16; bool ret = GoogleUpdateSettings::GetReactivationBrand(&brand16); if (ret) - brand->assign(base::WideToASCII(brand16)); + brand->assign(WideToASCII(brand16)); return ret; } diff --git a/chrome/browser/google_apis/gdata_wapi_parser.cc b/chrome/browser/google_apis/gdata_wapi_parser.cc index 97a011a..fd034f7 100644 --- a/chrome/browser/google_apis/gdata_wapi_parser.cc +++ b/chrome/browser/google_apis/gdata_wapi_parser.cc @@ -580,7 +580,7 @@ std::string ResourceEntry::GetHostedDocumentExtension() const { // static bool ResourceEntry::HasHostedDocumentExtension(const base::FilePath& file) { #if defined(OS_WIN) - std::string file_extension = base::WideToUTF8(file.Extension()); + std::string file_extension = WideToUTF8(file.Extension()); #else std::string file_extension = file.Extension(); #endif diff --git a/chrome/browser/history/history_publisher_win.cc b/chrome/browser/history/history_publisher_win.cc index 1d7d4a5..31e5241 100644 --- a/chrome/browser/history/history_publisher_win.cc +++ b/chrome/browser/history/history_publisher_win.cc @@ -101,12 +101,12 @@ void HistoryPublisher::PublishDataToIndexers(const PageData& page_data) // Send data to registered indexers. base::win::ScopedVariant time(var_time, VT_DATE); - base::win::ScopedBstr url(base::ASCIIToWide(page_data.url.spec()).c_str()); + base::win::ScopedBstr url(ASCIIToWide(page_data.url.spec()).c_str()); base::win::ScopedBstr html(page_data.html); base::win::ScopedBstr title(page_data.title); - // Don't send a NULL string through base::ASCIIToWide. + // Don't send a NULL string through ASCIIToWide. base::win::ScopedBstr format(page_data.thumbnail_format ? - base::ASCIIToWide(page_data.thumbnail_format).c_str() : + ASCIIToWide(page_data.thumbnail_format).c_str() : NULL); base::win::ScopedVariant psa(thumbnail_arr.m_psa); for (size_t i = 0; i < indexers_.size(); ++i) { diff --git a/chrome/browser/history/in_memory_database.cc b/chrome/browser/history/in_memory_database.cc index f807e6f..02b335f 100644 --- a/chrome/browser/history/in_memory_database.cc +++ b/chrome/browser/history/in_memory_database.cc @@ -72,7 +72,7 @@ bool InMemoryDatabase::InitFromDisk(const base::FilePath& history_name) { #if defined(OS_POSIX) attach.BindString(0, history_name.value()); #else - attach.BindString(0, base::WideToUTF8(history_name.value())); + attach.BindString(0, WideToUTF8(history_name.value())); #endif if (!attach.Run()) return false; diff --git a/chrome/browser/history/query_parser_unittest.cc b/chrome/browser/history/query_parser_unittest.cc index 860cab8..0b34e74 100644 --- a/chrome/browser/history/query_parser_unittest.cc +++ b/chrome/browser/history/query_parser_unittest.cc @@ -39,12 +39,12 @@ TEST_F(QueryParserTest, SimpleQueries) { // the minimum is 2 while for other scripts, it's 3. EXPECT_EQ("f b", QueryToString(" f b")); // KA JANG - EXPECT_EQ(base::WideToUTF8(L"\xAC00 \xC7A5"), - QueryToString(base::WideToUTF8(L" \xAC00 \xC7A5"))); + EXPECT_EQ(WideToUTF8(L"\xAC00 \xC7A5"), + QueryToString(WideToUTF8(L" \xAC00 \xC7A5"))); EXPECT_EQ("foo* bar*", QueryToString(" foo bar ")); // KA-JANG BICH-GO - EXPECT_EQ(base::WideToUTF8(L"\xAC00\xC7A5* \xBE5B\xACE0*"), - QueryToString(base::WideToUTF8(L"\xAC00\xC7A5 \xBE5B\xACE0"))); + EXPECT_EQ(WideToUTF8(L"\xAC00\xC7A5* \xBE5B\xACE0*"), + QueryToString(WideToUTF8(L"\xAC00\xC7A5 \xBE5B\xACE0"))); } // Quoted substring parsing. diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc index f258d96..73513e3 100644 --- a/chrome/browser/history/thumbnail_database.cc +++ b/chrome/browser/history/thumbnail_database.cc @@ -990,7 +990,7 @@ bool ThumbnailDatabase::RenameAndDropThumbnails( #if defined(OS_POSIX) attach.BindString(0, new_db_file.value()); #else - attach.BindString(0, base::WideToUTF8(new_db_file.value())); + attach.BindString(0, WideToUTF8(new_db_file.value())); #endif if (!attach.Run()) { diff --git a/chrome/browser/importer/firefox3_importer.cc b/chrome/browser/importer/firefox3_importer.cc index e47faaa..2cab2ca 100644 --- a/chrome/browser/importer/firefox3_importer.cc +++ b/chrome/browser/importer/firefox3_importer.cc @@ -395,7 +395,7 @@ void Firefox3Importer::GetSearchEnginesXMLFiles( } else { // Looks like absolute path to the file. #if defined(OS_WIN) - file = base::FilePath(base::UTF8ToWide(engine)); + file = base::FilePath(UTF8ToWide(engine)); #else file = base::FilePath(engine); #endif diff --git a/chrome/browser/importer/firefox_importer_unittest.cc b/chrome/browser/importer/firefox_importer_unittest.cc index 09d86da..eabc47b 100644 --- a/chrome/browser/importer/firefox_importer_unittest.cc +++ b/chrome/browser/importer/firefox_importer_unittest.cc @@ -155,10 +155,10 @@ class FirefoxObserver : public ProfileWriter, EXPECT_EQ(p.origin, form.origin.spec()); EXPECT_EQ(p.realm, form.signon_realm); EXPECT_EQ(p.action, form.action.spec()); - EXPECT_EQ(base::WideToUTF16(p.username_element), form.username_element); - EXPECT_EQ(base::WideToUTF16(p.username), form.username_value); - EXPECT_EQ(base::WideToUTF16(p.password_element), form.password_element); - EXPECT_EQ(base::WideToUTF16(p.password), form.password_value); + EXPECT_EQ(WideToUTF16(p.username_element), form.username_element); + EXPECT_EQ(WideToUTF16(p.username), form.username_value); + EXPECT_EQ(WideToUTF16(p.password_element), form.password_element); + EXPECT_EQ(WideToUTF16(p.password), form.password_value); EXPECT_EQ(p.blacklisted, form.blacklisted_by_user); ++password_count_; } @@ -190,7 +190,7 @@ class FirefoxObserver : public ProfileWriter, string16 keyword = template_urls[i]->keyword(); for (size_t j = 0; j < arraysize(kFirefox2Keywords); ++j) { if (template_urls[i]->keyword() == - base::WideToUTF16Hack(kFirefox2Keywords[j].keyword)) { + WideToUTF16Hack(kFirefox2Keywords[j].keyword)) { EXPECT_EQ(kFirefox2Keywords[j].url, template_urls[i]->url()); found = true; break; @@ -301,10 +301,10 @@ class Firefox3Observer : public ProfileWriter, EXPECT_EQ(p.origin, form.origin.spec()); EXPECT_EQ(p.realm, form.signon_realm); EXPECT_EQ(p.action, form.action.spec()); - EXPECT_EQ(base::WideToUTF16(p.username_element), form.username_element); - EXPECT_EQ(base::WideToUTF16(p.username), form.username_value); - EXPECT_EQ(base::WideToUTF16(p.password_element), form.password_element); - EXPECT_EQ(base::WideToUTF16(p.password), form.password_value); + EXPECT_EQ(WideToUTF16(p.username_element), form.username_element); + EXPECT_EQ(WideToUTF16(p.username), form.username_value); + EXPECT_EQ(WideToUTF16(p.password_element), form.password_element); + EXPECT_EQ(WideToUTF16(p.password), form.password_value); EXPECT_EQ(p.blacklisted, form.blacklisted_by_user); ++password_count_; } @@ -341,7 +341,7 @@ class Firefox3Observer : public ProfileWriter, string16 keyword = template_urls[i]->keyword(); for (size_t j = 0; j < arraysize(kFirefox3Keywords); ++j) { if (template_urls[i]->keyword() == - base::WideToUTF16Hack(kFirefox3Keywords[j].keyword)) { + WideToUTF16Hack(kFirefox3Keywords[j].keyword)) { EXPECT_EQ(kFirefox3Keywords[j].url, template_urls[i]->url()); found = true; break; @@ -507,7 +507,7 @@ TEST(FirefoxImporterTest, Firefox2NSS3Decryptor) { decryptor_proxy.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECBJ" "M63MpT9rtBAjMCm7qo/EhlA==")); // Test UTF-16 encoding. - EXPECT_EQ(base::WideToUTF16(L"\x4E2D"), + EXPECT_EQ(WideToUTF16(L"\x4E2D"), decryptor_proxy.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECN9" "OQ5ZFmhb8BAiFo1Z+fUvaIQ==")); } @@ -532,7 +532,7 @@ TEST(FirefoxImporterTest, Firefox3NSS3Decryptor) { decryptor_proxy.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECKa" "jtRg4qFSHBAhv9luFkXgDJA==")); // Test UTF-16 encoding. - EXPECT_EQ(base::WideToUTF16(L"\x4E2D"), + EXPECT_EQ(WideToUTF16(L"\x4E2D"), decryptor_proxy.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECLW" "qqiccfQHWBAie74hxnULxlw==")); } @@ -581,9 +581,9 @@ TEST(FirefoxImporterTest, Firefox2BookmarkParse) { "SHORTCUTURL=\"\xE4\xB8\xAD\">\xE4\xB8\xAD\xE6\x96\x87</A>", charset, &title, &url, &favicon, &shortcut, &add_date, &post_data); EXPECT_TRUE(result); - EXPECT_EQ(L"\x4E2D\x6587", base::UTF16ToWide(title)); + EXPECT_EQ(L"\x4E2D\x6587", UTF16ToWide(title)); EXPECT_EQ("http://chinese.site.cn/path?query=1#ref", url.spec()); - EXPECT_EQ(L"\x4E2D", base::UTF16ToWide(shortcut)); + EXPECT_EQ(L"\x4E2D", UTF16ToWide(shortcut)); EXPECT_EQ(string16(), post_data); EXPECT_TRUE(base::Time() == add_date); diff --git a/chrome/browser/importer/firefox_importer_utils.cc b/chrome/browser/importer/firefox_importer_utils.cc index b263682..2bbcb39 100644 --- a/chrome/browser/importer/firefox_importer_utils.cc +++ b/chrome/browser/importer/firefox_importer_utils.cc @@ -71,7 +71,7 @@ base::FilePath GetFirefoxProfilePath() { &path16, 0, ASCIIToUTF16("/"), ASCIIToUTF16("\\")); #endif base::FilePath path = - base::FilePath::FromWStringHack(base::UTF16ToWide(path16)); + base::FilePath::FromWStringHack(UTF16ToWide(path16)); // IsRelative=1 means the folder path would be relative to the // path of profiles.ini. IsRelative=0 refers to a custom profile @@ -123,7 +123,7 @@ bool GetFirefoxVersionAndPathFromProfile(const base::FilePath& profile_path, // file, we could go straight from bytes -> filepath; // otherwise, we're out of luck here. *app_path = base::FilePath::FromWStringHack( - base::UTF8ToWide(line.substr(equal + 1))); + UTF8ToWide(line.substr(equal + 1))); } } } diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc index 1f6976f..7a87ea9 100644 --- a/chrome/browser/importer/ie_importer.cc +++ b/chrome/browser/importer/ie_importer.cc @@ -296,7 +296,7 @@ GURL ReadURLFromInternetShortcut(IUniformResourceLocator* url_locator) { base::win::ScopedCoMem<wchar_t> url; // GetURL can return S_FALSE (FAILED(S_FALSE) is false) when url == NULL. return (FAILED(url_locator->GetURL(&url)) || !url) ? - GURL() : GURL(base::WideToUTF16(std::wstring(url))); + GURL() : GURL(WideToUTF16(std::wstring(url))); } // Reads the URL of the favicon of the internet shortcut. @@ -321,7 +321,7 @@ GURL ReadFaviconURLFromInternetShortcut(IUniformResourceLocator* url_locator) { if (FAILED(property_storage->ReadMultiple(1, properties, output.Receive())) || output.get().vt != VT_LPWSTR) return GURL(); - return GURL(base::WideToUTF16(output.get().pwszVal)); + return GURL(WideToUTF16(output.get().pwszVal)); } // Reads the favicon imaga data in an NTFS alternate data stream. This is where @@ -335,7 +335,7 @@ bool ReadFaviconDataFromInternetShortcut(const string16& file, // Reads the favicon imaga data in the Internet cache. IE6 doesn't hold the data // explicitly, but it might be found in the cache. bool ReadFaviconDataFromCache(const GURL& favicon_url, std::string* data) { - std::wstring url_wstring(base::UTF8ToWide(favicon_url.spec())); + std::wstring url_wstring(UTF8ToWide(favicon_url.spec())); DWORD info_size = 0; GetUrlCacheEntryInfoEx(url_wstring.c_str(), NULL, &info_size, NULL, NULL, NULL, 0); @@ -711,7 +711,7 @@ void IEImporter::ImportSearchEngines() { } } - std::string url(base::WideToUTF8(wide_url)); + std::string url(WideToUTF8(wide_url)); SearchEnginesMap::iterator t_iter = search_engines_map.find(url); if (t_iter == search_engines_map.end()) { // First time we see that URL. diff --git a/chrome/browser/importer/importer_unittest_utils.cc b/chrome/browser/importer/importer_unittest_utils.cc index b44cecf..ff6d796 100644 --- a/chrome/browser/importer/importer_unittest_utils.cc +++ b/chrome/browser/importer/importer_unittest_utils.cc @@ -12,10 +12,10 @@ bool EqualBookmarkEntry(const ProfileWriter::BookmarkEntry& entry, if (expected.in_toolbar != entry.in_toolbar || expected.path_size != entry.path.size() || expected.url != entry.url.spec() || - base::WideToUTF16Hack(expected.title) != entry.title) + WideToUTF16Hack(expected.title) != entry.title) return false; for (size_t i = 0; i < expected.path_size; ++i) { - if (base::WideToUTF16Hack(expected.path[i]) != entry.path[i]) + if (WideToUTF16Hack(expected.path[i]) != entry.path[i]) return false; } return true; diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc index 974e05d..d5cb8c8 100644 --- a/chrome/browser/instant/instant_browsertest.cc +++ b/chrome/browser/instant/instant_browsertest.cc @@ -812,23 +812,23 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionsAreCaseInsensitive) { omnibox()->RevertAll(); SetOmniboxTextAndWaitForInstantToShow("i"); - EXPECT_EQ(base::WideToUTF16(L"i\u0307nstant"), omnibox()->GetText()); + EXPECT_EQ(WideToUTF16(L"i\u0307nstant"), omnibox()->GetText()); omnibox()->RevertAll(); SetOmniboxTextAndWaitForInstantToShow("I"); - EXPECT_EQ(base::WideToUTF16(L"I\u0307nstant"), omnibox()->GetText()); + EXPECT_EQ(WideToUTF16(L"I\u0307nstant"), omnibox()->GetText()); omnibox()->RevertAll(); - SetOmniboxTextAndWaitForInstantToShow(base::WideToUTF8(L"i\u0307")); - EXPECT_EQ(base::WideToUTF16(L"i\u0307nstant"), omnibox()->GetText()); + SetOmniboxTextAndWaitForInstantToShow(WideToUTF8(L"i\u0307")); + EXPECT_EQ(WideToUTF16(L"i\u0307nstant"), omnibox()->GetText()); omnibox()->RevertAll(); - SetOmniboxTextAndWaitForInstantToShow(base::WideToUTF8(L"I\u0307")); - EXPECT_EQ(base::WideToUTF16(L"I\u0307nstant"), omnibox()->GetText()); + SetOmniboxTextAndWaitForInstantToShow(WideToUTF8(L"I\u0307")); + EXPECT_EQ(WideToUTF16(L"I\u0307nstant"), omnibox()->GetText()); omnibox()->RevertAll(); - SetOmniboxTextAndWaitForInstantToShow(base::WideToUTF8(L"\u0130")); - EXPECT_EQ(base::WideToUTF16(L"\u0130NSTANT"), omnibox()->GetText()); + SetOmniboxTextAndWaitForInstantToShow(WideToUTF8(L"\u0130")); + EXPECT_EQ(WideToUTF16(L"\u0130NSTANT"), omnibox()->GetText()); omnibox()->RevertAll(); SetOmniboxTextAndWaitForInstantToShow("in"); @@ -845,8 +845,8 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionsAreCaseInsensitive) { EXPECT_TRUE(ExecuteScript("suggestion = [ { value: '\\u1e0d\\u0307oh' } ]")); omnibox()->RevertAll(); - SetOmniboxTextAndWaitForInstantToShow(base::WideToUTF8(L"\u1e0b\u0323")); - EXPECT_EQ(base::WideToUTF16(L"\u1e0b\u0323oh"), omnibox()->GetText()); + SetOmniboxTextAndWaitForInstantToShow(WideToUTF8(L"\u1e0b\u0323")); + EXPECT_EQ(WideToUTF16(L"\u1e0b\u0323oh"), omnibox()->GetText()); } // Flakes on Windows and Mac: http://crbug.com/170677 diff --git a/chrome/browser/jumplist_win.cc b/chrome/browser/jumplist_win.cc index 9c611e4..a13706f 100644 --- a/chrome/browser/jumplist_win.cc +++ b/chrome/browser/jumplist_win.cc @@ -274,8 +274,7 @@ HRESULT UpdateCategory(base::win::ScopedComPtr<ICustomDestinationList> list, if (data.empty() || !max_slots) return S_OK; - std::wstring category = - base::UTF16ToWide(l10n_util::GetStringUTF16(category_id)); + std::wstring category = UTF16ToWide(l10n_util::GetStringUTF16(category_id)); // Create an EnumerableObjectCollection object. // We once add the given items to this collection object and add this @@ -331,7 +330,7 @@ HRESULT UpdateTaskCategory(base::win::ScopedComPtr<ICustomDestinationList> list, // system menu. scoped_refptr<ShellLinkItem> chrome(new ShellLinkItem); std::wstring chrome_title = - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_NEW_WINDOW)); + UTF16ToWide(l10n_util::GetStringUTF16(IDS_NEW_WINDOW)); ReplaceSubstringsAfterOffset(&chrome_title, 0, L"&", L""); chrome->SetTitle(chrome_title); chrome->SetIcon(chrome_path, 0, false); @@ -342,9 +341,9 @@ HRESULT UpdateTaskCategory(base::win::ScopedComPtr<ICustomDestinationList> list, // this item. scoped_refptr<ShellLinkItem> incognito(new ShellLinkItem); incognito->SetArguments( - base::ASCIIToWide(std::string("--") + switches::kIncognito)); + ASCIIToWide(std::string("--") + switches::kIncognito)); std::wstring incognito_title = - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_NEW_INCOGNITO_WINDOW)); + UTF16ToWide(l10n_util::GetStringUTF16(IDS_NEW_INCOGNITO_WINDOW)); ReplaceSubstringsAfterOffset(&incognito_title, 0, L"&", L""); incognito->SetTitle(incognito_title); incognito->SetIcon(chrome_path, 0, false); @@ -573,7 +572,7 @@ void JumpList::OnMostVisitedURLsAvailable( const history::MostVisitedURL& url = data[i]; scoped_refptr<ShellLinkItem> link(new ShellLinkItem); std::string url_string = url.url.spec(); - link->SetArguments(base::UTF8ToWide(url_string)); + link->SetArguments(UTF8ToWide(url_string)); link->SetTitle(!url.title.empty()? url.title : link->arguments()); most_visited_pages_.push_back(link); icon_urls_.push_back(make_pair(url_string, link)); @@ -642,7 +641,7 @@ bool JumpList::AddTab(const TabRestoreService::Tab* tab, const TabNavigation& current_navigation = tab->navigations.at(tab->current_navigation_index); std::string url = current_navigation.virtual_url().spec(); - link->SetArguments(base::UTF8ToWide(url)); + link->SetArguments(UTF8ToWide(url)); link->SetTitle(current_navigation.title()); list->push_back(link); icon_urls_.push_back(make_pair(url, link)); diff --git a/chrome/browser/media_gallery/media_galleries_preferences_unittest.cc b/chrome/browser/media_gallery/media_galleries_preferences_unittest.cc index a5fb1f3..63e67cd 100644 --- a/chrome/browser/media_gallery/media_galleries_preferences_unittest.cc +++ b/chrome/browser/media_gallery/media_galleries_preferences_unittest.cc @@ -240,8 +240,7 @@ class MediaGalleriesPreferencesTest : public testing::Test { base::FilePath MakePath(std::string dir) { #if defined(OS_WIN) - return base::FilePath(FILE_PATH_LITERAL("C:\\")).Append( - base::UTF8ToWide(dir)); + return base::FilePath(FILE_PATH_LITERAL("C:\\")).Append(UTF8ToWide(dir)); #elif defined(OS_POSIX) return base::FilePath(FILE_PATH_LITERAL("/")).Append(dir); #else diff --git a/chrome/browser/memory_details_win.cc b/chrome/browser/memory_details_win.cc index 94c38d1..5069fe6 100644 --- a/chrome/browser/memory_details_win.cc +++ b/chrome/browser/memory_details_win.cc @@ -38,7 +38,7 @@ enum { MemoryDetails::MemoryDetails() : user_metrics_mode_(UPDATE_USER_METRICS) { static const std::wstring google_browser_name = - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); + UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); struct { const wchar_t* name; const wchar_t* process_name; @@ -122,7 +122,7 @@ void MemoryDetails::CollectProcessData( if (index2 == CHROME_BROWSER || index2 == CHROME_NACL_PROCESS) { chrome::VersionInfo version_info; if (version_info.is_valid()) - info.version = base::ASCIIToWide(version_info.Version()); + info.version = ASCIIToWide(version_info.Version()); // Check if this is one of the child processes whose data we collected // on the IO thread, and if so copy over that data. for (size_t child = 0; child < child_info.size(); child++) { diff --git a/chrome/browser/net/url_fixer_upper.cc b/chrome/browser/net/url_fixer_upper.cc index 79aa98b..f590702 100644 --- a/chrome/browser/net/url_fixer_upper.cc +++ b/chrome/browser/net/url_fixer_upper.cc @@ -156,7 +156,7 @@ static std::string FixupPath(const std::string& text) { base::FilePath::StringType filename; #if defined(OS_WIN) - base::FilePath input_path(base::UTF8ToWide(text)); + base::FilePath input_path(UTF8ToWide(text)); PrepareStringForFileOps(input_path, &filename); // Fixup Windows-style drive letters, where "C:" gets rewritten to "C|". @@ -563,8 +563,8 @@ GURL URLFixerUpper::FixupRelativeFile(const base::FilePath& base_dir, // escaped things. We need to go through 8-bit since the escaped values // only represent 8-bit values. #if defined(OS_WIN) - std::wstring unescaped = base::UTF8ToWide(net::UnescapeURLComponent( - base::WideToUTF8(trimmed), + std::wstring unescaped = UTF8ToWide(net::UnescapeURLComponent( + WideToUTF8(trimmed), net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS)); #elif defined(OS_POSIX) std::string unescaped = net::UnescapeURLComponent( @@ -591,7 +591,7 @@ GURL URLFixerUpper::FixupRelativeFile(const base::FilePath& base_dir, // Fall back on regular fixup for this input. #if defined(OS_WIN) - std::string text_utf8 = base::WideToUTF8(text.value()); + std::string text_utf8 = WideToUTF8(text.value()); #elif defined(OS_POSIX) std::string text_utf8 = text.value(); #endif diff --git a/chrome/browser/net/url_fixer_upper_unittest.cc b/chrome/browser/net/url_fixer_upper_unittest.cc index b2a13c5..8c6cfc8 100644 --- a/chrome/browser/net/url_fixer_upper_unittest.cc +++ b/chrome/browser/net/url_fixer_upper_unittest.cc @@ -366,7 +366,7 @@ TEST(URLFixerUpperTest, FixupFile) { // c:\foo\bar.txt -> file:///c:/foo/bar.txt (basic) #if defined(OS_WIN) - GURL fixedup(URLFixerUpper::FixupURL(base::WideToUTF8(original.value()), + GURL fixedup(URLFixerUpper::FixupURL(WideToUTF8(original.value()), std::string())); #elif defined(OS_POSIX) GURL fixedup(URLFixerUpper::FixupURL(original.value(), std::string())); @@ -376,7 +376,7 @@ TEST(URLFixerUpperTest, FixupFile) { // TODO(port): Make some equivalent tests for posix. #if defined(OS_WIN) // c|/foo\bar.txt -> file:///c:/foo/bar.txt (pipe allowed instead of colon) - std::string cur(base::WideToUTF8(original.value())); + std::string cur(WideToUTF8(original.value())); EXPECT_EQ(':', cur[1]); cur[1] = '|'; EXPECT_EQ(golden, URLFixerUpper::FixupURL(cur, std::string())); @@ -461,7 +461,7 @@ TEST(URLFixerUpperTest, FixupRelativeFile) { for (size_t i = 0; i < arraysize(fixup_cases); ++i) { fixup_case value = fixup_cases[i]; #if defined(OS_WIN) - base::FilePath input(base::UTF8ToWide(value.input)); + base::FilePath input(UTF8ToWide(value.input)); #elif defined(OS_POSIX) base::FilePath input(value.input); #endif diff --git a/chrome/browser/parsers/metadata_parser_filebase.cc b/chrome/browser/parsers/metadata_parser_filebase.cc index 537fbf1..56207e1 100644 --- a/chrome/browser/parsers/metadata_parser_filebase.cc +++ b/chrome/browser/parsers/metadata_parser_filebase.cc @@ -22,7 +22,7 @@ bool FileMetadataParser::Parse() { properties_[MetadataParser::kPropertyFilesize] = base::Int64ToString(size); } #if defined(OS_WIN) - value = base::WideToUTF8(path_.BaseName().value()); + value = WideToUTF8(path_.BaseName().value()); properties_[MetadataParser::kPropertyTitle] = value; #elif defined(OS_POSIX) properties_[MetadataParser::kPropertyTitle] = path_.BaseName().value(); diff --git a/chrome/browser/parsers/metadata_parser_filebase_unittest.cc b/chrome/browser/parsers/metadata_parser_filebase_unittest.cc index 9097079..170dd06 100644 --- a/chrome/browser/parsers/metadata_parser_filebase_unittest.cc +++ b/chrome/browser/parsers/metadata_parser_filebase_unittest.cc @@ -8,7 +8,7 @@ #include "base/file_util.h" #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" -#include "base/string_util.h" // TODO(brettw) remove when base::WideToASCII moves. +#include "base/string_util.h" // TODO(brettw) remove when WideToASCII moves. #include "base/strings/string_number_conversions.h" #include "chrome/browser/parsers/metadata_parser_filebase.h" #include "testing/gtest/include/gtest/gtest.h" @@ -34,7 +34,7 @@ class FileMetaDataParserTest : public testing::Test { #if defined(OS_POSIX) return test_file_.BaseName().value(); #elif defined(OS_WIN) - return base::WideToASCII(test_file_.BaseName().value()); + return WideToASCII(test_file_.BaseName().value()); #endif // defined(OS_POSIX) } diff --git a/chrome/browser/parsers/metadata_parser_jpeg_factory.cc b/chrome/browser/parsers/metadata_parser_jpeg_factory.cc index a146865..366ded3 100644 --- a/chrome/browser/parsers/metadata_parser_jpeg_factory.cc +++ b/chrome/browser/parsers/metadata_parser_jpeg_factory.cc @@ -16,7 +16,7 @@ bool MetadataParserJpegFactory::CanParse(const base::FilePath& path, char* bytes, int bytes_size) { #if defined(OS_WIN) - base::FilePath::StringType ext = base::UTF8ToWide(std::string(".jpg")); + base::FilePath::StringType ext = UTF8ToWide(std::string(".jpg")); #elif defined(OS_POSIX) base::FilePath::StringType ext = ".jpg"; #endif diff --git a/chrome/browser/password_manager/password_form_data.cc b/chrome/browser/password_manager/password_form_data.cc index 17aa7a4..c2c9a01 100644 --- a/chrome/browser/password_manager/password_form_data.cc +++ b/chrome/browser/password_manager/password_form_data.cc @@ -22,15 +22,15 @@ PasswordForm* CreatePasswordFormFromData( if (form_data.action) form->action = GURL(form_data.action); if (form_data.submit_element) - form->submit_element = base::WideToUTF16(form_data.submit_element); + form->submit_element = WideToUTF16(form_data.submit_element); if (form_data.username_element) - form->username_element = base::WideToUTF16(form_data.username_element); + form->username_element = WideToUTF16(form_data.username_element); if (form_data.password_element) - form->password_element = base::WideToUTF16(form_data.password_element); + form->password_element = WideToUTF16(form_data.password_element); if (form_data.username_value) { - form->username_value = base::WideToUTF16(form_data.username_value); + form->username_value = WideToUTF16(form_data.username_value); if (form_data.password_value) - form->password_value = base::WideToUTF16(form_data.password_value); + form->password_value = WideToUTF16(form_data.password_value); } else { form->blacklisted_by_user = true; } diff --git a/chrome/browser/password_manager/password_store_default_unittest.cc b/chrome/browser/password_manager/password_store_default_unittest.cc index dec44a3..92d0e98 100644 --- a/chrome/browser/password_manager/password_store_default_unittest.cc +++ b/chrome/browser/password_manager/password_store_default_unittest.cc @@ -232,7 +232,7 @@ TEST_F(PasswordStoreDefaultTest, Notifications) { done.Wait(); // Change the password. - form->password_value = base::WideToUTF16(L"a different password"); + form->password_value = WideToUTF16(L"a different password"); const PasswordStoreChange expected_update_changes[] = { PasswordStoreChange(PasswordStoreChange::UPDATE, *form), diff --git a/chrome/browser/password_manager/password_store_mac_unittest.cc b/chrome/browser/password_manager/password_store_mac_unittest.cc index 8031186..d32d63b 100644 --- a/chrome/browser/password_manager/password_store_mac_unittest.cc +++ b/chrome/browser/password_manager/password_store_mac_unittest.cc @@ -159,15 +159,15 @@ static PasswordForm* CreatePasswordFormFromData( if (form_data.action) form->action = GURL(form_data.action); if (form_data.submit_element) - form->submit_element = base::WideToUTF16(form_data.submit_element); + form->submit_element = WideToUTF16(form_data.submit_element); if (form_data.username_element) - form->username_element = base::WideToUTF16(form_data.username_element); + form->username_element = WideToUTF16(form_data.username_element); if (form_data.password_element) - form->password_element = base::WideToUTF16(form_data.password_element); + form->password_element = WideToUTF16(form_data.password_element); if (form_data.username_value) { - form->username_value = base::WideToUTF16(form_data.username_value); + form->username_value = WideToUTF16(form_data.username_value); if (form_data.password_value) - form->password_value = base::WideToUTF16(form_data.password_value); + form->password_value = WideToUTF16(form_data.password_value); } else { form->blacklisted_by_user = true; } @@ -204,16 +204,16 @@ static void CheckFormsAgainstExpectations( << test_label; EXPECT_EQ(GURL(expectation->origin), form->origin) << test_label; EXPECT_EQ(GURL(expectation->action), form->action) << test_label; - EXPECT_EQ(base::WideToUTF16(expectation->submit_element), - form->submit_element) << test_label; - EXPECT_EQ(base::WideToUTF16(expectation->username_element), + EXPECT_EQ(WideToUTF16(expectation->submit_element), form->submit_element) + << test_label; + EXPECT_EQ(WideToUTF16(expectation->username_element), form->username_element) << test_label; - EXPECT_EQ(base::WideToUTF16(expectation->password_element), + EXPECT_EQ(WideToUTF16(expectation->password_element), form->password_element) << test_label; if (expectation->username_value) { - EXPECT_EQ(base::WideToUTF16(expectation->username_value), + EXPECT_EQ(WideToUTF16(expectation->username_value), form->username_value) << test_label; - EXPECT_EQ(base::WideToUTF16(expectation->password_value), + EXPECT_EQ(WideToUTF16(expectation->password_value), form->password_value) << test_label; } else { EXPECT_TRUE(form->blacklisted_by_user) << test_label; @@ -291,9 +291,9 @@ TEST_F(PasswordStoreMacInternalsTest, TestKeychainToFormTranslation) { EXPECT_EQ(std::string(expected[i].signon_realm), form.signon_realm) << "In iteration " << i; if (expected[i].username) { - EXPECT_EQ(base::WideToUTF16(expected[i].username), form.username_value) + EXPECT_EQ(WideToUTF16(expected[i].username), form.username_value) << "In iteration " << i; - EXPECT_EQ(base::WideToUTF16(expected[i].password), form.password_value) + EXPECT_EQ(WideToUTF16(expected[i].password), form.password_value) << "In iteration " << i; EXPECT_FALSE(form.blacklisted_by_user) << "In iteration " << i; } else { diff --git a/chrome/browser/password_manager/password_store_win.cc b/chrome/browser/password_manager/password_store_win.cc index 3022154..3736e75 100644 --- a/chrome/browser/password_manager/password_store_win.cc +++ b/chrome/browser/password_manager/password_store_win.cc @@ -88,8 +88,7 @@ void PasswordStoreWin::DBHandler::GetIE7Login( const PasswordStoreWin::ConsumerCallbackRunner& callback_runner) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); IE7PasswordInfo info; - info.url_hash = - ie7_password::GetUrlHash(base::UTF8ToWide(form.origin.spec())); + info.url_hash = ie7_password::GetUrlHash(UTF8ToWide(form.origin.spec())); WebDataService::Handle handle = web_data_service_->GetIE7Login(info, this); pending_requests_[handle] = RequestInfo(new PasswordForm(form), callback_runner); @@ -111,7 +110,7 @@ PasswordForm* PasswordStoreWin::DBHandler::GetIE7Result( web_data_service_->RemoveIE7Login(info); std::wstring username; std::wstring password; - std::wstring url = base::ASCIIToWide(form.origin.spec()); + std::wstring url = ASCIIToWide(form.origin.spec()); if (!ie7_password::DecryptPassword(url, info.encrypted_data, &username, &password)) { return NULL; diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc index 13ed9fb..8ba62cc 100644 --- a/chrome/browser/password_manager/password_store_x_unittest.cc +++ b/chrome/browser/password_manager/password_store_x_unittest.cc @@ -365,7 +365,7 @@ TEST_P(PasswordStoreXTest, Notifications) { done.Wait(); // Change the password. - form->password_value = base::WideToUTF16(L"a different password"); + form->password_value = WideToUTF16(L"a different password"); const PasswordStoreChange expected_update_changes[] = { PasswordStoreChange(PasswordStoreChange::UPDATE, *form), diff --git a/chrome/browser/performance_monitor/database.cc b/chrome/browser/performance_monitor/database.cc index 40fc57d..de813f3 100644 --- a/chrome/browser/performance_monitor/database.cc +++ b/chrome/browser/performance_monitor/database.cc @@ -458,28 +458,24 @@ void Database::InitDBs() { event_db_ = scoped_ptr<leveldb::DB>(new_db); #elif defined(OS_WIN) leveldb::DB::Open(open_options, - base::WideToUTF8(path_.AppendASCII(kRecentDb).value()), - &new_db); + WideToUTF8(path_.AppendASCII(kRecentDb).value()), &new_db); recent_db_ = scoped_ptr<leveldb::DB>(new_db); leveldb::DB::Open(open_options, - base::WideToUTF8(path_.AppendASCII(kMaxValueDb).value()), + WideToUTF8(path_.AppendASCII(kMaxValueDb).value()), &new_db); max_value_db_ = scoped_ptr<leveldb::DB>(new_db); leveldb::DB::Open(open_options, - base::WideToUTF8(path_.AppendASCII(kStateDb).value()), - &new_db); + WideToUTF8(path_.AppendASCII(kStateDb).value()), &new_db); state_db_ = scoped_ptr<leveldb::DB>(new_db); leveldb::DB::Open(open_options, - base::WideToUTF8(path_.AppendASCII(kActiveIntervalDb).value()), - &new_db); + WideToUTF8(path_.AppendASCII(kActiveIntervalDb).value()), + &new_db); active_interval_db_ = scoped_ptr<leveldb::DB>(new_db); leveldb::DB::Open(open_options, - base::WideToUTF8(path_.AppendASCII(kMetricDb).value()), - &new_db); + WideToUTF8(path_.AppendASCII(kMetricDb).value()), &new_db); metric_db_ = scoped_ptr<leveldb::DB>(new_db); leveldb::DB::Open(open_options, - base::WideToUTF8(path_.AppendASCII(kEventDb).value()), - &new_db); + WideToUTF8(path_.AppendASCII(kEventDb).value()), &new_db); event_db_ = scoped_ptr<leveldb::DB>(new_db); #endif } diff --git a/chrome/browser/platform_util_win.cc b/chrome/browser/platform_util_win.cc index f344371..4290009 100644 --- a/chrome/browser/platform_util_win.cc +++ b/chrome/browser/platform_util_win.cc @@ -118,7 +118,7 @@ void ShowItemInFolderOnFileThread(const base::FilePath& full_path) { // is empty. This function tells if it is. bool ValidateShellCommandForScheme(const std::string& scheme) { base::win::RegKey key; - std::wstring registry_path = base::ASCIIToWide(scheme) + + std::wstring registry_path = ASCIIToWide(scheme) + L"\\shell\\open\\command"; key.Open(HKEY_CLASSES_ROOT, registry_path.c_str(), KEY_READ); if (!key.Valid()) diff --git a/chrome/browser/plugins/plugin_finder.cc b/chrome/browser/plugins/plugin_finder.cc index 65370a4..a8097cf 100644 --- a/chrome/browser/plugins/plugin_finder.cc +++ b/chrome/browser/plugins/plugin_finder.cc @@ -54,7 +54,7 @@ static string16 GetGroupName(const webkit::WebPluginInfo& plugin) { #if defined(OS_POSIX) return UTF8ToUTF16(path); #elif defined(OS_WIN) - return base::WideToUTF16(path); + return WideToUTF16(path); #endif } diff --git a/chrome/browser/policy/browser_policy_connector.cc b/chrome/browser/policy/browser_policy_connector.cc index 06d3f2e..bcf6d26 100644 --- a/chrome/browser/policy/browser_policy_connector.cc +++ b/chrome/browser/policy/browser_policy_connector.cc @@ -403,7 +403,7 @@ bool BrowserPolicyConnector::IsNonEnterpriseUser(const std::string& username) { const string16 domain = UTF8ToUTF16(gaia::ExtractDomainName(gaia::CanonicalizeEmail(username))); for (size_t i = 0; i < arraysize(kNonManagedDomainPatterns); i++) { - string16 pattern = base::WideToUTF16(kNonManagedDomainPatterns[i]); + string16 pattern = WideToUTF16(kNonManagedDomainPatterns[i]); if (MatchDomain(domain, pattern)) return true; } diff --git a/chrome/browser/policy/policy_loader_win_unittest.cc b/chrome/browser/policy/policy_loader_win_unittest.cc index 5270750..7e82463 100644 --- a/chrome/browser/policy/policy_loader_win_unittest.cc +++ b/chrome/browser/policy/policy_loader_win_unittest.cc @@ -262,7 +262,7 @@ ScopedGroupPolicyRegistrySandbox::ScopedGroupPolicyRegistrySandbox() { // Generate a unique registry key for the override for each test. This // makes sure that tests executing in parallel won't delete each other's // key, at DeleteKeys(). - key_name_ = base::ASCIIToWide(base::StringPrintf( + key_name_ = ASCIIToWide(base::StringPrintf( "SOFTWARE\\chromium unittest %d", base::Process::Current().pid())); std::wstring hklm_key_name = key_name_ + L"\\HKLM"; diff --git a/chrome/browser/policy/policy_path_parser_win.cc b/chrome/browser/policy/policy_path_parser_win.cc index df97ef5..26d0e52 100644 --- a/chrome/browser/policy/policy_path_parser_win.cc +++ b/chrome/browser/policy/policy_path_parser_win.cc @@ -154,7 +154,7 @@ void CheckUserDataDirPolicy(base::FilePath* user_data_dir) { // we don't have to try to load HKCU. const char* key_name_ascii = (is_chrome_frame ? policy::key::kGCFUserDataDir : policy::key::kUserDataDir); - std::wstring key_name(base::ASCIIToWide(key_name_ascii)); + std::wstring key_name(ASCIIToWide(key_name_ascii)); if (LoadUserDataDirPolicyFromRegistry(HKEY_LOCAL_MACHINE, key_name, user_data_dir) || LoadUserDataDirPolicyFromRegistry(HKEY_CURRENT_USER, key_name, diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc index d60d423..c5ebd4a 100644 --- a/chrome/browser/printing/print_dialog_cloud.cc +++ b/chrome/browser/printing/print_dialog_cloud.cc @@ -161,17 +161,17 @@ string16 GetSwitchValueString16(const CommandLine& command_line, void CloudPrintDataSenderHelper::CallJavascriptFunction( const std::wstring& function_name) { - web_ui_->CallJavascriptFunction(base::WideToASCII(function_name)); + web_ui_->CallJavascriptFunction(WideToASCII(function_name)); } void CloudPrintDataSenderHelper::CallJavascriptFunction( const std::wstring& function_name, const Value& arg) { - web_ui_->CallJavascriptFunction(base::WideToASCII(function_name), arg); + web_ui_->CallJavascriptFunction(WideToASCII(function_name), arg); } void CloudPrintDataSenderHelper::CallJavascriptFunction( const std::wstring& function_name, const Value& arg1, const Value& arg2) { - web_ui_->CallJavascriptFunction(base::WideToASCII(function_name), arg1, arg2); + web_ui_->CallJavascriptFunction(WideToASCII(function_name), arg1, arg2); } void CloudPrintDataSenderHelper::CallJavascriptFunction( @@ -180,7 +180,7 @@ void CloudPrintDataSenderHelper::CallJavascriptFunction( const Value& arg2, const Value& arg3) { web_ui_->CallJavascriptFunction( - base::WideToASCII(function_name), arg1, arg2, arg3); + WideToASCII(function_name), arg1, arg2, arg3); } // Clears out the pointer we're using to communicate. Either routine is diff --git a/chrome/browser/printing/printing_layout_browsertest.cc b/chrome/browser/printing/printing_layout_browsertest.cc index c930ac0..73053ac 100644 --- a/chrome/browser/printing/printing_layout_browsertest.cc +++ b/chrome/browser/printing/printing_layout_browsertest.cc @@ -141,7 +141,7 @@ class PrintingLayoutTest : public PrintingTest<InProcessBrowserTest>, Image png_content(png); double diff_emf = emf_content.PercentageDifferent(test_content); - EXPECT_EQ(0., diff_emf) << base::WideToUTF8(verification_name) << + EXPECT_EQ(0., diff_emf) << WideToUTF8(verification_name) << " original size:" << emf_content.size().ToString() << " result size:" << test_content.size().ToString(); if (diff_emf) { @@ -154,7 +154,7 @@ class PrintingLayoutTest : public PrintingTest<InProcessBrowserTest>, // This verification is only to know that the EMF rendering stays // immutable. double diff_png = emf_content.PercentageDifferent(png_content); - EXPECT_EQ(0., diff_png) << base::WideToUTF8(verification_name) << + EXPECT_EQ(0., diff_png) << WideToUTF8(verification_name) << " original size:" << emf_content.size().ToString() << " result size:" << test_content.size().ToString(); if (diff_png) { @@ -204,7 +204,7 @@ class PrintingLayoutTest : public PrintingTest<InProcessBrowserTest>, base::FilePath file; while (!(file = enumerator.Next()).empty()) { std::wstring ext = file.Extension(); - if (base::strcasecmp(base::WideToUTF8(ext).c_str(), ".emf") == 0) { + if (base::strcasecmp(WideToUTF8(ext).c_str(), ".emf") == 0) { EXPECT_FALSE(found_emf) << "Found a leftover .EMF file: \"" << emf_file << "\" and \"" << file.value() << "\" when looking for \"" << verification_name << "\""; @@ -212,7 +212,7 @@ class PrintingLayoutTest : public PrintingTest<InProcessBrowserTest>, emf_file = file.value(); continue; } - if (base::strcasecmp(base::WideToUTF8(ext).c_str(), ".prn") == 0) { + if (base::strcasecmp(WideToUTF8(ext).c_str(), ".prn") == 0) { EXPECT_FALSE(found_prn) << "Found a leftover .PRN file: \"" << prn_file << "\" and \"" << file.value() << "\" when looking for \"" << verification_name << "\""; diff --git a/chrome/browser/process_singleton_linux.cc b/chrome/browser/process_singleton_linux.cc index 1e7990d..fecbda9 100644 --- a/chrome/browser/process_singleton_linux.cc +++ b/chrome/browser/process_singleton_linux.cc @@ -302,9 +302,9 @@ void DisplayProfileInUseError(const std::string& lock_path, IDS_PROFILE_IN_USE_LINUX, base::IntToString16(pid), ASCIIToUTF16(hostname), - base::WideToUTF16(base::SysNativeMBToWide(lock_path)), + WideToUTF16(base::SysNativeMBToWide(lock_path)), l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); - LOG(ERROR) << base::SysWideToNativeMB(base::UTF16ToWide(error)).c_str(); + LOG(ERROR) << base::SysWideToNativeMB(UTF16ToWide(error)).c_str(); if (!g_disable_prompt) { #if defined(TOOLKIT_GTK) ProcessSingletonDialog::ShowAndRun(UTF16ToUTF8(error)); diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc index 67aeb30..09617c6 100644 --- a/chrome/browser/search_engines/template_url_prepopulate_data.cc +++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc @@ -1205,8 +1205,8 @@ TemplateURL* MakePrepopulatedTemplateURLFromPrepopulateEngine( alternate_urls.AppendString(std::string(engine.alternate_urls[i])); } - return MakePrepopulatedTemplateURL(profile, base::WideToUTF16(engine.name), - base::WideToUTF16(engine.keyword), engine.search_url, engine.suggest_url, + return MakePrepopulatedTemplateURL(profile, WideToUTF16(engine.name), + WideToUTF16(engine.keyword), engine.search_url, engine.suggest_url, engine.instant_url, engine.favicon_url, engine.encoding, alternate_urls, engine.search_terms_replacement_key, engine.id); } diff --git a/chrome/browser/search_engines/template_url_unittest.cc b/chrome/browser/search_engines/template_url_unittest.cc index 42a86ac..3273fa5 100644 --- a/chrome/browser/search_engines/template_url_unittest.cc +++ b/chrome/browser/search_engines/template_url_unittest.cc @@ -243,14 +243,13 @@ TEST_F(TemplateURLTest, URLRefTermToWide) { } to_wide_cases[] = { {"hello+world", ASCIIToUTF16("hello world")}, // Test some big-5 input. - {"%a7A%A6%6e+to+you", base::WideToUTF16(L"\x4f60\x597d to you")}, + {"%a7A%A6%6e+to+you", 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", - base::WideToUTF16(L"\x4f60\x35\x597d to you")}, + {"%e4%bd%a05%e5%a5%bd+to+you", WideToUTF16(L"\x4f60\x35\x597d to you")}, // Undecodable input should stay escaped. - {"%91%01+abcd", base::WideToUTF16(L"%91%01 abcd")}, + {"%91%01+abcd", 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. @@ -352,7 +351,7 @@ TEST_F(TemplateURLTest, ReplaceArbitrarySearchTerms) { const std::string url; const std::string expected_result; } test_data[] = { - { "BIG5", base::WideToUTF16(L"\x60BD"), + { "BIG5", WideToUTF16(L"\x60BD"), "http://foo/?{searchTerms}{inputEncoding}", "http://foo/?%B1~BIG5" }, { "UTF-8", ASCIIToUTF16("blah"), diff --git a/chrome/browser/speech/tts_win.cc b/chrome/browser/speech/tts_win.cc index 2dd1e29..cb3a0c2 100644 --- a/chrome/browser/speech/tts_win.cc +++ b/chrome/browser/speech/tts_win.cc @@ -100,7 +100,7 @@ bool TtsPlatformImplWin::Speak( // TODO(dmazzoni): convert SSML to SAPI xml. http://crbug.com/88072 - utterance_ = base::UTF8ToWide(src_utterance); + utterance_ = UTF8ToWide(src_utterance); utterance_id_ = utterance_id; char_position_ = 0; std::wstring merged_utterance = prefix + utterance_ + suffix; diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc index fa44c3f..a78b350 100644 --- a/chrome/browser/sync/glue/bookmark_change_processor.cc +++ b/chrome/browser/sync/glue/bookmark_change_processor.cc @@ -70,7 +70,7 @@ void BookmarkChangeProcessor::UpdateSyncNodeProperties( syncer::WriteNode* dst) { // Set the properties of the item. dst->SetIsFolder(src->is_folder()); - dst->SetTitle(base::UTF16ToWideHack(src->GetTitle())); + dst->SetTitle(UTF16ToWideHack(src->GetTitle())); sync_pb::BookmarkSpecifics bookmark_specifics(dst->GetBookmarkSpecifics()); if (!src->is_folder()) bookmark_specifics.set_url(src->url().spec()); diff --git a/chrome/browser/sync/glue/generic_change_processor.cc b/chrome/browser/sync/glue/generic_change_processor.cc index 4609291..37a0138 100644 --- a/chrome/browser/sync/glue/generic_change_processor.cc +++ b/chrome/browser/sync/glue/generic_change_processor.cc @@ -352,7 +352,7 @@ syncer::SyncError GenericChangeProcessor::ProcessSyncChanges( } } } - sync_node.SetTitle(base::UTF8ToWide(change.sync_data().GetTitle())); + sync_node.SetTitle(UTF8ToWide(change.sync_data().GetTitle())); sync_node.SetEntitySpecifics(change.sync_data().GetSpecifics()); if (merge_result_.get()) { merge_result_->set_num_items_added( @@ -445,7 +445,7 @@ syncer::SyncError GenericChangeProcessor::ProcessSyncChanges( } } - sync_node.SetTitle(base::UTF8ToWide(change.sync_data().GetTitle())); + sync_node.SetTitle(UTF8ToWide(change.sync_data().GetTitle())); sync_node.SetEntitySpecifics(change.sync_data().GetSpecifics()); if (merge_result_.get()) { merge_result_->set_num_items_modified( diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc index 1ce604a..37488be 100644 --- a/chrome/browser/sync/glue/session_model_associator.cc +++ b/chrome/browser/sync/glue/session_model_associator.cc @@ -664,7 +664,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(base::UTF8ToWide(current_machine_tag_)); + write_node.SetTitle(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/synced_device_tracker.cc b/chrome/browser/sync/glue/synced_device_tracker.cc index 3458403..33c1087 100644 --- a/chrome/browser/sync/glue/synced_device_tracker.cc +++ b/chrome/browser/sync/glue/synced_device_tracker.cc @@ -99,7 +99,7 @@ void SyncedDeviceTracker::WriteLocalDeviceInfo(const DeviceInfo& info) { if (node.InitByClientTagLookup(syncer::DEVICE_INFO, local_device_info_tag_) == syncer::BaseNode::INIT_OK) { node.SetDeviceInfoSpecifics(specifics); - node.SetTitle(base::ASCIIToWide(specifics.client_name())); + node.SetTitle(ASCIIToWide(specifics.client_name())); } else { syncer::ReadNode type_root(&trans); syncer::BaseNode::InitByLookupResult type_root_lookup_result = @@ -113,7 +113,7 @@ void SyncedDeviceTracker::WriteLocalDeviceInfo(const DeviceInfo& info) { local_device_info_tag_); DCHECK_EQ(syncer::WriteNode::INIT_SUCCESS, create_result); new_node.SetDeviceInfoSpecifics(specifics); - new_node.SetTitle(base::ASCIIToWide(specifics.client_name())); + new_node.SetTitle(ASCIIToWide(specifics.client_name())); } } diff --git a/chrome/browser/sync/glue/tab_node_pool.cc b/chrome/browser/sync/glue/tab_node_pool.cc index fa27617..3f008ee 100644 --- a/chrome/browser/sync/glue/tab_node_pool.cc +++ b/chrome/browser/sync/glue/tab_node_pool.cc @@ -63,7 +63,7 @@ int64 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(base::UTF8ToWide(tab_node_tag)); + tab_node.SetTitle(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 dbc82a3..8a4c213 100644 --- a/chrome/browser/sync/glue/typed_url_change_processor.cc +++ b/chrome/browser/sync/glue/typed_url_change_processor.cc @@ -168,7 +168,7 @@ bool TypedUrlChangeProcessor::CreateOrUpdateSyncNode( return false; } - create_node.SetTitle(base::UTF8ToWide(tag)); + create_node.SetTitle(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 38c6724..29694c4 100644 --- a/chrome/browser/sync/glue/typed_url_model_associator.cc +++ b/chrome/browser/sync/glue/typed_url_model_associator.cc @@ -299,7 +299,7 @@ syncer::SyncError TypedUrlModelAssociator::DoAssociateModels() { model_type()); } - node.SetTitle(base::UTF8ToWide(tag)); + node.SetTitle(UTF8ToWide(tag)); WriteToSyncNode(*ix, visits, &node); } diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc index ce0bdf7..7016715 100644 --- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc @@ -154,7 +154,7 @@ class FakeServerChange { std::string old_title = node.GetTitle(); node.SetTitle(new_title); SetModified(id); - return base::UTF8ToWide(old_title); + return UTF8ToWide(old_title); } // Set a new parent and predecessor value. Return the old parent id. @@ -367,7 +367,7 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { node.SetIsFolder(true); node.GetMutableEntryForTest()->Put( syncer::syncable::UNIQUE_SERVER_TAG, permanent_tags[i]); - node.SetTitle(base::UTF8ToWide(permanent_tags[i])); + node.SetTitle(UTF8ToWide(permanent_tags[i])); node.SetExternalId(0); last_child_id = node.GetId(); } @@ -529,7 +529,7 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { const BookmarkNode* bnode = model_associator_->GetChromeNodeFromSyncId(sync_id); ASSERT_TRUE(bnode); - EXPECT_EQ(bnode->GetTitle(), base::WideToUTF16Hack(title)); + EXPECT_EQ(bnode->GetTitle(), WideToUTF16Hack(title)); } void ExpectBrowserNodeURL(int64 sync_id, const std::string& url) { @@ -1266,10 +1266,10 @@ void ProfileSyncServiceBookmarkTestWithData::PopulateFromTestData( if (item.url) { const base::Time add_time = start_time_ + base::TimeDelta::FromMinutes(*running_count); - model_->AddURLWithCreationTime(node, i, base::WideToUTF16Hack(item.title), + model_->AddURLWithCreationTime(node, i, WideToUTF16Hack(item.title), GURL(item.url), add_time); } else { - model_->AddFolder(node, i, base::WideToUTF16Hack(item.title)); + model_->AddFolder(node, i, WideToUTF16Hack(item.title)); } (*running_count)++; } @@ -1289,7 +1289,7 @@ void ProfileSyncServiceBookmarkTestWithData::CompareWithTestData( const TestData& item = data[i]; GURL url = GURL(item.url == NULL ? "" : item.url); BookmarkNode test_node(url); - test_node.SetTitle(base::WideToUTF16Hack(item.title)); + test_node.SetTitle(WideToUTF16Hack(item.title)); EXPECT_EQ(child_node->GetTitle(), test_node.GetTitle()); if (item.url) { EXPECT_FALSE(child_node->is_folder()); @@ -1724,7 +1724,7 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, UpdateDateAdded) { const BookmarkNode* node = model_->bookmark_bar_node()->GetChild(0); ASSERT_TRUE(node); EXPECT_TRUE(node->is_url()); - EXPECT_EQ(base::WideToUTF16Hack(kTitle), node->GetTitle()); + EXPECT_EQ(WideToUTF16Hack(kTitle), node->GetTitle()); EXPECT_EQ(kUrl, node->url().possibly_invalid_spec()); EXPECT_EQ(node->date_added(), base::Time::FromInternalValue(30)); } @@ -1823,7 +1823,7 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, UpdateTransactionVersion) { // versions of others remain same. const BookmarkNode* changed_bookmark = model_->bookmark_bar_node()->GetChild(0); - model_->SetTitle(changed_bookmark, base::WideToUTF16Hack(L"test")); + model_->SetTitle(changed_bookmark, WideToUTF16Hack(L"test")); MessageLoop::current()->RunUntilIdle(); GetTransactionVersions(model_->root_node(), &new_versions); EXPECT_EQ(initial_versions[model_->root_node()->id()] + 2, diff --git a/chrome/browser/sync/test/integration/bookmarks_helper.cc b/chrome/browser/sync/test/integration/bookmarks_helper.cc index f53b23d..49ca45d 100644 --- a/chrome/browser/sync/test/integration/bookmarks_helper.cc +++ b/chrome/browser/sync/test/integration/bookmarks_helper.cc @@ -426,7 +426,7 @@ const BookmarkNode* AddURL(int profile, return NULL; } const BookmarkNode* result = GetBookmarkModel(profile)-> - AddURL(parent, index, base::WideToUTF16(title), url); + AddURL(parent, index, WideToUTF16(title), url); if (!result) { LOG(ERROR) << "Could not add bookmark " << title << " to Profile " << profile; @@ -436,7 +436,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, base::WideToUTF16(title), url); + AddURL(v_parent, index, WideToUTF16(title), url); if (!v_node) { LOG(ERROR) << "Could not add bookmark " << title << " to the verifier"; return NULL; @@ -467,8 +467,7 @@ const BookmarkNode* AddFolder(int profile, return NULL; } const BookmarkNode* result = - GetBookmarkModel(profile)->AddFolder(parent, index, - base::WideToUTF16(title)); + GetBookmarkModel(profile)->AddFolder(parent, index, WideToUTF16(title)); EXPECT_TRUE(result); if (!result) { LOG(ERROR) << "Could not add folder " << title << " to Profile " @@ -479,7 +478,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, base::WideToUTF16(title)); + v_parent, index, WideToUTF16(title)); if (!v_node) { LOG(ERROR) << "Could not add folder " << title << " to the verifier"; return NULL; @@ -498,9 +497,9 @@ void SetTitle(int profile, if (test()->use_verifier()) { const BookmarkNode* v_node = NULL; FindNodeInVerifier(GetBookmarkModel(profile), node, &v_node); - GetVerifierBookmarkModel()->SetTitle(v_node, base::WideToUTF16(new_title)); + GetVerifierBookmarkModel()->SetTitle(v_node, WideToUTF16(new_title)); } - GetBookmarkModel(profile)->SetTitle(node, base::WideToUTF16(new_title)); + GetBookmarkModel(profile)->SetTitle(node, WideToUTF16(new_title)); } void SetFavicon(int profile, @@ -692,13 +691,13 @@ const BookmarkNode* GetUniqueNodeByURL(int profile, const GURL& url) { int CountBookmarksWithTitlesMatching(int profile, const std::wstring& title) { return CountNodesWithTitlesMatching(GetBookmarkModel(profile), BookmarkNode::URL, - base::WideToUTF16(title)); + WideToUTF16(title)); } int CountFoldersWithTitlesMatching(int profile, const std::wstring& title) { return CountNodesWithTitlesMatching(GetBookmarkModel(profile), BookmarkNode::FOLDER, - base::WideToUTF16(title)); + WideToUTF16(title)); } gfx::Image CreateFavicon(SkColor color) { 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 2b6d734..1400646 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 @@ -104,8 +104,8 @@ IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, AddUnicodeProfile) { ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; std::set<AutofillKey> keys; - keys.insert(AutofillKey(base::WideToUTF16(L"Sigur R\u00F3s"), - base::WideToUTF16(L"\u00C1g\u00E6tis byrjun"))); + keys.insert(AutofillKey(WideToUTF16(L"Sigur R\u00F3s"), + WideToUTF16(L"\u00C1g\u00E6tis byrjun"))); AddKeys(0, keys); ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AwaitQuiescence()); diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 2d3c753..ccda5a4 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -428,7 +428,7 @@ Browser::Browser(const CreateParams& params) // name. See http://crbug.com/7028. ui::win::SetAppIdForWindow( is_app() && !is_type_panel() ? - ShellIntegration::GetAppModelIdForProfile(base::UTF8ToWide(app_name_), + ShellIntegration::GetAppModelIdForProfile(UTF8ToWide(app_name_), profile_->GetPath()) : ShellIntegration::GetChromiumModelIdForProfile(profile_->GetPath()), window()->GetNativeWindow()); diff --git a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc index 0209679..938f72f 100644 --- a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc +++ b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc @@ -138,7 +138,7 @@ class FindInPageControllerTest : public InProcessBrowserTest { bool case_sensitive, int* ordinal) { return ui_test_utils::FindInPage( - web_contents, base::WideToUTF16(std::wstring(search_str)), + web_contents, WideToUTF16(std::wstring(search_str)), forward, case_sensitive, ordinal, NULL); } @@ -320,8 +320,8 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_SearchWithinSpecialURL) { FlushHistoryService(); EXPECT_EQ(1, FindInPageWchar(web_contents, - base::ASCIIToWide(download_url.spec()).c_str(), - kFwd, kIgnoreCase, NULL)); + ASCIIToWide(download_url.spec()).c_str(), kFwd, + kIgnoreCase, NULL)); } // Verify search selection coordinates. The data file used is set-up such that @@ -333,9 +333,9 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageSpecialURLs) { WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); ui_test_utils::NavigateToURL(browser(), GetURL("specialchar.html")); - ui_test_utils::FindInPage(web_contents, base::WideToUTF16(search_string), + ui_test_utils::FindInPage(web_contents, WideToUTF16(search_string), kFwd, kIgnoreCase, NULL, &first); - ui_test_utils::FindInPage(web_contents, base::WideToUTF16(search_string), + ui_test_utils::FindInPage(web_contents, WideToUTF16(search_string), kFwd, kIgnoreCase, NULL, &second); // We have search occurrence in the same row, so top-bottom coordinates should @@ -346,7 +346,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageSpecialURLs) { ASSERT_LT(first.right(), second.right()); ui_test_utils::FindInPage( - web_contents, base::WideToUTF16(search_string), kBack, kIgnoreCase, NULL, + web_contents, WideToUTF16(search_string), kBack, kIgnoreCase, NULL, &first_reverse); // We find next and we go back so find coordinates should be the same as // previous ones. @@ -361,11 +361,9 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, ui_test_utils::NavigateToURL(browser(), GetURL("specialchar.html")); std::wstring search_string = - L"\u4e2d\u65b0\u793e\u8bb0\u8005\u5b8b" - L"\u5409\u6cb3\u6444\u4e2d\u65b0\u7f51"; + L"\u4e2d\u65b0\u793e\u8bb0\u8005\u5b8b\u5409\u6cb3\u6444\u4e2d\u65b0\u7f51"; EXPECT_EQ(0, ui_test_utils::FindInPage( - web_contents, base::WideToUTF16(search_string), kFwd, kIgnoreCase, NULL, - NULL)); + web_contents, WideToUTF16(search_string), kFwd, kIgnoreCase, NULL, NULL)); } // Verifies that span and lists are searchable. @@ -376,13 +374,11 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, SpanAndListsSearchable) { std::wstring search_string = L"has light blue eyes and my father has dark"; EXPECT_EQ(1, ui_test_utils::FindInPage( - web_contents, base::WideToUTF16(search_string), kFwd, kIgnoreCase, NULL, - NULL)); + web_contents, WideToUTF16(search_string), kFwd, kIgnoreCase, NULL, NULL)); search_string = L"Google\nApple\nandroid"; EXPECT_EQ(1, ui_test_utils::FindInPage( - web_contents, base::WideToUTF16(search_string), kFwd, kIgnoreCase, NULL, - NULL)); + web_contents, WideToUTF16(search_string), kFwd, kIgnoreCase, NULL, NULL)); } // Find in a very large page. @@ -408,7 +404,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindLongString) { base::FilePath().AppendASCII("LongFind.txt")); std::string query; file_util::ReadFileToString(path, &query); - std::wstring search_string = base::UTF8ToWide(query); + std::wstring search_string = UTF8ToWide(query); EXPECT_EQ(1, FindInPageWchar(web_contents, search_string.c_str(), kFwd, kIgnoreCase, NULL)); @@ -471,7 +467,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindWholeFileContent) { std::string query; file_util::ReadFileToString(path, &query); - std::wstring search_string = base::UTF8ToWide(query); + std::wstring search_string = UTF8ToWide(query); EXPECT_EQ(1, FindInPageWchar(web_contents, search_string.c_str(), false, false, NULL)); @@ -1194,7 +1190,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, PreferPreviousSearch) { ui_test_utils::FindInPage(web_contents_1, string16(), kFwd, kIgnoreCase, &ordinal, NULL); EXPECT_EQ(FindTabHelper::FromWebContents(web_contents_1)->find_text(), - base::WideToUTF16(L"text")); + WideToUTF16(L"text")); } // This tests that whenever you close and reopen the Find bar, it should show diff --git a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc index 228bf28..1cb71e0 100644 --- a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc +++ b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc @@ -779,8 +779,7 @@ class OmniboxViewTest : public InProcessBrowserTest, // Keyword should also be accepted by typing an ideographic space. omnibox_view->OnBeforePossibleChange(); omnibox_view->SetWindowTextAndCaretPos(search_keyword + - base::WideToUTF16(L"\x3000"), search_keyword.length() + 1, false, - false); + WideToUTF16(L"\x3000"), search_keyword.length() + 1, false, false); omnibox_view->OnAfterPossibleChange(); ASSERT_FALSE(omnibox_view->model()->is_keyword_hint()); ASSERT_EQ(search_keyword, omnibox_view->model()->keyword()); diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc index ab434ee..3bd71b6 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc @@ -150,7 +150,7 @@ LaunchMode GetLaunchShortcutKind() { std::string appdata_path; env->GetVar("USERPROFILE", &appdata_path); if (!appdata_path.empty() && - shortcut.find(base::ASCIIToWide(appdata_path)) != std::wstring::npos) + shortcut.find(ASCIIToWide(appdata_path)) != std::wstring::npos) return LM_SHORTCUT_DESKTOP; return LM_SHORTCUT_UNKNOWN; } diff --git a/chrome/browser/ui/views/about_ipc_dialog.cc b/chrome/browser/ui/views/about_ipc_dialog.cc index b763948..cd87c0c 100644 --- a/chrome/browser/ui/views/about_ipc_dialog.cc +++ b/chrome/browser/ui/views/about_ipc_dialog.cc @@ -96,7 +96,7 @@ void InitDialog(HWND hwnd) { (*i->second)(&name, NULL, NULL); if (name.empty()) continue; // Will happen if the message file isn't included above. - std::wstring wname = base::UTF8ToWide(name); + std::wstring wname = UTF8ToWide(name); int index = messages->InsertItem( LVIF_TEXT | LVIF_PARAM, 0, wname.c_str(), 0, 0, 0, i->first); @@ -304,14 +304,14 @@ void AboutIPCDialog::Log(const IPC::LogData& data) { message_list_.SetItemText(index, kTimeColumn, sent_str.c_str()); message_list_.SetItemText(index, kChannelColumn, - base::ASCIIToWide(data.channel).c_str()); + ASCIIToWide(data.channel).c_str()); std::string message_name; IPC::Logging::GetMessageText(data.type, &message_name, NULL, NULL); message_list_.SetItemText(index, kMessageColumn, - base::UTF8ToWide(message_name).c_str()); + UTF8ToWide(message_name).c_str()); message_list_.SetItemText(index, kFlagsColumn, - base::UTF8ToWide(data.flags).c_str()); + UTF8ToWide(data.flags).c_str()); int64 time_to_send = (base::Time::FromInternalValue(data.receive) - sent).InMilliseconds(); @@ -327,7 +327,7 @@ void AboutIPCDialog::Log(const IPC::LogData& data) { message_list_.SetItemText(index, kProcessColumn, temp.c_str()); message_list_.SetItemText(index, kParamsColumn, - base::UTF8ToWide(data.params).c_str()); + UTF8ToWide(data.params).c_str()); message_list_.EnsureVisible(index, FALSE); } diff --git a/chrome/browser/ui/views/accessibility/browser_views_accessibility_browsertest.cc b/chrome/browser/ui/views/accessibility/browser_views_accessibility_browsertest.cc index 42438ec..319cd91 100644 --- a/chrome/browser/ui/views/accessibility/browser_views_accessibility_browsertest.cc +++ b/chrome/browser/ui/views/accessibility/browser_views_accessibility_browsertest.cc @@ -134,7 +134,7 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, ASSERT_TRUE(NULL != acc_obj); ui_test_utils::NavigateToURL(browser(), GURL(chrome::kAboutBlankURL)); - std::wstring title = base::UTF16ToWide(l10n_util::GetStringFUTF16( + std::wstring title = UTF16ToWide(l10n_util::GetStringFUTF16( IDS_BROWSER_WINDOW_TITLE_FORMAT, ASCIIToUTF16(chrome::kAboutBlankURL))); TestAccessibilityInfo(acc_obj, title, ROLE_SYSTEM_WINDOW); @@ -149,7 +149,7 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, GetBrowserView()->GetWidget()->non_client_view(); TestViewAccessibilityObject(non_client_view, - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), ROLE_SYSTEM_WINDOW); } @@ -162,7 +162,7 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestViewAccessibilityObject( browser_root_view, - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), ROLE_SYSTEM_APPLICATION); } @@ -173,7 +173,7 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, // Verify root view MSAA name and role. TestViewAccessibilityObject( GetBrowserView(), - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), ROLE_SYSTEM_CLIENT); } @@ -184,7 +184,7 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, // Verify toolbar MSAA name and role. TestViewAccessibilityObject( GetToolbarView(), - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLBAR)), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLBAR)), ROLE_SYSTEM_TOOLBAR); } @@ -195,7 +195,7 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, // Verify Back button MSAA name and role. TestViewAccessibilityObject( GetToolbarView()->GetViewByID(VIEW_ID_BACK_BUTTON), - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK)), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK)), ROLE_SYSTEM_BUTTONDROPDOWN); } @@ -207,7 +207,7 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, // Verify Forward button MSAA name and role. TestViewAccessibilityObject( GetToolbarView()->GetViewByID(VIEW_ID_FORWARD_BUTTON), - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)), ROLE_SYSTEM_BUTTONDROPDOWN); } @@ -219,7 +219,7 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, // Verify Reload button MSAA name and role. TestViewAccessibilityObject( GetToolbarView()->GetViewByID(VIEW_ID_RELOAD_BUTTON), - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)), ROLE_SYSTEM_PUSHBUTTON); } @@ -230,7 +230,7 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, // Verify Home button MSAA name and role. TestViewAccessibilityObject( GetToolbarView()->GetViewByID(VIEW_ID_HOME_BUTTON), - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)), ROLE_SYSTEM_PUSHBUTTON); } @@ -241,7 +241,7 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, // Verify Star button MSAA name and role. TestViewAccessibilityObject( GetToolbarView()->GetViewByID(VIEW_ID_STAR_BUTTON), - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_STAR)), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_STAR)), ROLE_SYSTEM_PUSHBUTTON); } @@ -253,7 +253,7 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, // Verify App menu button MSAA name and role. TestViewAccessibilityObject( GetToolbarView()->GetViewByID(VIEW_ID_APP_MENU), - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)), ROLE_SYSTEM_BUTTONMENU); } @@ -262,6 +262,6 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, DISABLED_TestBookmarkBarViewAccObj) { TestViewAccessibilityObject( GetBookmarkBarView(), - base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS)), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS)), ROLE_SYSTEM_TOOLBAR); } diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc index 92eb620..91de108 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc @@ -185,7 +185,7 @@ TEST_F(BookmarkEditorViewTest, EditURLKeepsPosition) { BookmarkEditor::EditDetails::EditNode(GetNode("a")), BookmarkEditorView::SHOW_TREE); - SetURLText(base::UTF8ToWide(GURL(base_path() + "new_a").spec())); + SetURLText(UTF8ToWide(GURL(base_path() + "new_a").spec())); ApplyEdits(editor_tree_model()->GetRoot()->GetChild(0)); @@ -219,7 +219,7 @@ TEST_F(BookmarkEditorViewTest, ChangeParentAndURL) { BookmarkEditor::EditDetails::EditNode(GetNode("a")), BookmarkEditorView::SHOW_TREE); - SetURLText(base::UTF8ToWide(GURL(base_path() + "new_a").spec())); + SetURLText(UTF8ToWide(GURL(base_path() + "new_a").spec())); ApplyEdits(editor_tree_model()->GetRoot()->GetChild(1)); @@ -274,7 +274,7 @@ TEST_F(BookmarkEditorViewTest, NewURL) { bb_node, 1, GURL(), string16()), BookmarkEditorView::SHOW_TREE); - SetURLText(base::UTF8ToWide(GURL(base_path() + "a").spec())); + SetURLText(UTF8ToWide(GURL(base_path() + "a").spec())); SetTitleText(L"new_a"); ApplyEdits(editor_tree_model()->GetRoot()->GetChild(0)); @@ -294,7 +294,7 @@ TEST_F(BookmarkEditorViewTest, ChangeURLNoTree) { model_->other_node()->GetChild(0)), BookmarkEditorView::NO_TREE); - SetURLText(base::UTF8ToWide(GURL(base_path() + "a").spec())); + SetURLText(UTF8ToWide(GURL(base_path() + "a").spec())); SetTitleText(L"new_a"); ApplyEdits(NULL); diff --git a/chrome/browser/ui/views/extensions/native_app_window_views.cc b/chrome/browser/ui/views/extensions/native_app_window_views.cc index 8c4eb5f..e03fb9b 100644 --- a/chrome/browser/ui/views/extensions/native_app_window_views.cc +++ b/chrome/browser/ui/views/extensions/native_app_window_views.cc @@ -142,7 +142,7 @@ void NativeAppWindowViews::InitializeDefaultWindow( extension()->id()); ui::win::SetAppIdForWindow( ShellIntegration::GetAppModelIdForProfile( - base::UTF8ToWide(app_name), shell_window_->profile()->GetPath()), + UTF8ToWide(app_name), shell_window_->profile()->GetPath()), GetWidget()->GetTopLevelWidget()->GetNativeWindow()); #endif } diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc index af59761..2112377 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.cc +++ b/chrome/browser/ui/views/external_protocol_dialog.cc @@ -134,8 +134,7 @@ ExternalProtocolDialog::ExternalProtocolDialog(WebContents* web_contents, string16 elided_command; ui::ElideString(ASCIIToUTF16(url.possibly_invalid_spec()), kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); - ui::ElideString(base::WideToUTF16Hack(command), kMaxCommandSize, - &elided_command); + ui::ElideString(WideToUTF16Hack(command), kMaxCommandSize, &elided_command); string16 message_text = l10n_util::GetStringFUTF16( IDS_EXTERNAL_PROTOCOL_INFORMATION, @@ -172,9 +171,9 @@ std::wstring ExternalProtocolDialog::GetApplicationForProtocol( // to disk. http://crbug.com/61996 base::ThreadRestrictions::ScopedAllowIO allow_io; - std::wstring url_spec = base::ASCIIToWide(url.possibly_invalid_spec()); + std::wstring url_spec = ASCIIToWide(url.possibly_invalid_spec()); std::wstring cmd_key_path = - base::ASCIIToWide(url.scheme() + "\\shell\\open\\command"); + ASCIIToWide(url.scheme() + "\\shell\\open\\command"); base::win::RegKey cmd_key(HKEY_CLASSES_ROOT, cmd_key_path.c_str(), KEY_READ); size_t split_offset = url_spec.find(L':'); if (split_offset == std::wstring::npos) diff --git a/chrome/browser/ui/views/external_tab_container_win.cc b/chrome/browser/ui/views/external_tab_container_win.cc index 0325a33d..6bb6ece 100644 --- a/chrome/browser/ui/views/external_tab_container_win.cc +++ b/chrome/browser/ui/views/external_tab_container_win.cc @@ -552,7 +552,7 @@ void ExternalTabContainerWin::AddNewContents(WebContents* source, attach_params_.dimensions = initial_pos; attach_params_.user_gesture = user_gesture; attach_params_.disposition = disposition; - attach_params_.profile_name = base::WideToUTF8( + attach_params_.profile_name = WideToUTF8( profile->GetPath().DirName().BaseName().value()); automation_->Send(new AutomationMsg_AttachExternalTab( tab_handle_, attach_params_)); @@ -1020,9 +1020,9 @@ bool ExternalTabContainerWin::InitNavigationInfo( web_contents_->GetController().GetCurrentEntryIndex(); nav_info->url = entry->GetURL(); nav_info->referrer = entry->GetReferrer().url; - nav_info->title = base::UTF16ToWideHack(entry->GetTitle()); + nav_info->title = UTF16ToWideHack(entry->GetTitle()); if (nav_info->title.empty()) - nav_info->title = base::UTF8ToWide(nav_info->url.spec()); + nav_info->title = UTF8ToWide(nav_info->url.spec()); nav_info->security_style = entry->GetSSL().security_style; int content_status = entry->GetSSL().content_status; diff --git a/chrome/browser/ui/views/frame/browser_frame_win.cc b/chrome/browser/ui/views/frame/browser_frame_win.cc index 88761af..ada6b651 100644 --- a/chrome/browser/ui/views/frame/browser_frame_win.cc +++ b/chrome/browser/ui/views/frame/browser_frame_win.cc @@ -518,7 +518,7 @@ void BrowserFrameWin::GetMetroCurrentTabInfo(WPARAM w_param) { DCHECK(current_tab); current_tab_info->url = base::win::LocalAllocAndCopyString( - base::UTF8ToWide(current_tab->GetURL().spec())); + UTF8ToWide(current_tab->GetURL().spec())); } //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/ui/views/panels/panel_stack_view.cc b/chrome/browser/ui/views/panels/panel_stack_view.cc index 305ce12..4bc5367 100644 --- a/chrome/browser/ui/views/panels/panel_stack_view.cc +++ b/chrome/browser/ui/views/panels/panel_stack_view.cc @@ -70,9 +70,8 @@ void PanelStackView::EnsureInitialized() { #if defined(OS_WIN) ui::win::SetAppIdForWindow( - ShellIntegration::GetAppModelIdForProfile( - base::UTF8ToWide(panel->app_name()), - panel->profile()->GetPath()), + ShellIntegration::GetAppModelIdForProfile(UTF8ToWide(panel->app_name()), + panel->profile()->GetPath()), chrome::HWNDForWidget(window_)); #endif } diff --git a/chrome/browser/ui/views/panels/panel_view.cc b/chrome/browser/ui/views/panels/panel_view.cc index 6cca503..802e93a 100644 --- a/chrome/browser/ui/views/panels/panel_view.cc +++ b/chrome/browser/ui/views/panels/panel_view.cc @@ -273,9 +273,8 @@ PanelView::PanelView(Panel* panel, const gfx::Rect& bounds) #if defined(OS_WIN) ui::win::SetAppIdForWindow( - ShellIntegration::GetAppModelIdForProfile( - base::UTF8ToWide(panel->app_name()), - panel->profile()->GetPath()), + ShellIntegration::GetAppModelIdForProfile(UTF8ToWide(panel->app_name()), + panel->profile()->GetPath()), chrome::HWNDForWidget(window_)); #endif } diff --git a/chrome/browser/ui/web_applications/web_app_ui.cc b/chrome/browser/ui/web_applications/web_app_ui.cc index a75b85f..5684b50 100644 --- a/chrome/browser/ui/web_applications/web_app_ui.cc +++ b/chrome/browser/ui/web_applications/web_app_ui.cc @@ -283,8 +283,7 @@ void UpdateShortcutWorker::UpdateShortcutsOnFileThread() { if (!shortcut_files_.empty()) { // Generates app id from web app url and profile path. string16 app_id = ShellIntegration::GetAppModelIdForProfile( - base::UTF8ToWide(web_app::GenerateApplicationNameFromURL( - shortcut_info_.url)), + UTF8ToWide(web_app::GenerateApplicationNameFromURL(shortcut_info_.url)), profile_path_); // Sanitize description diff --git a/chrome/browser/ui/webui/extensions/install_extension_handler.cc b/chrome/browser/ui/webui/extensions/install_extension_handler.cc index f75fb96..c01b800 100644 --- a/chrome/browser/ui/webui/extensions/install_extension_handler.cc +++ b/chrome/browser/ui/webui/extensions/install_extension_handler.cc @@ -66,7 +66,7 @@ void InstallExtensionHandler::HandleStartDragMessage(const ListValue* args) { } file_to_install_ = base::FilePath::FromWStringHack( - base::UTF16ToWide(drop_data->filenames.front().path)); + UTF16ToWide(drop_data->filenames.front().path)); } void InstallExtensionHandler::HandleStopDragMessage(const ListValue* args) { diff --git a/chrome/browser/ui/webui/extensions/pack_extension_handler.cc b/chrome/browser/ui/webui/extensions/pack_extension_handler.cc index fe61908..a69cd4d 100644 --- a/chrome/browser/ui/webui/extensions/pack_extension_handler.cc +++ b/chrome/browser/ui/webui/extensions/pack_extension_handler.cc @@ -119,9 +119,9 @@ void PackExtensionHandler::HandlePackMessage(const ListValue* args) { int run_flags = static_cast<int>(flags_double); base::FilePath root_directory = - base::FilePath::FromWStringHack(base::UTF8ToWide(extension_path_)); + base::FilePath::FromWStringHack(UTF8ToWide(extension_path_)); base::FilePath key_file = - base::FilePath::FromWStringHack(base::UTF8ToWide(private_key_path_)); + base::FilePath::FromWStringHack(UTF8ToWide(private_key_path_)); if (root_directory.empty()) { if (extension_path_.empty()) { diff --git a/chrome/browser/ui/webui/fileicon_source.cc b/chrome/browser/ui/webui/fileicon_source.cc index 81b8050..b0d4609 100644 --- a/chrome/browser/ui/webui/fileicon_source.cc +++ b/chrome/browser/ui/webui/fileicon_source.cc @@ -52,7 +52,7 @@ void GetFilePathAndQuery(const std::string& url, // The path we receive has the wrong slashes and escaping for what we need; // this only appears to matter for getting icons from .exe files. std::replace(path.begin(), path.end(), '/', '\\'); - *file_path = base::FilePath(base::UTF8ToWide(path)); + *file_path = base::FilePath(UTF8ToWide(path)); #elif defined(OS_POSIX) // The correct encoding on Linux may not actually be UTF8. *file_path = base::FilePath(path); diff --git a/chrome/browser/ui/webui/version_ui.cc b/chrome/browser/ui/webui/version_ui.cc index c6e8e0a..34c4c52 100644 --- a/chrome/browser/ui/webui/version_ui.cc +++ b/chrome/browser/ui/webui/version_ui.cc @@ -89,8 +89,8 @@ content::WebUIDataSource* CreateVersionUIDataSource(Profile* profile) { IDS_ABOUT_VERSION_COMMAND_LINE); #if defined(OS_WIN) - html_source->AddString("command_line", base::WideToUTF16( - CommandLine::ForCurrentProcess()->GetCommandLineString())); + html_source->AddString("command_line", + WideToUTF16(CommandLine::ForCurrentProcess()->GetCommandLineString())); #elif defined(OS_POSIX) std::string command_line = ""; typedef std::vector<std::string> ArgvList; diff --git a/chrome/browser/value_store/leveldb_value_store.cc b/chrome/browser/value_store/leveldb_value_store.cc index 437dfc0..f9458d5 100644 --- a/chrome/browser/value_store/leveldb_value_store.cc +++ b/chrome/browser/value_store/leveldb_value_store.cc @@ -339,7 +339,7 @@ std::string LeveldbValueStore::EnsureDbIsOpen() { #if defined(OS_POSIX) std::string os_path(db_path_.value()); #elif defined(OS_WIN) - std::string os_path = base::Sysbase::WideToUTF8(db_path_.value()); + std::string os_path = base::SysWideToUTF8(db_path_.value()); #endif leveldb::Options options; diff --git a/chrome/browser/webdata/logins_table_win.cc b/chrome/browser/webdata/logins_table_win.cc index 5296187..8a751fe 100644 --- a/chrome/browser/webdata/logins_table_win.cc +++ b/chrome/browser/webdata/logins_table_win.cc @@ -15,7 +15,7 @@ bool LoginsTable::AddIE7Login(const IE7PasswordInfo& info) { "INSERT OR REPLACE INTO ie7_logins " "(url_hash, password_value, date_created) " "VALUES (?,?,?)")); - s.BindString(0, base::WideToUTF8(info.url_hash)); + s.BindString(0, WideToUTF8(info.url_hash)); s.BindBlob(1, &info.encrypted_data.front(), static_cast<int>(info.encrypted_data.size())); s.BindInt64(2, info.date_created.ToTimeT()); @@ -27,7 +27,7 @@ bool LoginsTable::RemoveIE7Login(const IE7PasswordInfo& info) { // Remove a login by UNIQUE-constrained fields. sql::Statement s(db_->GetUniqueStatement( "DELETE FROM ie7_logins WHERE url_hash = ?")); - s.BindString(0, base::WideToUTF8(info.url_hash)); + s.BindString(0, WideToUTF8(info.url_hash)); return s.Run(); } |