diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-24 21:14:53 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-24 21:14:53 +0000 |
commit | 47e870bf26f0c01dafe611ec03c0139c735063df (patch) | |
tree | 43b29b36654d896cf3fd1bd3cc27b830c63522b0 /chrome | |
parent | 883844f40f19b80880e0730a8e2836e6383d1400 (diff) | |
download | chromium_src-47e870bf26f0c01dafe611ec03c0139c735063df.zip chromium_src-47e870bf26f0c01dafe611ec03c0139c735063df.tar.gz chromium_src-47e870bf26f0c01dafe611ec03c0139c735063df.tar.bz2 |
Revert 184352
> Add utf_string_conversions to base namespace.
>
> This adds "using"s for all functions so those can be fixed in a separate pass.
>
> This converts the "Wide" versions of the functions in the Chrome directory as a first pass on the changeover.
>
> BUG=
>
> Review URL: https://codereview.chromium.org/12314090
TBR=brettw@chromium.org
Review URL: https://codereview.chromium.org/12315071
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184355 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
166 files changed, 460 insertions, 502 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc index 7b6e592..08d1891 100644 --- a/chrome/app/breakpad_win.cc +++ b/chrome/app/breakpad_win.cc @@ -701,7 +701,7 @@ void SetCrashKeyValue(const base::StringPiece& key, entry = it->second; } - entry->set(base::UTF8ToWide(key).data(), base::UTF8ToWide(value).data()); + entry->set(UTF8ToWide(key).data(), UTF8ToWide(value).data()); } void ClearCrashKeyValue(const base::StringPiece& key) { @@ -743,8 +743,8 @@ bool WrapMessageBoxWithSEH(const wchar_t* text, const wchar_t* caption, // spawned and basically just shows the 'chrome has crashed' dialog if // the CHROME_CRASHED environment variable is present. bool ShowRestartDialogIfCrashed(bool* exit_now) { - if (!::GetEnvironmentVariableW( - base::ASCIIToWide(env_vars::kShowRestart).c_str(), NULL, 0)) { + if (!::GetEnvironmentVariableW(ASCIIToWide(env_vars::kShowRestart).c_str(), + NULL, 0)) { return false; } @@ -757,12 +757,12 @@ bool ShowRestartDialogIfCrashed(bool* exit_now) { } DWORD len = ::GetEnvironmentVariableW( - base::ASCIIToWide(env_vars::kRestartInfo).c_str(), NULL, 0); + ASCIIToWide(env_vars::kRestartInfo).c_str(), NULL, 0); if (!len) return true; wchar_t* restart_data = new wchar_t[len + 1]; - ::GetEnvironmentVariableW(base::ASCIIToWide(env_vars::kRestartInfo).c_str(), + ::GetEnvironmentVariableW(ASCIIToWide(env_vars::kRestartInfo).c_str(), restart_data, len); restart_data[len] = 0; // The CHROME_RESTART var contains the dialog strings separated by '|'. @@ -777,7 +777,7 @@ bool ShowRestartDialogIfCrashed(bool* exit_now) { // If the UI layout is right-to-left, we need to pass the appropriate MB_XXX // flags so that an RTL message box is displayed. UINT flags = MB_OKCANCEL | MB_ICONWARNING; - if (dlg_strings[2] == base::ASCIIToWide(env_vars::kRtlLocale)) + if (dlg_strings[2] == ASCIIToWide(env_vars::kRtlLocale)) flags |= MB_RIGHT | MB_RTLREADING; return WrapMessageBoxWithSEH(dlg_strings[1].c_str(), dlg_strings[0].c_str(), @@ -804,8 +804,7 @@ extern "C" int __declspec(dllexport) CrashForException( // indicates whether policy data was successfully read. If it is true, |result| // contains the value set by policy. static bool MetricsReportingControlledByPolicy(bool* result) { - std::wstring key_name = - base::UTF8ToWide(policy::key::kMetricsReportingEnabled); + std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled); DWORD value = 0; base::win::RegKey hklm_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistryMandatorySubKey, KEY_READ); @@ -852,7 +851,7 @@ static void InitPipeNameEnvVar(bool is_per_user_install) { bool use_crash_service = !controlled_by_policy && ((command.HasSwitch(switches::kNoErrorDialogs) || GetEnvironmentVariable( - base::ASCIIToWide(env_vars::kHeadless).c_str(), NULL, 0))); + ASCIIToWide(env_vars::kHeadless).c_str(), NULL, 0))); std::wstring pipe_name; if (use_crash_service) { @@ -888,7 +887,7 @@ static void InitPipeNameEnvVar(bool is_per_user_install) { pipe_name = kGoogleUpdatePipeName; pipe_name += user_sid; } - env->SetVar(kPipeNameVar, base::WideToASCII(pipe_name)); + env->SetVar(kPipeNameVar, WideToASCII(pipe_name)); } void InitCrashReporter() { @@ -947,7 +946,7 @@ void InitCrashReporter() { InitDefaultCrashCallback(default_filter); return; } - std::wstring pipe_name = base::ASCIIToWide(pipe_name_ascii); + std::wstring pipe_name = ASCIIToWide(pipe_name_ascii); #ifdef _WIN64 // The protocol for connecting to the out-of-process Breakpad crash diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc index 1b8def9..d78feb2 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -361,7 +361,7 @@ HMODULE MainDllLoader::Load(string16* out_version, string16* out_file) { const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); if (cmd_line.HasSwitch(switches::kChromeVersion)) { version_string = cmd_line.GetSwitchValueNative(switches::kChromeVersion); - version = Version(base::WideToASCII(version_string)); + version = Version(WideToASCII(version_string)); if (!version.IsValid()) { // If a bogus command line flag was given, then abort. @@ -377,7 +377,7 @@ HMODULE MainDllLoader::Load(string16* out_version, string16* out_file) { FileVersionInfo::CreateFileVersionInfoForCurrentModule()); if (file_version_info.get()) { version_string = file_version_info->file_version(); - version = Version(base::WideToASCII(version_string)); + version = Version(WideToASCII(version_string)); } } @@ -387,9 +387,9 @@ HMODULE MainDllLoader::Load(string16* out_version, string16* out_file) { // If no version in the current module, then look in the environment. if (!version.IsValid()) { - if (EnvQueryStr(base::ASCIIToWide(chrome::kChromeVersionEnvVar).c_str(), + if (EnvQueryStr(ASCIIToWide(chrome::kChromeVersionEnvVar).c_str(), &version_string)) { - version = Version(base::WideToASCII(version_string)); + version = Version(WideToASCII(version_string)); LOG_IF(ERROR, !version.IsValid()) << "Invalid environment version: " << version_string; } @@ -428,7 +428,7 @@ int MainDllLoader::Launch(HINSTANCE instance, return chrome::RESULT_CODE_MISSING_DATA; scoped_ptr<base::Environment> env(base::Environment::Create()); - env->SetVar(chrome::kChromeVersionEnvVar, base::WideToUTF8(version)); + env->SetVar(chrome::kChromeVersionEnvVar, WideToUTF8(version)); // TODO(erikwright): Remove this when http://crbug.com/174953 is fixed and // widely deployed. env->UnSetVar(env_vars::kGoogleUpdateIsMachineEnvVar); 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(); } diff --git a/chrome/common/child_process_logging_mac.mm b/chrome/common/child_process_logging_mac.mm index 7dd5380..39c05cd 100644 --- a/chrome/common/child_process_logging_mac.mm +++ b/chrome/common/child_process_logging_mac.mm @@ -95,7 +95,7 @@ void SetClientId(const std::string& client_id) { base::strlcpy(g_client_id, str.c_str(), kClientIdSize); SetClientIdImpl(str, SetCrashKeyValue); - std::wstring wstr = base::ASCIIToWide(str); + std::wstring wstr = ASCIIToWide(str); GoogleUpdateSettings::SetMetricsId(wstr); } diff --git a/chrome/common/child_process_logging_posix.cc b/chrome/common/child_process_logging_posix.cc index 03ae371..39544b0 100644 --- a/chrome/common/child_process_logging_posix.cc +++ b/chrome/common/child_process_logging_posix.cc @@ -72,7 +72,7 @@ void SetClientId(const std::string& client_id) { return; base::strlcpy(g_client_id, str.c_str(), kClientIdSize); - std::wstring wstr = base::ASCIIToWide(str); + std::wstring wstr = ASCIIToWide(str); GoogleUpdateSettings::SetMetricsId(wstr); } diff --git a/chrome/common/child_process_logging_win.cc b/chrome/common/child_process_logging_win.cc index 0832676..4d7ab12 100644 --- a/chrome/common/child_process_logging_win.cc +++ b/chrome/common/child_process_logging_win.cc @@ -80,7 +80,7 @@ void SetActiveURL(const GURL& url) { return; } - (set_active_url)(base::UTF8ToWide(url.possibly_invalid_spec()).c_str()); + (set_active_url)(UTF8ToWide(url.possibly_invalid_spec()).c_str()); } void SetClientId(const std::string& client_id) { @@ -91,7 +91,7 @@ void SetClientId(const std::string& client_id) { if (str.empty()) return; - std::wstring wstr = base::ASCIIToWide(str); + std::wstring wstr = ASCIIToWide(str); std::wstring old_wstr; if (!GoogleUpdateSettings::GetMetricsId(&old_wstr) || wstr != old_wstr) @@ -114,7 +114,7 @@ void SetClientId(const std::string& client_id) { std::string GetClientId() { std::wstring wstr_client_id; if (GoogleUpdateSettings::GetMetricsId(&wstr_client_id)) - return base::WideToASCII(wstr_client_id); + return WideToASCII(wstr_client_id); else return std::string(); } @@ -149,7 +149,7 @@ void SetActiveExtensions(const std::set<std::string>& extension_ids) { std::set<std::string>::const_iterator iter = extension_ids.begin(); for (size_t i = 0; i < kMaxReportedActiveExtensions; ++i) { if (iter != extension_ids.end()) { - (set_extension_id)(i, base::ASCIIToWide(iter->c_str()).c_str()); + (set_extension_id)(i, ASCIIToWide(iter->c_str()).c_str()); ++iter; } else { (set_extension_id)(i, L""); @@ -189,7 +189,7 @@ void SetPrinterInfo(const char* printer_info) { if (!set_printer_info) return; } - (set_printer_info)(base::UTF8ToWide(printer_info).c_str()); + (set_printer_info)(UTF8ToWide(printer_info).c_str()); } void SetCommandLine(const CommandLine* command_line) { diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index a3fa24b..b8f18f7 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -387,7 +387,7 @@ ExtensionResource Extension::GetResource( #if defined(OS_POSIX) base::FilePath relative_file_path(new_path); #elif defined(OS_WIN) - base::FilePath relative_file_path(base::UTF8ToWide(new_path)); + base::FilePath relative_file_path(UTF8ToWide(new_path)); #endif ExtensionResource r(id(), path(), relative_file_path); if ((creation_flags() & Extension::FOLLOW_SYMLINKS_ANYWHERE)) { @@ -790,14 +790,14 @@ bool Extension::ShowConfigureContextMenus() const { std::set<base::FilePath> Extension::GetBrowserImages() const { std::set<base::FilePath> image_paths; - // TODO(viettrungluu): These |FilePath::FromWStringHack(base::UTF8ToWide())| + // TODO(viettrungluu): These |FilePath::FromWStringHack(UTF8ToWide())| // indicate that we're doing something wrong. // Extension icons. for (ExtensionIconSet::IconMap::const_iterator iter = icons().map().begin(); iter != icons().map().end(); ++iter) { image_paths.insert( - base::FilePath::FromWStringHack(base::UTF8ToWide(iter->second))); + base::FilePath::FromWStringHack(UTF8ToWide(iter->second))); } // Theme images. @@ -806,10 +806,8 @@ std::set<base::FilePath> Extension::GetBrowserImages() const { for (DictionaryValue::Iterator it(*theme_images); !it.IsAtEnd(); it.Advance()) { std::string val; - if (it.value().GetAsString(&val)) { - image_paths.insert(base::FilePath::FromWStringHack( - base::UTF8ToWide(val))); - } + if (it.value().GetAsString(&val)) + image_paths.insert(base::FilePath::FromWStringHack(UTF8ToWide(val))); } } @@ -820,7 +818,7 @@ std::set<base::FilePath> Extension::GetBrowserImages() const { iter != page_action_info->default_icon.map().end(); ++iter) { image_paths.insert( - base::FilePath::FromWStringHack(base::UTF8ToWide(iter->second))); + base::FilePath::FromWStringHack(UTF8ToWide(iter->second))); } } @@ -831,7 +829,7 @@ std::set<base::FilePath> Extension::GetBrowserImages() const { iter != browser_action->default_icon.map().end(); ++iter) { image_paths.insert( - base::FilePath::FromWStringHack(base::UTF8ToWide(iter->second))); + base::FilePath::FromWStringHack(UTF8ToWide(iter->second))); } } diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc index 589c8a2..0a3a36b 100644 --- a/chrome/common/extensions/extension_file_util.cc +++ b/chrome/common/extensions/extension_file_util.cc @@ -707,7 +707,7 @@ base::FilePath ExtensionURLToRelativeFilePath(const GURL& url) { #if defined(OS_POSIX) base::FilePath(file_path); #elif defined(OS_WIN) - base::FilePath(base::UTF8ToWide(file_path)); + base::FilePath(UTF8ToWide(file_path)); #else base::FilePath(); NOTIMPLEMENTED(); diff --git a/chrome/common/extensions/extension_file_util_unittest.cc b/chrome/common/extensions/extension_file_util_unittest.cc index 231dfd76..dc3fd3b 100644 --- a/chrome/common/extensions/extension_file_util_unittest.cc +++ b/chrome/common/extensions/extension_file_util_unittest.cc @@ -300,7 +300,7 @@ TEST_F(ExtensionFileUtilTest, ExtensionURLToRelativeFilePath) { base::FilePath expected_path(test_cases[i].expected_relative_path); #elif defined(OS_WIN) base::FilePath expected_path( - base::UTF8ToWide(test_cases[i].expected_relative_path)); + UTF8ToWide(test_cases[i].expected_relative_path)); #endif base::FilePath actual_path = diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc index 347a899..656dd0f 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc @@ -164,7 +164,7 @@ TEST_F(InitValueManifestTest, InitFromValueValidNameInRTL) { // Strong RTL characters in name. extension = LoadAndExpectSuccess("init_valid_name_strong_rtl.json"); - localized_name = base::WideToUTF16(L"Dictionary (\x05D1\x05D2"L" Google)"); + localized_name = WideToUTF16(L"Dictionary (\x05D1\x05D2"L" Google)"); base::i18n::AdjustStringForLocaleDirection(&localized_name); EXPECT_EQ(localized_name, UTF8ToUTF16(extension->name())); diff --git a/chrome/common/json_value_serializer_unittest.cc b/chrome/common/json_value_serializer_unittest.cc index 39e2359..46f45ab 100644 --- a/chrome/common/json_value_serializer_unittest.cc +++ b/chrome/common/json_value_serializer_unittest.cc @@ -122,7 +122,7 @@ TEST(JSONValueSerializerTest, StringEscape) { TEST(JSONValueSerializerTest, UnicodeStrings) { // unicode string json -> escaped ascii text DictionaryValue root; - string16 test(base::WideToUTF16(L"\x7F51\x9875")); + string16 test(WideToUTF16(L"\x7F51\x9875")); root.SetString("web", test); std::string expected = "{\"web\":\"\\u7F51\\u9875\"}"; @@ -146,7 +146,7 @@ TEST(JSONValueSerializerTest, UnicodeStrings) { TEST(JSONValueSerializerTest, HexStrings) { // hex string json -> escaped ascii text DictionaryValue root; - string16 test(base::WideToUTF16(L"\x01\x02")); + string16 test(WideToUTF16(L"\x01\x02")); root.SetString("test", test); std::string expected = "{\"test\":\"\\u0001\\u0002\"}"; diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index fbfdfc9..896cc7b 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -383,7 +383,7 @@ base::FilePath GetLogFileName() { scoped_ptr<base::Environment> env(base::Environment::Create()); if (env->GetVar(env_vars::kLogFileName, &filename) && !filename.empty()) { #if defined(OS_WIN) - return base::FilePath(base::UTF8ToWide(filename)); + return base::FilePath(UTF8ToWide(filename)); #elif defined(OS_POSIX) return base::FilePath(filename); #endif @@ -422,7 +422,7 @@ size_t GetFatalAssertions(AssertionList* assertions) { while (!log_file.eof()) { getline(log_file, utf8_line); if (utf8_line.find(":FATAL:") != std::string::npos) { - wide_line = base::UTF8ToWide(utf8_line); + wide_line = UTF8ToWide(utf8_line); if (assertions) assertions->push_back(wide_line); ++assertion_count; diff --git a/chrome/common/service_process_util.cc b/chrome/common/service_process_util.cc index 0a33e38..bed0614 100644 --- a/chrome/common/service_process_util.cc +++ b/chrome/common/service_process_util.cc @@ -107,7 +107,7 @@ std::string GetServiceProcessScopedName(const std::string& append_str) { base::FilePath user_data_dir; PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); #if defined(OS_WIN) - std::string user_data_dir_path = base::WideToUTF8(user_data_dir.value()); + std::string user_data_dir_path = WideToUTF8(user_data_dir.value()); #elif defined(OS_POSIX) std::string user_data_dir_path = user_data_dir.value(); #endif // defined(OS_WIN) diff --git a/chrome/common/service_process_util_unittest.cc b/chrome/common/service_process_util_unittest.cc index 0ead384..8322c5d 100644 --- a/chrome/common/service_process_util_unittest.cc +++ b/chrome/common/service_process_util_unittest.cc @@ -125,7 +125,7 @@ TEST_F(ServiceProcessStateTest, AutoRun) { std::string value_name = GetServiceProcessScopedName("_service_run"); string16 value; EXPECT_TRUE(base::win::ReadCommandFromAutoRun(HKEY_CURRENT_USER, - base::UTF8ToWide(value_name), + UTF8ToWide(value_name), &value)); autorun_command_line.reset(new CommandLine(CommandLine::FromString(value))); #elif defined(OS_POSIX) && !defined(OS_MACOSX) @@ -155,7 +155,7 @@ TEST_F(ServiceProcessStateTest, AutoRun) { ASSERT_TRUE(state.RemoveFromAutoRun()); #if defined(OS_WIN) EXPECT_FALSE(base::win::ReadCommandFromAutoRun(HKEY_CURRENT_USER, - base::UTF8ToWide(value_name), + UTF8ToWide(value_name), &value)); #elif defined(OS_POSIX) && !defined(OS_MACOSX) EXPECT_FALSE(AutoStart::GetAutostartFileValue( diff --git a/chrome/common/service_process_util_win.cc b/chrome/common/service_process_util_win.cc index 486740b..dfa2fc4 100644 --- a/chrome/common/service_process_util_win.cc +++ b/chrome/common/service_process_util_win.cc @@ -23,12 +23,12 @@ namespace { const char* kTerminateEventSuffix = "_service_terminate_evt"; string16 GetServiceProcessReadyEventName() { - return base::UTF8ToWide( + return UTF8ToWide( GetServiceProcessScopedVersionedName("_service_ready")); } string16 GetServiceProcessTerminateEventName() { - return base::UTF8ToWide( + return UTF8ToWide( GetServiceProcessScopedVersionedName(kTerminateEventSuffix)); } @@ -41,7 +41,7 @@ std::string GetServiceProcessAutoRunKey() { std::string GetObsoleteServiceProcessAutoRunKey() { base::FilePath user_data_dir; PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); - std::string scoped_name = base::WideToUTF8(user_data_dir.value()); + std::string scoped_name = WideToUTF8(user_data_dir.value()); std::replace(scoped_name.begin(), scoped_name.end(), '\\', '!'); std::replace(scoped_name.begin(), scoped_name.end(), '/', '!'); scoped_name.append("_service_run"); @@ -88,7 +88,7 @@ bool ForceServiceProcessShutdown(const std::string& version, std::string versioned_name = version; versioned_name.append(kTerminateEventSuffix); string16 event_name = - base::UTF8ToWide(GetServiceProcessScopedName(versioned_name)); + UTF8ToWide(GetServiceProcessScopedName(versioned_name)); terminate_event.Set(OpenEvent(EVENT_MODIFY_STATE, FALSE, event_name.c_str())); if (!terminate_event.IsValid()) return false; @@ -153,11 +153,10 @@ bool ServiceProcessState::AddToAutoRun() { // Remove the old autorun value first because we changed the naming scheme // for the autorun value name. base::win::RemoveCommandFromAutoRun( - HKEY_CURRENT_USER, - base::UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); + HKEY_CURRENT_USER, UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); return base::win::AddCommandToAutoRun( HKEY_CURRENT_USER, - base::UTF8ToWide(GetServiceProcessAutoRunKey()), + UTF8ToWide(GetServiceProcessAutoRunKey()), autorun_command_line_->GetCommandLineString()); } @@ -165,10 +164,9 @@ bool ServiceProcessState::RemoveFromAutoRun() { // Remove the old autorun value first because we changed the naming scheme // for the autorun value name. base::win::RemoveCommandFromAutoRun( - HKEY_CURRENT_USER, - base::UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); + HKEY_CURRENT_USER, UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); return base::win::RemoveCommandFromAutoRun( - HKEY_CURRENT_USER, base::UTF8ToWide(GetServiceProcessAutoRunKey())); + HKEY_CURRENT_USER, UTF8ToWide(GetServiceProcessAutoRunKey())); } void ServiceProcessState::TearDownState() { diff --git a/chrome/installer/gcapi/gcapi_last_run_test.cc b/chrome/installer/gcapi/gcapi_last_run_test.cc index 1897cf4..79fd835 100644 --- a/chrome/installer/gcapi/gcapi_last_run_test.cc +++ b/chrome/installer/gcapi/gcapi_last_run_test.cc @@ -27,7 +27,7 @@ class GCAPILastRunTest : public ::testing::Test { void SetUp() { // Override keys - this is undone during destruction. std::wstring hkcu_override = base::StringPrintf( - L"hkcu_override\\%ls", base::ASCIIToWide(base::GenerateGUID())); + L"hkcu_override\\%ls", ASCIIToWide(base::GenerateGUID())); override_manager_.OverrideRegistry(HKEY_CURRENT_USER, hkcu_override); // Create the client state key in the right places. diff --git a/chrome/installer/gcapi/gcapi_reactivation_test.cc b/chrome/installer/gcapi/gcapi_reactivation_test.cc index 07b788f..e8cc34d 100644 --- a/chrome/installer/gcapi/gcapi_reactivation_test.cc +++ b/chrome/installer/gcapi/gcapi_reactivation_test.cc @@ -38,10 +38,10 @@ class GCAPIReactivationTest : public ::testing::Test { void SetUp() { // Override keys - this is undone during destruction. std::wstring hkcu_override = base::StringPrintf( - L"hkcu_override\\%ls", base::ASCIIToWide(base::GenerateGUID())); + L"hkcu_override\\%ls", ASCIIToWide(base::GenerateGUID())); override_manager_.OverrideRegistry(HKEY_CURRENT_USER, hkcu_override); std::wstring hklm_override = base::StringPrintf( - L"hklm_override\\%ls", base::ASCIIToWide(base::GenerateGUID())); + L"hklm_override\\%ls", ASCIIToWide(base::GenerateGUID())); override_manager_.OverrideRegistry(HKEY_LOCAL_MACHINE, hklm_override); } diff --git a/chrome/installer/setup/chrome_frame_ready_mode.cc b/chrome/installer/setup/chrome_frame_ready_mode.cc index 62bcb64..c8a98c4 100644 --- a/chrome/installer/setup/chrome_frame_ready_mode.cc +++ b/chrome/installer/setup/chrome_frame_ready_mode.cc @@ -215,8 +215,7 @@ InstallStatus ChromeFrameReadyModeEndTempOptOut( HKEY root = installer_state.root_key(); std::wstring chrome_frame_ua_value_name(kChromeFramePrefix); - chrome_frame_ua_value_name += - base::ASCIIToWide(installed_version.GetString()); + chrome_frame_ua_value_name += ASCIIToWide(installed_version.GetString()); // Store the Chrome Frame user agent string item_list->AddSetRegValueWorkItem(root, kPostPlatformUAKey, diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc index 90297d2..5450e32 100644 --- a/chrome/installer/setup/install_worker.cc +++ b/chrome/installer/setup/install_worker.cc @@ -245,7 +245,7 @@ void AddCommandWithParameterWorkItems(const InstallerState& installer_state, if (installer_state.operation() == InstallerState::UNINSTALL) { work_item_list->AddDeleteRegKeyWorkItem( installer_state.root_key(), full_cmd_key)->set_log_message( - "removing " + base::WideToASCII(command_key) + " command"); + "removing " + WideToASCII(command_key) + " command"); } else { CommandLine cmd_line(installer_state.target_path().Append(app)); cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); @@ -750,16 +750,14 @@ void AddUninstallShortcutWorkItems(const InstallerState& installer_state, L"Publisher", browser_dist->GetPublisherName(), true); - install_list->AddSetRegValueWorkItem( - reg_root, uninstall_reg, - L"Version", - base::ASCIIToWide(new_version.GetString()), - true); - install_list->AddSetRegValueWorkItem( - reg_root, uninstall_reg, - L"DisplayVersion", - base::ASCIIToWide(new_version.GetString()), - true); + install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, + L"Version", + ASCIIToWide(new_version.GetString()), + true); + install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, + L"DisplayVersion", + ASCIIToWide(new_version.GetString()), + true); install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, L"InstallDate", InstallUtil::GetCurrentDate(), @@ -808,7 +806,7 @@ void AddVersionKeyWorkItems(HKEY root, } list->AddSetRegValueWorkItem(root, version_key, google_update::kRegVersionField, - base::ASCIIToWide(new_version.GetString()), + ASCIIToWide(new_version.GetString()), true); // overwrite version } @@ -1072,12 +1070,12 @@ bool AppendPostInstallTasks(const InstallerState& installer_state, if (current_version) { in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, google_update::kRegOldVersionField, - base::ASCIIToWide(current_version->GetString()), true); + ASCIIToWide(current_version->GetString()), true); } if (critical_version.IsValid()) { in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, google_update::kRegCriticalVersionField, - base::ASCIIToWide(critical_version.GetString()), true); + ASCIIToWide(critical_version.GetString()), true); } else { in_use_update_work_items->AddDeleteRegValueWorkItem(root, version_key, google_update::kRegCriticalVersionField); @@ -1684,7 +1682,7 @@ void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, // isn't installed since we don't want them left behind in any case. work_item_list->AddDeleteRegKeyWorkItem( installer_state.root_key(), cmd_key)->set_log_message( - "removing " + base::WideToASCII(kCmdQuickEnableCf) + " command"); + "removing " + WideToASCII(kCmdQuickEnableCf) + " command"); } else if (will_have_chrome_binaries) { // Chrome Frame isn't (to be) installed while some other multi-install diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc index b60a39d..9f112c0 100644 --- a/chrome/installer/setup/setup_util.cc +++ b/chrome/installer/setup/setup_util.cc @@ -138,7 +138,7 @@ Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path) { VLOG(1) << "directory found: " << find_data.cFileName; scoped_ptr<Version> found_version( - new Version(base::WideToASCII(find_data.cFileName))); + new Version(WideToASCII(find_data.cFileName))); if (found_version->IsValid() && found_version->CompareTo(*max_version.get()) > 0) { max_version.reset(found_version.release()); diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index b74e906..2458eef 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -191,7 +191,7 @@ void ClearRlzProductState() { // If chrome has been reactivated, clear all events for this brand as well. string16 reactivation_brand_wide; if (GoogleUpdateSettings::GetReactivationBrand(&reactivation_brand_wide)) { - std::string reactivation_brand(base::WideToASCII(reactivation_brand_wide)); + std::string reactivation_brand(WideToASCII(reactivation_brand_wide)); rlz_lib::SupplementaryBranding branding(reactivation_brand.c_str()); rlz_lib::ClearProductState(rlz_lib::CHROME, points); } diff --git a/chrome/installer/test/alternate_version_generator.cc b/chrome/installer/test/alternate_version_generator.cc index 02a866f..9e54561 100644 --- a/chrome/installer/test/alternate_version_generator.cc +++ b/chrome/installer/test/alternate_version_generator.cc @@ -669,7 +669,7 @@ bool GenerateAlternatePEFileVersion(const base::FilePath& original_file, return false; } - Version new_version(base::WideToASCII(ctx.new_version_str)); + Version new_version(WideToASCII(ctx.new_version_str)); GenerateSpecificPEFileVersion(original_file, target_file, new_version); return true; diff --git a/chrome/installer/util/auto_launch_util.cc b/chrome/installer/util/auto_launch_util.cc index 953b2d2..60ef370 100644 --- a/chrome/installer/util/auto_launch_util.cc +++ b/chrome/installer/util/auto_launch_util.cc @@ -62,7 +62,7 @@ string16 ProfileToKeyName(const string16& profile_directory) { crypto::SHA256HashString(input, hash, sizeof(hash)); std::string hash_string = base::HexEncode(hash, sizeof(hash)); return string16(kAutolaunchKeyValue) + - base::ASCIIToWide("_") + base::ASCIIToWide(hash_string); + ASCIIToWide("_") + ASCIIToWide(hash_string); } // Returns whether the Chrome executable specified in |application_path| is set diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc index bb58436..508ce8d 100644 --- a/chrome/installer/util/google_chrome_distribution.cc +++ b/chrome/installer/util/google_chrome_distribution.cc @@ -300,12 +300,12 @@ bool GoogleChromeDistribution::BuildUninstallMetricsString( iter.Advance()) { has_values = true; metrics->append(L"&"); - metrics->append(base::UTF8ToWide(iter.key())); + metrics->append(UTF8ToWide(iter.key())); metrics->append(L"="); std::string value; iter.value().GetAsString(&value); - metrics->append(base::UTF8ToWide(value)); + metrics->append(UTF8ToWide(value)); } return has_values; @@ -382,8 +382,7 @@ void GoogleChromeDistribution::DoPostUninstallOperations( iexplore = iexplore.AppendASCII("iexplore.exe"); string16 command = iexplore.value() + L" " + GetUninstallSurveyUrl() + - L"&" + kVersionParam + L"=" + - base::UTF8ToWide(version.GetString()) + L"&" + + L"&" + kVersionParam + L"=" + UTF8ToWide(version.GetString()) + L"&" + kOSParam + L"=" + os_version; string16 uninstall_metrics; @@ -661,18 +660,16 @@ bool GoogleChromeDistribution::GetExperimentDetails( string16 locale; GoogleUpdateSettings::GetLanguage(&locale); - if (locale.empty() || (locale == base::ASCIIToWide("en"))) - locale = base::ASCIIToWide("en-US"); + if (locale.empty() || (locale == ASCIIToWide("en"))) + locale = ASCIIToWide("en-US"); string16 brand; - if (!GoogleUpdateSettings::GetBrand(&brand)) { - // Could still be viable for catch-all rules. - brand = base::ASCIIToWide(""); - } + if (!GoogleUpdateSettings::GetBrand(&brand)) + brand = ASCIIToWide(""); // Could still be viable for catch-all rules. for (int i = 0; i < arraysize(kExperiments); ++i) { if (kExperiments[i].locale != locale && - kExperiments[i].locale != base::ASCIIToWide("*")) + kExperiments[i].locale != ASCIIToWide("*")) continue; std::vector<string16> brand_codes; @@ -811,7 +808,7 @@ void GoogleChromeDistribution::LaunchUserExperiment( cmd_line.AppendSwitchASCII(installer::switches::kInactiveUserToast, base::IntToString(flavor)); cmd_line.AppendSwitchASCII(installer::switches::kExperimentGroup, - base::WideToASCII(base_group)); + WideToASCII(base_group)); LaunchSetup(&cmd_line, product, system_level); } diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc index 6a1b7e3..4934a50 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -609,7 +609,7 @@ bool GoogleUpdateSettings::GetUpdateDetailForApp(bool system_install, (clientstate.ReadValue(google_update::kRegVersionField, &version) == ERROR_SUCCESS)) { product_found = true; - data->version = base::WideToASCII(version); + data->version = WideToASCII(version); data->last_success = base::Time::FromTimeT(dword_value); data->last_result = 0; data->last_error_code = 0; diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc index 3ba4955..0c02d71 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -225,7 +225,7 @@ void InstallUtil::GetChromeVersion(BrowserDistribution* dist, if (result == ERROR_SUCCESS && !version_str.empty()) { VLOG(1) << "Existing " << dist->GetAppShortCutName() << " version found " << version_str; - *version = Version(base::WideToASCII(version_str)); + *version = Version(WideToASCII(version_str)); } else { DCHECK_EQ(ERROR_FILE_NOT_FOUND, result); VLOG(1) << "No existing " << dist->GetAppShortCutName() @@ -251,7 +251,7 @@ void InstallUtil::GetCriticalUpdateVersion(BrowserDistribution* dist, if (result == ERROR_SUCCESS && !version_str.empty()) { VLOG(1) << "Critical Update version for " << dist->GetAppShortCutName() << " found " << version_str; - *version = Version(base::WideToASCII(version_str)); + *version = Version(WideToASCII(version_str)); } else { DCHECK_EQ(ERROR_FILE_NOT_FOUND, result); VLOG(1) << "No existing " << dist->GetAppShortCutName() diff --git a/chrome/installer/util/installation_state.cc b/chrome/installer/util/installation_state.cc index 7d99063..43c73ce 100644 --- a/chrome/installer/util/installation_state.cc +++ b/chrome/installer/util/installation_state.cc @@ -60,7 +60,7 @@ bool ProductState::Initialize(bool system_install, std::wstring version_str; if (key.ReadValue(google_update::kRegVersionField, &version_str) == ERROR_SUCCESS) { - version_.reset(new Version(base::WideToASCII(version_str))); + version_.reset(new Version(WideToASCII(version_str))); if (!version_->IsValid()) version_.reset(); } @@ -70,7 +70,7 @@ bool ProductState::Initialize(bool system_install, // only be accessible via InstallationState::GetNonVersionedProductState. if (key.ReadValue(google_update::kRegOldVersionField, &version_str) == ERROR_SUCCESS) { - old_version_.reset(new Version(base::WideToASCII(version_str))); + old_version_.reset(new Version(WideToASCII(version_str))); if (!old_version_->IsValid()) old_version_.reset(); } diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc index 87e14d80..66ffb24 100644 --- a/chrome/installer/util/installer_state.cc +++ b/chrome/installer/util/installer_state.cc @@ -599,7 +599,7 @@ bool InstallerState::IsChromeFrameRunning( base::FilePath InstallerState::GetInstallerDirectory( const Version& version) const { - return target_path().Append(base::ASCIIToWide(version.GetString())) + return target_path().Append(ASCIIToWide(version.GetString())) .Append(kInstallerDir); } @@ -628,7 +628,7 @@ void InstallerState::GetExistingExeVersions( if (file_version_info) { string16 version_string = file_version_info->file_version(); if (!version_string.empty() && IsStringASCII(version_string)) - existing_versions->insert(base::WideToASCII(version_string)); + existing_versions->insert(WideToASCII(version_string)); } } } @@ -656,7 +656,7 @@ void InstallerState::RemoveOldVersionDirectories( for (base::FilePath next_version = version_enum.Next(); !next_version.empty(); next_version = version_enum.Next()) { base::FilePath dir_name(next_version.BaseName()); - version = Version(base::WideToASCII(dir_name.value())); + version = Version(WideToASCII(dir_name.value())); // Delete the version folder if it is less than the new version and not // equal to the old version (if we have an old version). if (version.IsValid() && diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc index ca64c97..5395a84 100644 --- a/chrome/installer/util/installer_state_unittest.cc +++ b/chrome/installer/util/installer_state_unittest.cc @@ -276,9 +276,9 @@ TEST_F(InstallerStateTest, Basic) { EXPECT_FALSE(installer_dir.empty()); base::FilePath new_version_dir(installer_state.target_path().Append( - base::UTF8ToWide(new_version.GetString()))); + UTF8ToWide(new_version.GetString()))); base::FilePath old_version_dir(installer_state.target_path().Append( - base::UTF8ToWide(old_version.GetString()))); + UTF8ToWide(old_version.GetString()))); EXPECT_FALSE(file_util::PathExists(new_version_dir)); EXPECT_FALSE(file_util::PathExists(old_version_dir)); @@ -361,8 +361,7 @@ TEST_F(InstallerStateTest, WithProduct) { EXPECT_TRUE(chrome_key.Valid()); if (chrome_key.Valid()) { chrome_key.WriteValue(google_update::kRegVersionField, - base::UTF8ToWide( - current_version.GetString()).c_str()); + UTF8ToWide(current_version.GetString()).c_str()); machine_state.Initialize(); // TODO(tommi): Also test for when there exists a new_chrome.exe. Version found_version(*installer_state.GetCurrentVersion(machine_state)); @@ -533,12 +532,11 @@ TEST_F(InstallerStateTest, MAYBE_RemoveOldVersionDirs) { installer_state.target_path().Append(L"1.2.3.4"), installer_state.target_path().Append(L"1.2.3.5"), installer_state.target_path().Append(L"1.2.3.6"), - installer_state.target_path().Append(base::ASCIIToWide(kOldVersion)), - installer_state.target_path().Append( - base::ASCIIToWide(kOldChromeExeVersion)), + installer_state.target_path().Append(ASCIIToWide(kOldVersion)), + installer_state.target_path().Append(ASCIIToWide(kOldChromeExeVersion)), installer_state.target_path().Append(L"2.1.1.0"), - installer_state.target_path().Append(base::ASCIIToWide(kChromeExeVersion)), - installer_state.target_path().Append(base::ASCIIToWide(kNewVersion)), + installer_state.target_path().Append(ASCIIToWide(kChromeExeVersion)), + installer_state.target_path().Append(ASCIIToWide(kNewVersion)), installer_state.target_path().Append(L"3.9.1.1"), }; @@ -599,7 +597,7 @@ TEST_F(InstallerStateTest, MAYBE_RemoveOldVersionDirs) { for (base::FilePath next_version = version_enum.Next(); !next_version.empty(); next_version = version_enum.Next()) { base::FilePath dir_name(next_version.BaseName()); - Version version(base::WideToASCII(dir_name.value())); + Version version(WideToASCII(dir_name.value())); if (version.IsValid()) { EXPECT_TRUE(expected_remaining_dirs.erase(version.GetString())) << "Unexpected version dir found: " << version.GetString(); @@ -645,7 +643,7 @@ class InstallerStateCriticalVersionTest : public ::testing::Test { CommandLine::FromString(L"setup.exe") : CommandLine::FromString( L"setup.exe --critical-update-version=" + - base::ASCIIToWide(version->GetString())); + ASCIIToWide(version->GetString())); prefs_.reset(new MasterPreferences(cmd_line_)); machine_state_.Initialize(); installer_state_.Initialize(cmd_line_, *prefs_, machine_state_); diff --git a/chrome/installer/util/logging_installer.cc b/chrome/installer/util/logging_installer.cc index 16666c1..adc7801 100644 --- a/chrome/installer/util/logging_installer.cc +++ b/chrome/installer/util/logging_installer.cc @@ -117,7 +117,7 @@ base::FilePath GetLogFilePath(const installer::MasterPreferences& prefs) { std::string path; prefs.GetString(installer::master_preferences::kLogFile, &path); if (!path.empty()) { - return base::FilePath(base::UTF8ToWide(path)); + return base::FilePath(UTF8ToWide(path)); } std::wstring log_filename = prefs.install_chrome_frame() ? diff --git a/chrome/installer/util/move_tree_work_item_unittest.cc b/chrome/installer/util/move_tree_work_item_unittest.cc index 7a19007..bead46e 100644 --- a/chrome/installer/util/move_tree_work_item_unittest.cc +++ b/chrome/installer/util/move_tree_work_item_unittest.cc @@ -33,7 +33,7 @@ class MoveTreeWorkItemTest : public testing::Test { void CreateTextFile(const std::wstring& filename, const std::wstring& contents) { std::wofstream file; - file.open(base::WideToASCII(filename).c_str()); + file.open(WideToASCII(filename).c_str()); ASSERT_TRUE(file.is_open()); file << contents; file.close(); @@ -43,7 +43,7 @@ void CreateTextFile(const std::wstring& filename, std::wstring ReadTextFile(const base::FilePath& path) { WCHAR contents[64]; std::wifstream file; - file.open(base::WideToASCII(path.value()).c_str()); + file.open(WideToASCII(path.value()).c_str()); EXPECT_TRUE(file.is_open()); file.getline(contents, arraysize(contents)); file.close(); diff --git a/chrome/installer/util/product_unittest.cc b/chrome/installer/util/product_unittest.cc index 64b6f02..688af71 100644 --- a/chrome/installer/util/product_unittest.cc +++ b/chrome/installer/util/product_unittest.cc @@ -110,7 +110,7 @@ TEST_F(ProductTest, MAYBE_ProductInstallBasic) { const char kCurrentVersion[] = "1.2.3.4"; Version current_version(kCurrentVersion); version_key.WriteValue(google_update::kRegVersionField, - base::UTF8ToWide(current_version.GetString()).c_str()); + UTF8ToWide(current_version.GetString()).c_str()); // We started out with a non-msi product. machine_state.Initialize(); diff --git a/chrome/installer/util/self_cleaning_temp_dir_unittest.cc b/chrome/installer/util/self_cleaning_temp_dir_unittest.cc index faacea9..917ab3c 100644 --- a/chrome/installer/util/self_cleaning_temp_dir_unittest.cc +++ b/chrome/installer/util/self_cleaning_temp_dir_unittest.cc @@ -34,7 +34,7 @@ std::wstring GetRandomFilename() { // Replace the first digit with the letter 'R' (for "random", get it?). result[0] = 'R'; - return base::ASCIIToWide(result); + return ASCIIToWide(result); } } // namespace diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 17e1c0b..0bc6353 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -370,12 +370,11 @@ class RegistryEntry { // Note: not using CommandLine since it has ambiguous rules for quoting // strings. entries->push_back(new RegistryEntry(install_info, kReinstallCommand, - quoted_exe_path + L" --" + - base::ASCIIToWide(switches::kMakeDefaultBrowser))); + quoted_exe_path + L" --" + ASCIIToWide(switches::kMakeDefaultBrowser))); entries->push_back(new RegistryEntry(install_info, L"HideIconsCommand", - quoted_exe_path + L" --" + base::ASCIIToWide(switches::kHideIcons))); + quoted_exe_path + L" --" + ASCIIToWide(switches::kHideIcons))); entries->push_back(new RegistryEntry(install_info, L"ShowIconsCommand", - quoted_exe_path + L" --" + base::ASCIIToWide(switches::kShowIcons))); + quoted_exe_path + L" --" + ASCIIToWide(switches::kShowIcons))); entries->push_back(new RegistryEntry(install_info, L"IconsVisible", 1)); // Register with Default Programs. diff --git a/chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc b/chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc index 3c1209c..4a26fca 100644 --- a/chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc +++ b/chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc @@ -109,8 +109,8 @@ TEST_F(SpellCheckProviderTest, CancelUnnecessaryRequests) { // Test that the SpellCheckProvider class sends a request when it receives a // Russian word. const wchar_t kRussianWord[] = L"\x0431\x0451\x0434\x0440\x0430"; - provider_.RequestTextChecking(WebKit::WebString( - base::WideToUTF16(kRussianWord)), &completion); + provider_.RequestTextChecking(WebKit::WebString(WideToUTF16(kRussianWord)), + &completion); EXPECT_EQ(completion.completion_count_, 4U); EXPECT_EQ(completion.cancellation_count_, 2U); } diff --git a/chrome/renderer/spellchecker/spellcheck_unittest.cc b/chrome/renderer/spellchecker/spellcheck_unittest.cc index 2c7eac0..8a443a63 100644 --- a/chrome/renderer/spellchecker/spellcheck_unittest.cc +++ b/chrome/renderer/spellchecker/spellcheck_unittest.cc @@ -390,7 +390,7 @@ TEST_F(SpellCheckTest, SpellCheckStrings_EN_US) { int misspelling_start; int misspelling_length; bool result = spell_check()->SpellCheckWord( - base::WideToUTF16(kTestCases[i].input).c_str(), + WideToUTF16(kTestCases[i].input).c_str(), static_cast<int>(input_length), 0, &misspelling_start, @@ -441,7 +441,7 @@ TEST_F(SpellCheckTest, SpellCheckSuggestions_EN_US) { int misspelling_start; int misspelling_length; bool result = spell_check()->SpellCheckWord( - base::WideToUTF16(kTestCases[i].input).c_str(), + WideToUTF16(kTestCases[i].input).c_str(), static_cast<int>(input_length), 0, &misspelling_start, @@ -454,8 +454,8 @@ TEST_F(SpellCheckTest, SpellCheckSuggestions_EN_US) { // Check if the suggested words occur. bool suggested_word_is_present = false; for (int j = 0; j < static_cast<int>(suggestions.size()); j++) { - if (suggestions.at(j).compare(base::WideToUTF16( - kTestCases[i].suggested_word)) == 0) { + if (suggestions.at(j).compare(WideToUTF16(kTestCases[i].suggested_word)) + == 0) { suggested_word_is_present = true; break; } @@ -799,7 +799,7 @@ TEST_F(SpellCheckTest, SpellCheckText) { int misspelling_start = 0; int misspelling_length = 0; bool result = spell_check()->SpellCheckWord( - base::WideToUTF16(kTestCases[i].input).c_str(), + WideToUTF16(kTestCases[i].input).c_str(), static_cast<int>(input_length), 0, &misspelling_start, @@ -880,7 +880,7 @@ TEST_F(SpellCheckTest, MisspelledWords) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { ReinitializeSpellCheck(kTestCases[i].language); - string16 word(base::WideToUTF16(kTestCases[i].input)); + string16 word(WideToUTF16(kTestCases[i].input)); int word_length = static_cast<int>(word.length()); int misspelling_start = 0; int misspelling_length = 0; diff --git a/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc b/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc index 5bc250a..f8d316a 100644 --- a/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc +++ b/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc @@ -119,7 +119,7 @@ TEST(SpellcheckWordIteratorTest, SplitWord) { SpellcheckCharAttribute attributes; attributes.SetDefaultLanguage(kTestCases[i].language); - string16 input(base::WideToUTF16(kTestText)); + string16 input(WideToUTF16(kTestText)); SpellcheckWordIterator iterator; EXPECT_TRUE(iterator.Initialize(&attributes, kTestCases[i].allow_contraction)); @@ -127,7 +127,7 @@ TEST(SpellcheckWordIteratorTest, SplitWord) { std::vector<string16> expected_words; base::SplitString( - base::WideToUTF16(kTestCases[i].expected_words), ' ', &expected_words); + WideToUTF16(kTestCases[i].expected_words), ' ', &expected_words); string16 actual_word; int actual_start, actual_end; @@ -149,7 +149,7 @@ TEST(SpellcheckWordIteratorTest, RuleSetConsistency) { attributes.SetDefaultLanguage("en-US"); const wchar_t kTestText[] = L"\x1791\x17c1\x002e"; - string16 input(base::WideToUTF16(kTestText)); + string16 input(WideToUTF16(kTestText)); SpellcheckWordIterator iterator; EXPECT_TRUE(iterator.Initialize(&attributes, true)); @@ -214,7 +214,7 @@ TEST(SpellcheckWordIteratorTest, TreatNumbersAsWordCharacters) { SpellcheckCharAttribute attributes; attributes.SetDefaultLanguage(kTestCases[i].language); - string16 input_word(base::WideToUTF16(kTestCases[i].text)); + string16 input_word(WideToUTF16(kTestCases[i].text)); SpellcheckWordIterator iterator; EXPECT_TRUE(iterator.Initialize(&attributes, true)); EXPECT_TRUE(iterator.SetText(input_word.c_str(), input_word.length())); diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc index f2a0a75..903d192 100644 --- a/chrome/service/cloud_print/print_system_win.cc +++ b/chrome/service/cloud_print/print_system_win.cc @@ -119,7 +119,7 @@ HRESULT PrintTicketToDevMode(const std::string& printer_name, return hr; HPTPROVIDER provider = NULL; - hr = printing::XPSModule::OpenProvider(base::UTF8ToWide(printer_name), + hr = printing::XPSModule::OpenProvider(UTF8ToWide(printer_name), 1, &provider); if (SUCCEEDED(hr)) { @@ -178,7 +178,7 @@ class PrintSystemWatcherWin : public base::win::ObjectWatcher::Delegate { LPTSTR printer_name_to_use = NULL; std::wstring printer_name_wide; if (!printer_name.empty()) { - printer_name_wide = base::UTF8ToWide(printer_name); + printer_name_wide = UTF8ToWide(printer_name); printer_name_to_use = const_cast<LPTSTR>(printer_name_wide.c_str()); } bool ret = false; @@ -422,7 +422,7 @@ class PrintSystemWin : public PrintSystem { return false; } - HDC dc = CreateDC(L"WINSPOOL", base::UTF8ToWide(printer_name).c_str(), + HDC dc = CreateDC(L"WINSPOOL", UTF8ToWide(printer_name).c_str(), NULL, pt_dev_mode.dm_); if (!dc) { NOTREACHED(); @@ -602,8 +602,8 @@ class PrintSystemWin : public PrintSystem { bool ret = false; // Use nested SUCCEEDED checks because we want a common return point. if (SUCCEEDED(printing::XPSPrintModule::StartXpsPrintJob( - base::UTF8ToWide(printer_name).c_str(), - base::UTF8ToWide(job_title).c_str(), + UTF8ToWide(printer_name).c_str(), + UTF8ToWide(job_title).c_str(), NULL, job_progress_event_.Get(), NULL, @@ -789,7 +789,7 @@ bool PrintSystemWin::ValidatePrintTicket( } bool ret = false; HPTPROVIDER provider = NULL; - printing::XPSModule::OpenProvider(base::UTF8ToWide(printer_name.c_str()), + printing::XPSModule::OpenProvider(UTF8ToWide(printer_name.c_str()), 1, &provider); if (provider) { @@ -825,7 +825,7 @@ bool PrintSystemWin::GetJobDetails(const std::string& printer_name, print_backend_->GetPrinterDriverInfo(printer_name)); DCHECK(job_details); printing::ScopedPrinterHandle printer_handle; - std::wstring printer_name_wide = base::UTF8ToWide(printer_name); + std::wstring printer_name_wide = UTF8ToWide(printer_name); OpenPrinter(const_cast<LPTSTR>(printer_name_wide.c_str()), printer_handle.Receive(), NULL); DCHECK(printer_handle.IsValid()); @@ -843,7 +843,7 @@ bool PrintSystemWin::GetJobDetails(const std::string& printer_name, JOB_INFO_1 *job_info = reinterpret_cast<JOB_INFO_1 *>(job_info_buffer.get()); if (job_info->pStatus) { - base::WideToUTF8(job_info->pStatus, wcslen(job_info->pStatus), + WideToUTF8(job_info->pStatus, wcslen(job_info->pStatus), &job_details->status_message); } job_details->platform_status_flags = job_info->Status; diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc index b9de5c0..4d2c9f6 100644 --- a/chrome/test/automation/proxy_launcher.cc +++ b/chrome/test/automation/proxy_launcher.cc @@ -443,7 +443,7 @@ bool ProxyLauncher::LaunchBrowserHelper(const LaunchState& state, const char* browser_wrapper = getenv("BROWSER_WRAPPER"); if (browser_wrapper) { #if defined(OS_WIN) - command_line.PrependWrapper(base::ASCIIToWide(browser_wrapper)); + command_line.PrependWrapper(ASCIIToWide(browser_wrapper)); #elif defined(OS_POSIX) command_line.PrependWrapper(browser_wrapper); #endif diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index 81384d1..a883070 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -61,7 +61,7 @@ int TabProxy::FindInPage(const std::wstring& search_string, return -1; AutomationMsg_Find_Params params; - params.search_string = base::WideToUTF16Hack(search_string); + params.search_string = WideToUTF16Hack(search_string); params.find_next = find_next; params.match_case = (match_case == CASE_SENSITIVE); params.forward = (forward == FWD); @@ -182,7 +182,7 @@ bool TabProxy::ExecuteAndExtractString(const std::wstring& frame_xpath, succeeded = value->GetAsString(&read_value); if (succeeded) { // TODO(viettrungluu): remove conversion. (But should |jscript| be UTF-8?) - *string_value = base::UTF16ToWideHack(read_value); + *string_value = UTF16ToWideHack(read_value); } } return succeeded; diff --git a/chrome/test/chromedriver/chrome_finder.cc b/chrome/test/chromedriver/chrome_finder.cc index f08d3a73..4a6e420 100644 --- a/chrome/test/chromedriver/chrome_finder.cc +++ b/chrome/test/chromedriver/chrome_finder.cc @@ -29,7 +29,7 @@ void GetApplicationDirs(std::vector<base::FilePath>* locations) { scoped_ptr<base::Environment> env(base::Environment::Create()); std::string home_dir; if (env->GetVar("userprofile", &home_dir)) { - base::FilePath default_location(base::UTF8ToWide(home_dir)); + base::FilePath default_location(UTF8ToWide(home_dir)); if (base::win::GetVersion() < base::win::VERSION_VISTA) { default_location = default_location.Append( L"Local Settings\\Application Data"); @@ -42,9 +42,9 @@ void GetApplicationDirs(std::vector<base::FilePath>* locations) { // Add the system-level location. std::string program_dir; if (env->GetVar("ProgramFiles", &program_dir)) - locations->push_back(base::FilePath(base::UTF8ToWide(program_dir))); + locations->push_back(base::FilePath(UTF8ToWide(program_dir))); if (env->GetVar("ProgramFiles(x86)", &program_dir)) - locations->push_back(base::FilePath(base::UTF8ToWide(program_dir))); + locations->push_back(base::FilePath(UTF8ToWide(program_dir))); } #elif defined(OS_LINUX) void GetApplicationDirs(std::vector<base::FilePath>* locations) { diff --git a/chrome/test/chromedriver/key_converter_unittest.cc b/chrome/test/chromedriver/key_converter_unittest.cc index 48f801b..fbf63d7 100644 --- a/chrome/test/chromedriver/key_converter_unittest.cc +++ b/chrome/test/chromedriver/key_converter_unittest.cc @@ -152,10 +152,9 @@ TEST(KeyConverter, WebDriverSpecialNonCharKey) { TEST(KeyConverter, FrenchKeyOnEnglishLayout) { KeyEvent event_array[] = { CreateKeyDownEvent(ui::VKEY_UNKNOWN, 0), - CreateCharEvent(base::WideToUTF8(L"\u00E9"), - base::WideToUTF8(L"\u00E9"), 0), + CreateCharEvent(WideToUTF8(L"\u00E9"), WideToUTF8(L"\u00E9"), 0), CreateKeyUpEvent(ui::VKEY_UNKNOWN, 0)}; - CheckEventsReleaseModifiers(base::WideToUTF16(L"\u00E9"), + CheckEventsReleaseModifiers(WideToUTF16(L"\u00E9"), event_array, arraysize(event_array)); } diff --git a/chrome/test/chromedriver/keycode_text_conversion_unittest.cc b/chrome/test/chromedriver/keycode_text_conversion_unittest.cc index f8dca60..9fa8dbc 100644 --- a/chrome/test/chromedriver/keycode_text_conversion_unittest.cc +++ b/chrome/test/chromedriver/keycode_text_conversion_unittest.cc @@ -30,7 +30,7 @@ void CheckCharToKeyCode(char character, ui::KeyboardCode key_code, void CheckCantConvertChar(wchar_t character) { std::wstring character_string; character_string.push_back(character); - char16 character_utf16 = base::WideToUTF16(character_string)[0]; + char16 character_utf16 = WideToUTF16(character_string)[0]; ui::KeyboardCode actual_key_code = ui::VKEY_UNKNOWN; int actual_modifiers = 0; EXPECT_FALSE(ConvertCharToKeyCode( diff --git a/chrome/test/chromedriver/keycode_text_conversion_win.cc b/chrome/test/chromedriver/keycode_text_conversion_win.cc index 3fdb2ce..5a0c67e 100644 --- a/chrome/test/chromedriver/keycode_text_conversion_win.cc +++ b/chrome/test/chromedriver/keycode_text_conversion_win.cc @@ -29,7 +29,7 @@ std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) { return ""; } else { std::string text; - base::WideToUTF8(chars, code, &text); + WideToUTF8(chars, code, &text); return text; } } diff --git a/chrome/test/chromedriver/test_util.cc b/chrome/test/chromedriver/test_util.cc index 2e90b91..a2061e6 100644 --- a/chrome/test/chromedriver/test_util.cc +++ b/chrome/test/chromedriver/test_util.cc @@ -30,7 +30,7 @@ RestoreKeyboardLayoutOnDestruct::~RestoreKeyboardLayoutOnDestruct() { #if defined(OS_WIN) bool SwitchKeyboardLayout(const std::string& input_locale_identifier) { HKL layout = LoadKeyboardLayout( - base::UTF8ToWide(input_locale_identifier).c_str(), 0); + UTF8ToWide(input_locale_identifier).c_str(), 0); if (!layout) return false; return !!ActivateKeyboardLayout(layout, 0); diff --git a/chrome/test/perf/dom_checker_uitest.cc b/chrome/test/perf/dom_checker_uitest.cc index 285081a..f4db35a 100644 --- a/chrome/test/perf/dom_checker_uitest.cc +++ b/chrome/test/perf/dom_checker_uitest.cc @@ -167,7 +167,7 @@ class DomCheckerTest : public UITest { if (!succeeded) return false; - std::string json = base::WideToUTF8(json_wide); + std::string json = WideToUTF8(json_wide); JSONStringValueSerializer deserializer(json); scoped_ptr<Value> value(deserializer.Deserialize(NULL, NULL)); diff --git a/chrome/test/perf/frame_rate/frame_rate_tests.cc b/chrome/test/perf/frame_rate/frame_rate_tests.cc index 17716e4..7be2b36 100644 --- a/chrome/test/perf/frame_rate/frame_rate_tests.cc +++ b/chrome/test/perf/frame_rate/frame_rate_tests.cc @@ -231,7 +231,7 @@ class FrameRateTest &json)); std::map<std::string, std::string> results; - ASSERT_TRUE(JsonDictionaryToMap(base::WideToUTF8(json), &results)); + ASSERT_TRUE(JsonDictionaryToMap(WideToUTF8(json), &results)); ASSERT_TRUE(results.find("mean") != results.end()); ASSERT_TRUE(results.find("sigma") != results.end()); diff --git a/chrome/test/perf/indexeddb_uitest.cc b/chrome/test/perf/indexeddb_uitest.cc index ec6246a..787f2bf1 100644 --- a/chrome/test/perf/indexeddb_uitest.cc +++ b/chrome/test/perf/indexeddb_uitest.cc @@ -72,7 +72,7 @@ class IndexedDBTest : public UIPerfTest { if (!succeeded) return false; - std::string json = base::WideToUTF8(json_wide); + std::string json = WideToUTF8(json_wide); return JsonDictionaryToMap(json, results); } diff --git a/chrome/test/perf/page_cycler_test.cc b/chrome/test/perf/page_cycler_test.cc index 61c02a2..1c07a89 100644 --- a/chrome/test/perf/page_cycler_test.cc +++ b/chrome/test/perf/page_cycler_test.cc @@ -205,7 +205,7 @@ class PageCyclerTest : public UIPerfTest { std::string cookie; ASSERT_TRUE(tab->GetCookieByName(test_url, "__pc_pages", &cookie)); - pages->assign(base::UTF8ToWide(cookie)); + pages->assign(UTF8ToWide(cookie)); ASSERT_FALSE(pages->empty()); // Wait for the report.html to be loaded. @@ -279,7 +279,7 @@ class PageCyclerTest : public UIPerfTest { L"window.domAutomationController.send(" L"window.domAutomationController.getHistogram ? " L"window.domAutomationController.getHistogram(\"" + - base::Sysbase::UTF8ToWide(name) + L"\") : '')", + base::SysUTF8ToWide(name) + L"\") : '')", &whistogram)); std::string histogram = base::SysWideToNativeMB(whistogram); printf("HISTOGRAM %s: %s = %s %s\n", diff --git a/chrome/test/perf/startup_test.cc b/chrome/test/perf/startup_test.cc index 69138ff..c190a34 100644 --- a/chrome/test/perf/startup_test.cc +++ b/chrome/test/perf/startup_test.cc @@ -119,7 +119,7 @@ class StartupTest : public UIPerfTest { // Make sure temp directory has the proper format for writing to prefs file. #if defined(OS_POSIX) - std::wstring user_data_dir_w(base::ASCIIToWide(user_data_dir().value())); + std::wstring user_data_dir_w(ASCIIToWide(user_data_dir().value())); #elif defined(OS_WIN) std::wstring user_data_dir_w(user_data_dir().value()); // In Windows, the FilePath will write '\' for the path separators; change @@ -130,7 +130,7 @@ class StartupTest : public UIPerfTest { // Rewrite prefs file. std::vector<string16> subst; - subst.push_back(base::WideToUTF16(user_data_dir_w)); + subst.push_back(WideToUTF16(user_data_dir_w)); const std::string prefs_string = UTF16ToASCII(ReplaceStringPlaceholders(format_string, subst, NULL)); EXPECT_TRUE(file_util::WriteFile(pref_path, prefs_string.c_str(), diff --git a/chrome/test/perf/tab_switching_test.cc b/chrome/test/perf/tab_switching_test.cc index d2f249c..45a0891 100644 --- a/chrome/test/perf/tab_switching_test.cc +++ b/chrome/test/perf/tab_switching_test.cc @@ -50,8 +50,7 @@ class TabSwitchingUITest : public UIPerfTest { // Set the log file path for the browser test. scoped_ptr<base::Environment> env(base::Environment::Create()); #if defined(OS_WIN) - env->SetVar(env_vars::kLogFileName, - base::WideToUTF8(log_file_name_.value())); + env->SetVar(env_vars::kLogFileName, WideToUTF8(log_file_name_.value())); #else env->SetVar(env_vars::kLogFileName, log_file_name_.value()); #endif diff --git a/chrome/test/perf/url_fetch_test.cc b/chrome/test/perf/url_fetch_test.cc index 2b77ffd..4a88f29 100644 --- a/chrome/test/perf/url_fetch_test.cc +++ b/chrome/test/perf/url_fetch_test.cc @@ -67,8 +67,8 @@ class UrlFetchTest : public UIPerfTest { } else if (!wait_js_expr.empty()) { bool completed = WaitUntilJavaScriptCondition( tab.get(), - base::UTF8ToWide(wait_js_frame_xpath), - base::UTF8ToWide(wait_js_expr), + UTF8ToWide(wait_js_frame_xpath), + UTF8ToWide(wait_js_expr), wait_js_timeout); ASSERT_TRUE(completed); } @@ -77,10 +77,10 @@ class UrlFetchTest : public UIPerfTest { "window.domAutomationController.send(%s);", var_to_fetch); std::wstring value; - bool success = tab->ExecuteAndExtractString(L"", - base::ASCIIToWide(script), &value); + bool success = tab->ExecuteAndExtractString(L"", ASCIIToWide(script), + &value); ASSERT_TRUE(success); - result->javascript_variable = base::WideToUTF8(value); + result->javascript_variable = WideToUTF8(value); } } }; diff --git a/chrome/test/pyautolib/pyautolib.cc b/chrome/test/pyautolib/pyautolib.cc index cb65a9a..7724f6f 100644 --- a/chrome/test/pyautolib/pyautolib.cc +++ b/chrome/test/pyautolib/pyautolib.cc @@ -44,7 +44,7 @@ void PyUITestSuiteBase::SetCrSourceRoot(const base::FilePath& path) { PyUITestBase::PyUITestBase(bool clear_profile, std::wstring homepage) : UITestBase() { set_clear_profile(clear_profile); - set_homepage(base::WideToASCII(homepage)); + set_homepage(WideToASCII(homepage)); // We add this so that pyauto can execute javascript in the renderer and // read values back. dom_automation_enabled_ = true; diff --git a/chrome/test/reliability/automated_ui_tests.cc b/chrome/test/reliability/automated_ui_tests.cc index 0e8f81a..2c371c4 100644 --- a/chrome/test/reliability/automated_ui_tests.cc +++ b/chrome/test/reliability/automated_ui_tests.cc @@ -113,7 +113,7 @@ std::string GetChromeRevision() { scoped_ptr<FileVersionInfo> file_info; file_info.reset( FileVersionInfo::CreateFileVersionInfo(base::FilePath(kChromeDll))); - last_change = base::WideToASCII(file_info->last_change()); + last_change = WideToASCII(file_info->last_change()); #elif defined(OS_POSIX) chrome::VersionInfo version_info; last_change = version_info.LastChange(); @@ -717,7 +717,7 @@ void AutomatedUITest::LogCrashResult(const base::FilePath& crash_dump, xml_writer_.AddAttribute("revision", GetChromeRevision()); xml_writer_.StartElement("crash"); #if defined(OS_WIN) - xml_writer_.AddAttribute("crash_dump", base::WideToASCII(crash_dump.value())); + xml_writer_.AddAttribute("crash_dump", WideToASCII(crash_dump.value())); #else xml_writer_.AddAttribute("crash_dump", crash_dump.value()); #endif diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index e8afea6..18d78e3 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -307,7 +307,7 @@ class PageLoadTest : public UITest { scoped_ptr<FileVersionInfo> file_info; file_info.reset( FileVersionInfo::CreateFileVersionInfo(base::FilePath(kChromeDll))); - last_change = base::WideToASCII(file_info->last_change()); + last_change = WideToASCII(file_info->last_change()); #elif defined(OS_POSIX) // TODO(fmeawad): On Mac, the version retrieved here belongs to the test // module and not the chrome binary, need to be changed to chrome binary diff --git a/chrome/test/webdriver/commands/file_upload_command.cc b/chrome/test/webdriver/commands/file_upload_command.cc index bffd47b..4469147 100644 --- a/chrome/test/webdriver/commands/file_upload_command.cc +++ b/chrome/test/webdriver/commands/file_upload_command.cc @@ -54,7 +54,7 @@ void FileUploadCommand::ExecutePost(Response* const response) { } #if defined(OS_WIN) - response->SetValue(new base::StringValue(base::WideToUTF8(upload.value()))); + response->SetValue(new base::StringValue(WideToUTF8(upload.value()))); #else response->SetValue(new base::StringValue(upload.value())); #endif diff --git a/chrome/test/webdriver/keycode_text_conversion_unittest.cc b/chrome/test/webdriver/keycode_text_conversion_unittest.cc index ccc99e5..35dd538 100644 --- a/chrome/test/webdriver/keycode_text_conversion_unittest.cc +++ b/chrome/test/webdriver/keycode_text_conversion_unittest.cc @@ -34,7 +34,7 @@ void CheckCharToKeyCode(char character, ui::KeyboardCode key_code, void CheckCantConvertChar(wchar_t character) { std::wstring character_string; character_string.push_back(character); - char16 character_utf16 = base::WideToUTF16(character_string)[0]; + char16 character_utf16 = WideToUTF16(character_string)[0]; ui::KeyboardCode actual_key_code = ui::VKEY_UNKNOWN; int actual_modifiers = 0; EXPECT_FALSE(ConvertCharToKeyCode( diff --git a/chrome/test/webdriver/keycode_text_conversion_win.cc b/chrome/test/webdriver/keycode_text_conversion_win.cc index 85113d0..180c923 100644 --- a/chrome/test/webdriver/keycode_text_conversion_win.cc +++ b/chrome/test/webdriver/keycode_text_conversion_win.cc @@ -31,7 +31,7 @@ std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) { return ""; } else { std::string text; - base::WideToUTF8(chars, code, &text); + WideToUTF8(chars, code, &text); return text; } } diff --git a/chrome/test/webdriver/webdriver_automation.cc b/chrome/test/webdriver/webdriver_automation.cc index 083bf18..f604d78 100644 --- a/chrome/test/webdriver/webdriver_automation.cc +++ b/chrome/test/webdriver/webdriver_automation.cc @@ -129,7 +129,7 @@ bool GetDefaultChromeExe(base::FilePath* browser_exe) { scoped_ptr<base::Environment> env(base::Environment::Create()); std::string home_dir; if (env->GetVar("userprofile", &home_dir)) { - base::FilePath default_location(base::UTF8ToWide(home_dir)); + base::FilePath default_location(UTF8ToWide(home_dir)); if (base::win::GetVersion() < base::win::VERSION_VISTA) { default_location = default_location.Append( L"Local Settings\\Application Data"); @@ -143,15 +143,15 @@ bool GetDefaultChromeExe(base::FilePath* browser_exe) { // Add the system-level location for Chrome. std::string program_dir; if (env->GetVar("ProgramFiles", &program_dir)) { - locations.push_back(base::FilePath(base::UTF8ToWide(program_dir)) + locations.push_back(base::FilePath(UTF8ToWide(program_dir)) .Append(app_from_google)); - chromium_locations.push_back(base::FilePath(base::UTF8ToWide(program_dir)) + chromium_locations.push_back(base::FilePath(UTF8ToWide(program_dir)) .Append(app_from_chromium)); } if (env->GetVar("ProgramFiles(x86)", &program_dir)) { - locations.push_back(base::FilePath(base::UTF8ToWide(program_dir)) + locations.push_back(base::FilePath(UTF8ToWide(program_dir)) .Append(app_from_google)); - chromium_locations.push_back(base::FilePath(base::UTF8ToWide(program_dir)) + chromium_locations.push_back(base::FilePath(UTF8ToWide(program_dir)) .Append(app_from_chromium)); } #elif defined(OS_MACOSX) @@ -450,7 +450,7 @@ void Automation::Init( if (channel_id.empty()) { std::string command_line_str; #if defined(OS_WIN) - command_line_str = base::WideToUTF8(command.GetCommandLineString()); + command_line_str = WideToUTF8(command.GetCommandLineString()); #elif defined(OS_POSIX) command_line_str = command.GetCommandLineString(); #endif diff --git a/chrome/test/webdriver/webdriver_key_converter_unittest.cc b/chrome/test/webdriver/webdriver_key_converter_unittest.cc index 4080359..f36100b 100644 --- a/chrome/test/webdriver/webdriver_key_converter_unittest.cc +++ b/chrome/test/webdriver/webdriver_key_converter_unittest.cc @@ -140,10 +140,9 @@ TEST(WebDriverKeyConverter, WebDriverSpecialNonCharKey) { TEST(WebDriverKeyConverter, FrenchKeyOnEnglishLayout) { WebKeyEvent event_array[] = { CreateKeyDownEvent(ui::VKEY_UNKNOWN, 0), - CreateCharEvent(base::WideToUTF8(L"\u00E9"), - base::WideToUTF8(L"\u00E9"), 0), + CreateCharEvent(WideToUTF8(L"\u00E9"), WideToUTF8(L"\u00E9"), 0), CreateKeyUpEvent(ui::VKEY_UNKNOWN, 0)}; - CheckEventsReleaseModifiers(base::WideToUTF16(L"\u00E9"), + CheckEventsReleaseModifiers(WideToUTF16(L"\u00E9"), event_array, arraysize(event_array)); } diff --git a/chrome/test/webdriver/webdriver_test_util.cc b/chrome/test/webdriver/webdriver_test_util.cc index 6e00d42..ce464b1 100644 --- a/chrome/test/webdriver/webdriver_test_util.cc +++ b/chrome/test/webdriver/webdriver_test_util.cc @@ -32,7 +32,7 @@ RestoreKeyboardLayoutOnDestruct::~RestoreKeyboardLayoutOnDestruct() { #if defined(OS_WIN) bool SwitchKeyboardLayout(const std::string& input_locale_identifier) { HKL layout = LoadKeyboardLayout( - base::UTF8ToWide(input_locale_identifier).c_str(), 0); + UTF8ToWide(input_locale_identifier).c_str(), 0); if (!layout) return false; return !!ActivateKeyboardLayout(layout, 0); diff --git a/chrome/tools/convert_dict/aff_reader.cc b/chrome/tools/convert_dict/aff_reader.cc index 1a84e32..6b419ab 100644 --- a/chrome/tools/convert_dict/aff_reader.cc +++ b/chrome/tools/convert_dict/aff_reader.cc @@ -139,7 +139,7 @@ bool AffReader::EncodingToUTF8(const std::string& encoded, if (!base::CodepageToWide(encoded, encoding(), base::OnStringConversionError::FAIL, &wide_word)) return false; - *utf8 = base::WideToUTF8(wide_word); + *utf8 = WideToUTF8(wide_word); return true; } diff --git a/chrome/tools/convert_dict/convert_dict_unittest.cc b/chrome/tools/convert_dict/convert_dict_unittest.cc index a7995d7..17ce2ce 100644 --- a/chrome/tools/convert_dict/convert_dict_unittest.cc +++ b/chrome/tools/convert_dict/convert_dict_unittest.cc @@ -151,8 +151,8 @@ TEST(ConvertDictTest, English) { std::map<string16, bool> word_list; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) - word_list.insert(std::make_pair<string16, bool>( - base::WideToUTF16(kWords[i]), true)); + word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]), + true)); RunDictionaryTest(kCodepage, word_list); } @@ -173,8 +173,8 @@ TEST(ConvertDictTest, Russian) { std::map<string16, bool> word_list; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) - word_list.insert(std::make_pair<string16, bool>( - base::WideToUTF16(kWords[i]), true)); + word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]), + true)); RunDictionaryTest(kCodepage, word_list); } @@ -197,8 +197,8 @@ TEST(ConvertDictTest, Hungarian) { std::map<string16, bool> word_list; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) - word_list.insert(std::make_pair<string16, bool>( - base::WideToUTF16(kWords[i]), true)); + word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]), + true)); RunDictionaryTest(kCodepage, word_list); } diff --git a/chrome/tools/ipclist/ipcfuzz.cc b/chrome/tools/ipclist/ipcfuzz.cc index 93764f1..0eafb14 100644 --- a/chrome/tools/ipclist/ipcfuzz.cc +++ b/chrome/tools/ipclist/ipcfuzz.cc @@ -189,8 +189,8 @@ class DefaultFuzzer : public IPC::Fuzzer { virtual void FuzzString16(string16* value) OVERRIDE { FuzzStringType<string16>(value, frequency_, - base::WideToUTF16(L"BORKED"), - base::WideToUTF16(L"")); + WideToUTF16(L"BORKED"), + WideToUTF16(L"")); } virtual void FuzzData(char* data, int length) OVERRIDE { |