diff options
-rw-r--r-- | app/l10n_util.cc | 4 | ||||
-rw-r--r-- | chrome/browser/browser_init.cc | 6 | ||||
-rw-r--r-- | chrome/browser/browser_main.cc | 6 | ||||
-rw-r--r-- | chrome/browser/jankometer.cc | 8 | ||||
-rw-r--r-- | chrome/browser/profile.cc | 4 | ||||
-rw-r--r-- | chrome/test/automated_ui_tests/automated_ui_tests.cc | 14 |
6 files changed, 19 insertions, 23 deletions
diff --git a/app/l10n_util.cc b/app/l10n_util.cc index e296a75..9a24cf9 100644 --- a/app/l10n_util.cc +++ b/app/l10n_util.cc @@ -447,8 +447,8 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) { #if defined(OS_WIN) // First, check to see if there's a --lang flag. const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); - const std::string& lang_arg = WideToASCII( - parsed_command_line.GetSwitchValue(switches::kLang)); + const std::string& lang_arg = + parsed_command_line.GetSwitchValueASCII(switches::kLang); if (!lang_arg.empty()) candidates.push_back(lang_arg); diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index 8dee0dc..b42509d 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -753,8 +753,8 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line, if (command_line.HasSwitch(switches::kPackExtension)) { // Input Paths. - FilePath src_dir = FilePath::FromWStringHack(command_line.GetSwitchValue( - switches::kPackExtension)); + FilePath src_dir = command_line.GetSwitchValuePath( + switches::kPackExtension); FilePath private_key_path; if (command_line.HasSwitch(switches::kPackExtensionKey)) { private_key_path = command_line.GetSwitchValuePath( @@ -826,7 +826,7 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line, if (command_line.HasSwitch(switches::kUseFlip)) { std::string flip_mode = - WideToASCII(command_line.GetSwitchValue(switches::kUseFlip)); + command_line.GetSwitchValueASCII(switches::kUseFlip); net::HttpNetworkLayer::EnableFlip(flip_mode); } diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index eb38226..6ca2b4b 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -514,8 +514,8 @@ int BrowserMain(const MainFunctionParams& parameters) { #if defined(OS_WIN) // This is experimental code. See first_run_win.cc for more info. - std::wstring try_chrome = - parsed_command_line.GetSwitchValue(switches::kTryChromeAgain); + std::string try_chrome = + parsed_command_line.GetSwitchValueASCII(switches::kTryChromeAgain); if (!try_chrome.empty()) { Upgrade::TryResult answer = Upgrade::ShowTryChromeDialog(StringToInt(try_chrome)); @@ -827,7 +827,7 @@ int BrowserMain(const MainFunctionParams& parameters) { std::string sdch_supported_domain(""); if (parsed_command_line.HasSwitch(switches::kSdchFilter)) { sdch_supported_domain = - WideToASCII(parsed_command_line.GetSwitchValue(switches::kSdchFilter)); + parsed_command_line.GetSwitchValueASCII(switches::kSdchFilter); } else { sdch_trial->AppendGroup("_global_disable_sdch", kSDCH_PROBABILITY_PER_GROUP); diff --git a/chrome/browser/jankometer.cc b/chrome/browser/jankometer.cc index 10d2f14..6d396ef 100644 --- a/chrome/browser/jankometer.cc +++ b/chrome/browser/jankometer.cc @@ -232,11 +232,11 @@ void InstallJankometer(const CommandLine& parsed_command_line) { bool ui_watchdog_enabled = false; bool io_watchdog_enabled = false; if (parsed_command_line.HasSwitch(switches::kEnableWatchdog)) { - std::wstring list = - parsed_command_line.GetSwitchValue(switches::kEnableWatchdog); - if (list.npos != list.find(L"ui")) + std::string list = + parsed_command_line.GetSwitchValueASCII(switches::kEnableWatchdog); + if (list.npos != list.find("ui")) ui_watchdog_enabled = true; - if (list.npos != list.find(L"io")) + if (list.npos != list.find("io")) io_watchdog_enabled = true; } diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 3f5deee..111029b 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -680,9 +680,7 @@ void ProfileImpl::InitExtensions() { // Load any extensions specified with --load-extension. if (command_line->HasSwitch(switches::kLoadExtension)) { - std::wstring path_string = - command_line->GetSwitchValue(switches::kLoadExtension); - FilePath path = FilePath::FromWStringHack(path_string); + FilePath path = command_line->GetSwitchValuePath(switches::kLoadExtension); extensions_service_->LoadExtension(path); // Tell UserScriptMaser to watch this extension's directory for changes so diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.cc b/chrome/test/automated_ui_tests/automated_ui_tests.cc index ae7df5d..f8b912e 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.cc +++ b/chrome/test/automated_ui_tests/automated_ui_tests.cc @@ -123,11 +123,11 @@ AutomatedUITest::AutomatedUITest() if (parsed_command_line.HasSwitch(kDebugModeSwitch)) debug_logging_enabled_ = true; if (parsed_command_line.HasSwitch(kWaitSwitch)) { - std::wstring str = parsed_command_line.GetSwitchValue(kWaitSwitch); + std::string str = parsed_command_line.GetSwitchValueASCII(kWaitSwitch); if (str.empty()) { post_action_delay_ = 1; } else { - post_action_delay_ = static_cast<int>(StringToInt64(WideToUTF16(str))); + post_action_delay_ = StringToInt(str); } } if (base::SysInfo::HasEnvVar(env_vars::kHeadless)) @@ -141,17 +141,15 @@ void AutomatedUITest::RunReproduction() { xml_writer_.StartWriting(); xml_writer_.StartElement("Report"); std::string action_string = - WideToASCII(parsed_command_line.GetSwitchValue(kReproSwitch)); + parsed_command_line.GetSwitchValueASCII(kReproSwitch); int64 num_reproductions = 1; if (parsed_command_line.HasSwitch(kReproRepeatSwitch)) { - std::wstring num_reproductions_string = - parsed_command_line.GetSwitchValue(kReproRepeatSwitch); - std::string test = WideToASCII(num_reproductions_string); - num_reproductions = StringToInt64(test); + num_reproductions = StringToInt64( + parsed_command_line.GetSwitchValueASCII(kReproRepeatSwitch)); } std::vector<std::string> actions; - SplitString(action_string, L',', &actions); + SplitString(action_string, ',', &actions); bool did_crash = false; bool command_complete = false; |