Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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: http://src.chromium.org/svn/trunk/src/chrome/browser@184355 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
  • Loading branch information...
commit 1901e1ca5deba54bc9028daf2603afb3c742cf0a 1 parent 3176c61
brettw@chromium.org authored
Showing with 289 additions and 314 deletions.
  1. +2 −2 about_flags_unittest.cc
  2. +1 −1  accessibility/accessibility_win_browsertest.cc
  3. +4 −5 autocomplete/autocomplete_input_unittest.cc
  4. +3 −4 autocomplete/history_url_provider_unittest.cc
  5. +0 −1  autofill/autofill_browsertest.cc
  6. +3 −4 automation/testing_automation_provider.cc
  7. +1 −1  bookmarks/bookmark_index_unittest.cc
  8. +1 −1  bookmarks/bookmark_model_unittest.cc
  9. +8 −8 bookmarks/bookmark_utils_unittest.cc
  10. +3 −3 browser_keyevents_browsertest.cc
  11. +2 −2 chrome_browser_main.cc
  12. +1 −1  chromeos/login/version_info_updater.cc
  13. +3 −3 chromeos/login/wizard_controller_browsertest.cc
  14. +1 −1  crash_upload_list_win.cc
  15. +3 −3 diagnostics/diagnostics_main.cc
  16. +1 −1  download/download_extensions.cc
  17. +2 −2 download/download_prefs.cc
  18. +1 −1  download/save_package_file_picker.cc
  19. +17 −17 enumerate_modules_model_win.cc
  20. +2 −2 extensions/api/developer_private/developer_private_api.cc
  21. +1 −1  extensions/api/file_system/file_system_api.cc
  22. +1 −1  extensions/api/file_system/file_system_api_unittest.cc
  23. +1 −1  extensions/api/serial/serial_port_enumerator_win.cc
  24. +1 −2  extensions/api/system_info_storage/storage_info_provider_win.cc
  25. +1 −1  extensions/api/tabs/tabs_api.cc
  26. +1 −1  extensions/app_notification_storage.cc
  27. +4 −5 extensions/browser_action_apitest.cc
  28. +1 −1  extensions/extension_prefs.cc
  29. +2 −2 extensions/external_pref_loader.cc
  30. +6 −6 extensions/external_registry_loader_win.cc
  31. +3 −3 extensions/page_action_browsertest.cc
  32. +1 −1  extensions/sandboxed_unpacker.cc
  33. +1 −1  first_run/first_run_posix.cc
  34. +2 −3 first_run/first_run_win.cc
  35. +1 −1  first_run/upgrade_util_win.cc
  36. +1 −1  google/google_update_settings_posix.cc
  37. +2 −2 google/google_util.cc
  38. +1 −1  google_apis/gdata_wapi_parser.cc
  39. +3 −3 history/history_publisher_win.cc
  40. +1 −1  history/in_memory_database.cc
  41. +4 −4 history/query_parser_unittest.cc
  42. +1 −1  history/thumbnail_database.cc
  43. +1 −1  importer/firefox3_importer.cc
  44. +14 −14 importer/firefox_importer_unittest.cc
  45. +2 −2 importer/firefox_importer_utils.cc
  46. +4 −4 importer/ie_importer.cc
  47. +2 −2 importer/importer_unittest_utils.cc
  48. +10 −10 instant/instant_browsertest.cc
  49. +6 −7 jumplist_win.cc
  50. +1 −2  media_gallery/media_galleries_preferences_unittest.cc
  51. +2 −2 memory_details_win.cc
  52. +4 −4 net/url_fixer_upper.cc
  53. +3 −3 net/url_fixer_upper_unittest.cc
  54. +1 −1  parsers/metadata_parser_filebase.cc
  55. +2 −2 parsers/metadata_parser_filebase_unittest.cc
  56. +1 −1  parsers/metadata_parser_jpeg_factory.cc
  57. +5 −5 password_manager/password_form_data.cc
  58. +1 −1  password_manager/password_store_default_unittest.cc
  59. +13 −13 password_manager/password_store_mac_unittest.cc
  60. +2 −3 password_manager/password_store_win.cc
  61. +1 −1  password_manager/password_store_x_unittest.cc
  62. +7 −11 performance_monitor/database.cc
  63. +1 −1  platform_util_win.cc
  64. +1 −1  plugins/plugin_finder.cc
  65. +1 −1  policy/browser_policy_connector.cc
  66. +1 −1  policy/policy_loader_win_unittest.cc
  67. +1 −1  policy/policy_path_parser_win.cc
  68. +4 −4 printing/print_dialog_cloud.cc
  69. +4 −4 printing/printing_layout_browsertest.cc
  70. +2 −2 process_singleton_linux.cc
  71. +2 −2 search_engines/template_url_prepopulate_data.cc
  72. +4 −5 search_engines/template_url_unittest.cc
  73. +1 −1  speech/tts_win.cc
  74. +1 −1  sync/glue/bookmark_change_processor.cc
  75. +2 −2 sync/glue/generic_change_processor.cc
  76. +1 −1  sync/glue/session_model_associator.cc
  77. +2 −2 sync/glue/synced_device_tracker.cc
  78. +1 −1  sync/glue/tab_node_pool.cc
  79. +1 −1  sync/glue/typed_url_change_processor.cc
  80. +1 −1  sync/glue/typed_url_model_associator.cc
  81. +8 −8 sync/profile_sync_service_bookmark_unittest.cc
  82. +8 −9 sync/test/integration/bookmarks_helper.cc
  83. +2 −2 sync/test/integration/two_client_autofill_sync_test.cc
  84. +1 −1  ui/browser.cc
  85. +13 −17 ui/find_bar/find_bar_host_browsertest.cc
  86. +1 −2  ui/omnibox/omnibox_view_browsertest.cc
  87. +1 −1  ui/startup/startup_browser_creator_impl.cc
  88. +5 −5 ui/views/about_ipc_dialog.cc
  89. +12 −12 ui/views/accessibility/browser_views_accessibility_browsertest.cc
  90. +4 −4 ui/views/bookmarks/bookmark_editor_view_unittest.cc
  91. +1 −1  ui/views/extensions/native_app_window_views.cc
  92. +3 −4 ui/views/external_protocol_dialog.cc
  93. +3 −3 ui/views/external_tab_container_win.cc
  94. +1 −1  ui/views/frame/browser_frame_win.cc
  95. +2 −3 ui/views/panels/panel_stack_view.cc
  96. +2 −3 ui/views/panels/panel_view.cc
  97. +1 −2  ui/web_applications/web_app_ui.cc
  98. +1 −1  ui/webui/extensions/install_extension_handler.cc
  99. +2 −2 ui/webui/extensions/pack_extension_handler.cc
  100. +1 −1  ui/webui/fileicon_source.cc
  101. +2 −2 ui/webui/version_ui.cc
  102. +1 −1  value_store/leveldb_value_store.cc
  103. +2 −2 webdata/logins_table_win.cc
View
4 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));
View
2  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;
View
9 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/"),
View
7 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);
}
View
1  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;
View
7 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());
}
View
2  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;
View
2  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/");
View
16 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()));
}
View
6 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) {
View
4 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
View
2  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);
}
View
6 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);
}
View
2  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)));
}
}
View
6 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_;
View
2  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
View
4 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 + ":";
}
View
2  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.
View
34 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),
View
4 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()) {
View
2  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
View
2  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
View
2  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;
View
3  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);
}
}
View
2  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);
}
View
2  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;
View
9 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());
}
View
2  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,
View
4 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();
View
12 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);
View
6 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());
View
2  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.
View
2  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";
View
5 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";
}
}
View
2  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;
View
2  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);
}
View
4 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;
}
View
2  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
View
6 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) {
View
2  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;
View
8 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.
View
2  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()) {
View
2  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
View
28 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);
View
4 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)));
}
}
}
View
8 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.
View
4 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;
View
20 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
View
13 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));
View
3  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
View
4 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++) {
View
8 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
View
6 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
View
2  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();
View
4 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)
}
View
2  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
View
10 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;
}
View
2  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),
View
26 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 {
View
5 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;
View
2  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),
View
18 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
}
View
2  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())
View
2  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
}
View
2  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;
}
View
2  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";
View
2  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,
View
8 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
View
8 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 << "\"";
View
4 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));
View
4 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);
}
View
9 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"),
View
2  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;
View
2  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());
View
4 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(
View
2  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();
View
4 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()));
}
}
View
2  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);
View
2  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;
View
2  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);
}