diff --git a/app/app_switches.cc b/app/app_switches.cc index f07fa32e6c9d..f869d689b822 100644 --- a/app/app_switches.cc +++ b/app/app_switches.cc @@ -8,6 +8,6 @@ namespace switches { // The language file that we want to try to open. Of the form // language[-country] where language is the 2 letter code from ISO-639. -const wchar_t kLang[] = L"lang"; +const char kLang[] = "lang"; } // namespace switches diff --git a/app/app_switches.h b/app/app_switches.h index 1169b7fdb374..b58915370e35 100644 --- a/app/app_switches.h +++ b/app/app_switches.h @@ -9,7 +9,7 @@ namespace switches { -extern const wchar_t kLang[]; +extern const char kLang[]; } // namespace switches diff --git a/base/base_switches.cc b/base/base_switches.cc index b13517abe5e3..26136230a9e7 100644 --- a/base/base_switches.cc +++ b/base/base_switches.cc @@ -9,29 +9,29 @@ namespace switches { // If the program includes chrome/common/debug_on_start.h, the process will // start the JIT system-registered debugger on itself and will wait for 60 // seconds for the debugger to attach to itself. Then a break point will be hit. -const wchar_t kDebugOnStart[] = L"debug-on-start"; +const char kDebugOnStart[] = "debug-on-start"; // Will wait for 60 seconds for a debugger to come to attach to the process. -const wchar_t kWaitForDebugger[] = L"wait-for-debugger"; +const char kWaitForDebugger[] = "wait-for-debugger"; // Suppresses all error dialogs when present. -const wchar_t kNoErrorDialogs[] = L"noerrdialogs"; +const char kNoErrorDialogs[] = "noerrdialogs"; // Disables the crash reporting. -const wchar_t kDisableBreakpad[] = L"disable-breakpad"; +const char kDisableBreakpad[] = "disable-breakpad"; // Generates full memory crash dump. -const wchar_t kFullMemoryCrashReport[] = L"full-memory-crash-report"; +const char kFullMemoryCrashReport[] = "full-memory-crash-report"; // The value of this switch determines whether the process is started as a // renderer or plugin host. If it's empty, it's the browser. -const wchar_t kProcessType[] = L"type"; +const char kProcessType[] = "type"; // Enable DCHECKs in release mode. -const wchar_t kEnableDCHECK[] = L"enable-dcheck"; +const char kEnableDCHECK[] = "enable-dcheck"; // Disable win_util::MessageBox. This is useful when running as part of // scripts that do not have a user interface. -const wchar_t kNoMessageBox[] = L"no-message-box"; +const char kNoMessageBox[] = "no-message-box"; } // namespace switches diff --git a/base/base_switches.h b/base/base_switches.h index e708ee419a53..4074043e71bf 100644 --- a/base/base_switches.h +++ b/base/base_switches.h @@ -9,14 +9,14 @@ namespace switches { -extern const wchar_t kDebugOnStart[]; -extern const wchar_t kWaitForDebugger[]; -extern const wchar_t kDisableBreakpad[]; -extern const wchar_t kFullMemoryCrashReport[]; -extern const wchar_t kNoErrorDialogs[]; -extern const wchar_t kProcessType[]; -extern const wchar_t kEnableDCHECK[]; -extern const wchar_t kNoMessageBox[]; +extern const char kDebugOnStart[]; +extern const char kWaitForDebugger[]; +extern const char kDisableBreakpad[]; +extern const char kFullMemoryCrashReport[]; +extern const char kNoErrorDialogs[]; +extern const char kProcessType[]; +extern const char kEnableDCHECK[]; +extern const char kNoMessageBox[]; } // namespace switches diff --git a/base/command_line.cc b/base/command_line.cc index a1c2c1e97336..1e520044fb80 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -45,7 +45,7 @@ const char kSwitchValueSeparator[] = "="; // Lowercase a string. This is used to lowercase switch names. // Is this what we really want? It seems crazy to me. I've left it in // for backwards compatibility on Windows. -static void Lowercase(std::wstring* parameter) { +static void Lowercase(std::string* parameter) { transform(parameter->begin(), parameter->end(), parameter->begin(), tolower); } @@ -175,8 +175,8 @@ bool CommandLine::IsSwitch(const StringType& parameter_string, *switch_value = parameter_string.substr(equals_position + 1); } #if defined(OS_WIN) - Lowercase(&switch_native); *switch_string = WideToASCII(switch_native); + Lowercase(switch_string); #else *switch_string = switch_native; #endif @@ -225,23 +225,23 @@ void CommandLine::Reset() { current_process_commandline_ = NULL; } -bool CommandLine::HasSwitch(const std::wstring& switch_string) const { - std::wstring lowercased_switch(switch_string); +bool CommandLine::HasSwitch(const std::string& switch_string) const { + std::string lowercased_switch(switch_string); #if defined(OS_WIN) Lowercase(&lowercased_switch); #endif - return switches_.find(WideToASCII(lowercased_switch)) != switches_.end(); + return switches_.find(lowercased_switch) != switches_.end(); } std::wstring CommandLine::GetSwitchValue( - const std::wstring& switch_string) const { - std::wstring lowercased_switch(switch_string); + const std::string& switch_string) const { + std::string lowercased_switch(switch_string); #if defined(OS_WIN) Lowercase(&lowercased_switch); #endif std::map::const_iterator result = - switches_.find(WideToASCII(lowercased_switch)); + switches_.find(lowercased_switch); if (result == switches_.end()) { return L""; @@ -277,39 +277,39 @@ std::wstring CommandLine::program() const { // static std::wstring CommandLine::PrefixedSwitchString( - const std::wstring& switch_string) { + const std::string& switch_string) { #if defined(OS_WIN) - return kSwitchPrefixes[0] + switch_string; + return kSwitchPrefixes[0] + ASCIIToWide(switch_string); #else - return ASCIIToWide(kSwitchPrefixes[0]) + switch_string; + return ASCIIToWide(kSwitchPrefixes[0] + switch_string); #endif } // static std::wstring CommandLine::PrefixedSwitchStringWithValue( - const std::wstring& switch_string, const std::wstring& value_string) { + const std::string& switch_string, const std::wstring& value_string) { if (value_string.empty()) { return PrefixedSwitchString(switch_string); } return PrefixedSwitchString(switch_string + #if defined(OS_WIN) - kSwitchValueSeparator + + WideToASCII(kSwitchValueSeparator) #else - ASCIIToWide(kSwitchValueSeparator) + + kSwitchValueSeparator #endif - value_string); + ) + value_string; } #if defined(OS_WIN) -void CommandLine::AppendSwitch(const std::wstring& switch_string) { +void CommandLine::AppendSwitch(const std::string& switch_string) { std::wstring prefixed_switch_string = PrefixedSwitchString(switch_string); command_line_string_.append(L" "); command_line_string_.append(prefixed_switch_string); - switches_[WideToASCII(switch_string)] = L""; + switches_[switch_string] = L""; } -void CommandLine::AppendSwitchWithValue(const std::wstring& switch_string, +void CommandLine::AppendSwitchWithValue(const std::string& switch_string, const std::wstring& value_string) { std::wstring value_string_edit; @@ -326,12 +326,12 @@ void CommandLine::AppendSwitchWithValue(const std::wstring& switch_string, } std::wstring combined_switch_string = - PrefixedSwitchStringWithValue(switch_string, value_string_edit); + PrefixedSwitchStringWithValue(switch_string, value_string_edit); command_line_string_.append(L" "); command_line_string_.append(combined_switch_string); - switches_[WideToASCII(switch_string)] = value_string; + switches_[switch_string] = value_string; } void CommandLine::AppendLooseValue(const std::wstring& value) { @@ -361,20 +361,18 @@ void CommandLine::PrependWrapper(const std::wstring& wrapper) { } #elif defined(OS_POSIX) -void CommandLine::AppendSwitch(const std::wstring& switch_string) { - std::string ascii_switch = WideToASCII(switch_string); - argv_.push_back(kSwitchPrefixes[0] + ascii_switch); - switches_[ascii_switch] = ""; +void CommandLine::AppendSwitch(const std::string& switch_string) { + argv_.push_back(kSwitchPrefixes[0] + switch_string); + switches_[switch_string] = ""; } -void CommandLine::AppendSwitchWithValue(const std::wstring& switch_string, +void CommandLine::AppendSwitchWithValue(const std::string& switch_string, const std::wstring& value_string) { - std::string ascii_switch = WideToASCII(switch_string); std::string mb_value = base::SysWideToNativeMB(value_string); - argv_.push_back(kSwitchPrefixes[0] + ascii_switch + + argv_.push_back(kSwitchPrefixes[0] + switch_string + kSwitchValueSeparator + mb_value); - switches_[ascii_switch] = mb_value; + switches_[switch_string] = mb_value; } void CommandLine::AppendLooseValue(const std::wstring& value) { diff --git a/base/command_line.h b/base/command_line.h index 4fd8e4a411fb..78adb4675916 100644 --- a/base/command_line.h +++ b/base/command_line.h @@ -26,6 +26,7 @@ #include "base/basictypes.h" #include "base/file_path.h" #include "base/logging.h" +#include "base/string_util.h" class InProcessBrowserTest; @@ -88,12 +89,25 @@ class CommandLine { // Returns true if this command line contains the given switch. // (Switch names are case-insensitive.) - bool HasSwitch(const std::wstring& switch_string) const; + bool HasSwitch(const std::string& switch_string) const; + + // Deprecated version of the above. + bool HasSwitch(const std::wstring& switch_string) const { + return HasSwitch(WideToASCII(switch_string)); + } // Returns the value associated with the given switch. If the // switch has no value or isn't present, this method returns // the empty string. - std::wstring GetSwitchValue(const std::wstring& switch_string) const; + std::wstring GetSwitchValue(const std::string& switch_string) const; + std::string GetSwitchValueASCII(const std::string& switch_string) const { + return WideToASCII(GetSwitchValue(switch_string)); + } + + // Deprecated version of the above. + std::wstring GetSwitchValue(const std::wstring& switch_string) const { + return GetSwitchValue(WideToASCII(switch_string)); + } // Get the number of switches in this process. size_t GetSwitchCount() const { return switches_.size(); } @@ -125,22 +139,26 @@ class CommandLine { // Return a copy of the string prefixed with a switch prefix. // Used internally. - static std::wstring PrefixedSwitchString(const std::wstring& switch_string); + static std::wstring PrefixedSwitchString(const std::string& switch_string); // Return a copy of the string prefixed with a switch prefix, // and appended with the given value. Used internally. static std::wstring PrefixedSwitchStringWithValue( - const std::wstring& switch_string, + const std::string& switch_string, const std::wstring& value_string); // Appends the given switch string (preceded by a space and a switch // prefix) to the given string. - void AppendSwitch(const std::wstring& switch_string); + void AppendSwitch(const std::string& switch_string); // Appends the given switch string (preceded by a space and a switch // prefix) to the given string, with the given value attached. - void AppendSwitchWithValue(const std::wstring& switch_string, + void AppendSwitchWithValue(const std::string& switch_string, const std::wstring& value_string); + void AppendSwitchWithValue(const std::string& switch_string, + const std::string& value_string) { + AppendSwitchWithValue(switch_string, ASCIIToWide(value_string)); + } // Append a loose value to the command line. void AppendLooseValue(const std::wstring& value); diff --git a/base/command_line_unittest.cc b/base/command_line_unittest.cc index 0d89d1030763..bfd0a5650b16 100644 --- a/base/command_line_unittest.cc +++ b/base/command_line_unittest.cc @@ -30,33 +30,33 @@ TEST(CommandLineTest, CommandLineConstructor) { "in the time of submarines..."}; CommandLine cl(arraysize(argv), argv); #endif - EXPECT_FALSE(cl.HasSwitch(L"cruller")); - EXPECT_FALSE(cl.HasSwitch(L"flim")); - EXPECT_FALSE(cl.HasSwitch(L"program")); - EXPECT_FALSE(cl.HasSwitch(L"dog")); - EXPECT_FALSE(cl.HasSwitch(L"cat")); - EXPECT_FALSE(cl.HasSwitch(L"output-rotation")); - EXPECT_FALSE(cl.HasSwitch(L"not-a-switch")); - EXPECT_FALSE(cl.HasSwitch(L"--")); + EXPECT_FALSE(cl.HasSwitch("cruller")); + EXPECT_FALSE(cl.HasSwitch("flim")); + EXPECT_FALSE(cl.HasSwitch("program")); + EXPECT_FALSE(cl.HasSwitch("dog")); + EXPECT_FALSE(cl.HasSwitch("cat")); + EXPECT_FALSE(cl.HasSwitch("output-rotation")); + EXPECT_FALSE(cl.HasSwitch("not-a-switch")); + EXPECT_FALSE(cl.HasSwitch("--")); EXPECT_EQ(L"program", cl.program()); - EXPECT_TRUE(cl.HasSwitch(L"foo")); - EXPECT_TRUE(cl.HasSwitch(L"bar")); - EXPECT_TRUE(cl.HasSwitch(L"baz")); - EXPECT_TRUE(cl.HasSwitch(L"spaetzle")); + EXPECT_TRUE(cl.HasSwitch("foo")); + EXPECT_TRUE(cl.HasSwitch("bar")); + EXPECT_TRUE(cl.HasSwitch("baz")); + EXPECT_TRUE(cl.HasSwitch("spaetzle")); #if defined(OS_WIN) - EXPECT_TRUE(cl.HasSwitch(L"SPAETZLE")); + EXPECT_TRUE(cl.HasSwitch("SPAETZLE")); #endif - EXPECT_TRUE(cl.HasSwitch(L"other-switches")); - EXPECT_TRUE(cl.HasSwitch(L"input-translation")); + EXPECT_TRUE(cl.HasSwitch("other-switches")); + EXPECT_TRUE(cl.HasSwitch("input-translation")); - EXPECT_EQ(L"Crepe", cl.GetSwitchValue(L"spaetzle")); - EXPECT_EQ(L"", cl.GetSwitchValue(L"Foo")); - EXPECT_EQ(L"", cl.GetSwitchValue(L"bar")); - EXPECT_EQ(L"", cl.GetSwitchValue(L"cruller")); - EXPECT_EQ(L"--dog=canine --cat=feline", cl.GetSwitchValue(L"other-switches")); - EXPECT_EQ(L"45--output-rotation", cl.GetSwitchValue(L"input-translation")); + EXPECT_EQ(L"Crepe", cl.GetSwitchValue("spaetzle")); + EXPECT_EQ(L"", cl.GetSwitchValue("Foo")); + EXPECT_EQ(L"", cl.GetSwitchValue("bar")); + EXPECT_EQ(L"", cl.GetSwitchValue("cruller")); + EXPECT_EQ(L"--dog=canine --cat=feline", cl.GetSwitchValue("other-switches")); + EXPECT_EQ(L"45--output-rotation", cl.GetSwitchValue("input-translation")); std::vector loose_values = cl.GetLooseValues(); ASSERT_EQ(5U, loose_values.size()); @@ -97,12 +97,12 @@ TEST(CommandLineTest, EmptyString) { // Test methods for appending switches to a command line. TEST(CommandLineTest, AppendSwitches) { - std::wstring switch1 = L"switch1"; - std::wstring switch2 = L"switch2"; + std::string switch1 = "switch1"; + std::string switch2 = "switch2"; std::wstring value = L"value"; - std::wstring switch3 = L"switch3"; + std::string switch3 = "switch3"; std::wstring value3 = L"a value with spaces"; - std::wstring switch4 = L"switch4"; + std::string switch4 = "switch4"; std::wstring value4 = L"\"a value with quotes\""; #if defined(OS_WIN) diff --git a/base/debug_on_start.cc b/base/debug_on_start.cc index c7d414965e07..9011ca200ecc 100644 --- a/base/debug_on_start.cc +++ b/base/debug_on_start.cc @@ -16,8 +16,12 @@ // The code is not that bright and will find things like ---argument or // /-/argument. // Note: command_line is non-destructively modified. -bool DebugOnStart::FindArgument(wchar_t* command_line, const wchar_t* argument) +bool DebugOnStart::FindArgument(wchar_t* command_line, const char* argument_c) { + wchar_t argument[50]; + for (int i = 0; argument_c[i]; ++i) + argument[i] = argument_c[i]; + int argument_len = lstrlen(argument); int command_line_len = lstrlen(command_line); while (command_line_len > argument_len) { diff --git a/base/debug_on_start.h b/base/debug_on_start.h index ab823cf0e4e7..e31e7eb96f79 100644 --- a/base/debug_on_start.h +++ b/base/debug_on_start.h @@ -31,7 +31,7 @@ class DebugOnStart { // Returns true if the 'argument' is present in the 'command_line'. It does // not use the CRT, only Kernel32 functions. - static bool FindArgument(wchar_t* command_line, const wchar_t* argument); + static bool FindArgument(wchar_t* command_line, const char* argument); }; // Set the function pointer to our function to look for a crash on start. The diff --git a/base/multiprocess_test.h b/base/multiprocess_test.h index 99c2c795250e..0662689dfab3 100644 --- a/base/multiprocess_test.h +++ b/base/multiprocess_test.h @@ -20,7 +20,7 @@ // Command line switch to invoke a child process rather than // to run the normal test suite. -static const wchar_t kRunClientProcess[] = L"client"; +static const char kRunClientProcess[] = "client"; // A MultiProcessTest is a test class which makes it easier to // write a test which requires code running out of process. diff --git a/base/test/perf_test_suite.h b/base/test/perf_test_suite.h index 7393544bc217..eed3cfc7a92e 100644 --- a/base/test/perf_test_suite.h +++ b/base/test/perf_test_suite.h @@ -24,7 +24,7 @@ class PerfTestSuite : public TestSuite { // Initialize the perf timer log FilePath log_path; std::wstring log_file = - CommandLine::ForCurrentProcess()->GetSwitchValue(L"log-file"); + CommandLine::ForCurrentProcess()->GetSwitchValue("log-file"); if (log_file.empty()) { FilePath exe; PathService::Get(base::FILE_EXE, &exe); diff --git a/base/test/test_suite.h b/base/test/test_suite.h index 863721a74a0d..5fd1acca9a41 100644 --- a/base/test/test_suite.h +++ b/base/test/test_suite.h @@ -210,7 +210,7 @@ class TestSuite { // In some cases, we do not want to see standard error dialogs. if (!IsDebuggerPresent() && - !CommandLine::ForCurrentProcess()->HasSwitch(L"show-error-dialogs")) { + !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { SuppressErrorDialogs(); #if !defined(PURIFY) // When the code in this file moved around, bug 6436 resurfaced. diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index ff9464ab1a8a..4df3961a4f6e 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -346,8 +346,8 @@ int ChromeMain(int argc, char** argv) { #endif const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); - std::wstring process_type = - parsed_command_line.GetSwitchValue(switches::kProcessType); + std::string process_type = + parsed_command_line.GetSwitchValueASCII(switches::kProcessType); #if defined(OS_MACOSX) mac_util::SetOverrideAppBundlePath(chrome::GetFrameworkBundlePath()); @@ -361,8 +361,8 @@ int ChromeMain(int argc, char** argv) { #if defined(OS_LINUX) // Show the man page on --help or -h. - if (parsed_command_line.HasSwitch(L"help") || - parsed_command_line.HasSwitch(L"h")) { + if (parsed_command_line.HasSwitch("help") || + parsed_command_line.HasSwitch("h")) { FilePath binary(parsed_command_line.argv()[0]); int ret = execlp("man", "man", binary.BaseName().value().c_str(), NULL); LOG(FATAL) << "execlp failed: " << strerror(ret); diff --git a/chrome/browser/first_run_win.cc b/chrome/browser/first_run_win.cc index 379df70a2ef5..464ad0df36b2 100644 --- a/chrome/browser/first_run_win.cc +++ b/chrome/browser/first_run_win.cc @@ -110,7 +110,7 @@ bool InvokeGoogleUpdateForRename() { return false; } -bool LaunchSetupWithParam(const std::wstring& param, const std::wstring& value, +bool LaunchSetupWithParam(const std::string& param, const std::wstring& value, int* ret_code) { FilePath exe_path; if (!PathService::Get(base::DIR_MODULE, &exe_path)) @@ -208,7 +208,7 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, FilePath inner_html; if (WriteEULAtoTempFile(&inner_html)) { int retcode = 0; - const std::wstring& eula = installer_util::switches::kShowEula; + const std::string eula = WideToASCII(installer_util::switches::kShowEula); if (!LaunchSetupWithParam(eula, inner_html.ToWStringHack(), &retcode) || (retcode == installer_util::EULA_REJECTED)) { LOG(WARNING) << "EULA rejected. Fast exit."; diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc index 5f5bc5c97d37..76ded964557b 100644 --- a/chrome/browser/gtk/browser_titlebar.cc +++ b/chrome/browser/gtk/browser_titlebar.cc @@ -305,7 +305,7 @@ void BrowserTitlebar::Init() { gtk_box_pack_start(GTK_BOX(titlebar_buttons_box_), buttons_hbox, FALSE, FALSE, 0); - if (CommandLine::ForCurrentProcess()->HasSwitch(L"glen")) { + if (CommandLine::ForCurrentProcess()->HasSwitch("glen")) { close_button_.reset(BuildTitlebarButton(IDR_GLEN, IDR_GLEN, IDR_GLEN, buttons_hbox, IDS_GLEN)); } else { diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc index d44b3369ad4a..bfea20208d1d 100644 --- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc @@ -34,7 +34,7 @@ const char kTestChannelID[] = "T1"; bool LaunchNSSDecrypterChildProcess(const std::wstring& nss_path, const IPC::Channel& channel, base::ProcessHandle* handle) { CommandLine cl(*CommandLine::ForCurrentProcess()); - cl.AppendSwitchWithValue(L"client", L"NSSDecrypterChildProcess"); + cl.AppendSwitchWithValue("client", "NSSDecrypterChildProcess"); FilePath ff_dylib_dir = FilePath::FromWStringHack(nss_path); // Set env variable needed for FF encryption libs to load. diff --git a/chrome/browser/locale_tests_uitest.cc b/chrome/browser/locale_tests_uitest.cc index 808ecaec20e0..c403b6e0b7b3 100644 --- a/chrome/browser/locale_tests_uitest.cc +++ b/chrome/browser/locale_tests_uitest.cc @@ -29,7 +29,7 @@ class LocaleTestsBase : public UITest { class LocaleTestsDa : public LocaleTestsBase { public: LocaleTestsDa() : LocaleTestsBase() { - launch_arguments_.AppendSwitchWithValue(L"lang", L"da"); + launch_arguments_.AppendSwitchWithValue("lang", "da"); // Linux doesn't use --lang, it only uses environment variables to set the // language. @@ -43,7 +43,7 @@ class LocaleTestsDa : public LocaleTestsBase { class LocaleTestsHe : public LocaleTestsBase { public: LocaleTestsHe() : LocaleTestsBase() { - launch_arguments_.AppendSwitchWithValue(L"lang", L"he"); + launch_arguments_.AppendSwitchWithValue("lang", "he"); #if defined(OS_LINUX) old_lc_all_ = getenv("LC_ALL"); setenv("LC_ALL", "he_IL.UTF-8", 1); @@ -54,7 +54,7 @@ class LocaleTestsHe : public LocaleTestsBase { class LocaleTestsZhTw : public LocaleTestsBase { public: LocaleTestsZhTw() : LocaleTestsBase() { - launch_arguments_.AppendSwitchWithValue(L"lang", L"zh-TW"); + launch_arguments_.AppendSwitchWithValue("lang", "zh-TW"); #if defined(OS_LINUX) old_lc_all_ = getenv("LC_ALL"); setenv("LC_ALL", "zh_TW.UTF-8", 1); diff --git a/chrome/browser/nacl_process_host.cc b/chrome/browser/nacl_process_host.cc index bb13ab7c4428..22fb44693401 100644 --- a/chrome/browser/nacl_process_host.cc +++ b/chrome/browser/nacl_process_host.cc @@ -107,7 +107,7 @@ bool NaClProcessHost::LaunchSelLdr(ResourceMessageFilter* renderer_msg_filter, // propagate the following switches to the plugin command line (along with // any associated values) if present in the browser command line // TODO(gregoryd): check which flags of those below can be supported. - static const wchar_t* const switch_names[] = { + static const char* const switch_names[] = { switches::kNoSandbox, switches::kTestSandbox, switches::kDisableBreakpad, diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index 2918b1f4b57b..6d6632c1e75c 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -30,7 +30,7 @@ net::ProxyConfig* CreateProxyConfig(const CommandLine& command_line) { // Scan for all "enable" type proxy switches. - static const wchar_t* proxy_switches[] = { + static const char* proxy_switches[] = { switches::kProxyServer, switches::kProxyPacUrl, switches::kProxyAutoDetect, diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index a24885b79363..525e6409db11 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -375,7 +375,7 @@ bool PluginProcessHost::Init(const WebPluginInfo& info, // Propagate the following switches to the plugin command line (along with // any associated values) if present in the browser command line - static const wchar_t* const switch_names[] = { + static const char* const switch_names[] = { switches::kPluginStartupDialog, switches::kNoSandbox, switches::kSafePlugins, diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc index 2eaba30cf62f..80093fe9f2fc 100644 --- a/chrome/browser/printing/printing_layout_uitest.cc +++ b/chrome/browser/printing/printing_layout_uitest.cc @@ -21,7 +21,7 @@ namespace { using printing::Image; -const wchar_t* const kGenerateSwitch = L"print-layout-generate"; +const char kGenerateSwitch[] = "print-layout-generate"; const wchar_t kDocRoot[] = L"chrome/test/data"; class PrintingLayoutTest : public PrintingTest { @@ -29,7 +29,7 @@ class PrintingLayoutTest : public PrintingTest { PrintingLayoutTest() { emf_path_ = browser_directory_; emf_path_ = emf_path_.AppendASCII("metafile_dumps"); - launch_arguments_.AppendSwitchWithValue(L"debug-print", + launch_arguments_.AppendSwitchWithValue("debug-print", L'"' + emf_path_.value() + L'"'); show_window_ = true; } diff --git a/chrome/browser/process_singleton_linux_uitest.cc b/chrome/browser/process_singleton_linux_uitest.cc index 2e775f430919..795a02368370 100644 --- a/chrome/browser/process_singleton_linux_uitest.cc +++ b/chrome/browser/process_singleton_linux_uitest.cc @@ -25,7 +25,6 @@ #include "chrome/test/ui/ui_test.h" #include "testing/gtest/include/gtest/gtest.h" - namespace { typedef UITest ProcessSingletonLinuxTest; diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 87c9713f25c2..c799d1a59e20 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -93,10 +93,10 @@ void GetCacheParameters(ContextType type, FilePath* cache_path, *cache_path = FilePath::FromWStringHack(user_path); } - const wchar_t* arg = kNormalContext == type ? switches::kDiskCacheSize : - switches::kMediaCacheSize; + const char* arg = kNormalContext == type ? switches::kDiskCacheSize : + switches::kMediaCacheSize; std::string value = - WideToASCII(CommandLine::ForCurrentProcess()->GetSwitchValue(arg)); + CommandLine::ForCurrentProcess()->GetSwitchValueASCII(arg); // By default we let the cache determine the right size. *max_size = 0; diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index bd92c8fb1037..b43b878675aa 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -483,7 +483,7 @@ void BrowserRenderProcessHost::PropogateBrowserCommandLineToRenderer( CommandLine* renderer_cmd) const { // Propagate the following switches to the renderer command line (along // with any associated values) if present in the browser command line. - static const wchar_t* const switch_names[] = { + static const char* const switch_names[] = { switches::kRendererAssertTest, switches::kRendererCrashTest, switches::kRendererStartupDialog, diff --git a/chrome/browser/sandbox_policy.cc b/chrome/browser/sandbox_policy.cc index ed6198040e45..5c21a67f927b 100644 --- a/chrome/browser/sandbox_policy.cc +++ b/chrome/browser/sandbox_policy.cc @@ -337,7 +337,7 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line, base::ProcessHandle process = 0; const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); ChildProcessInfo::ProcessType type; - std::wstring type_str = cmd_line->GetSwitchValue(switches::kProcessType); + std::string type_str = cmd_line->GetSwitchValueASCII(switches::kProcessType); if (type_str == switches::kRendererProcess) { type = ChildProcessInfo::RENDER_PROCESS; } else if (type_str == switches::kPluginProcess) { diff --git a/chrome/common/chrome_plugin_util.cc b/chrome/common/chrome_plugin_util.cc index 9258d980a6c5..809e4e6a336f 100644 --- a/chrome/common/chrome_plugin_util.cc +++ b/chrome/common/chrome_plugin_util.cc @@ -132,7 +132,8 @@ CPError CPB_GetCommandLineArgumentsCommon(const char* url, // Make sure user_data_dir is an absolute path. if (file_util::AbsolutePath(&user_data_dir) && file_util::PathExists(user_data_dir)) { - arguments_w += std::wstring(L"--") + switches::kUserDataDir + + // TODO(evanm): use CommandLine APIs instead of this. + arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kUserDataDir) + L"=\"" + user_data_dir + L"\" "; } } @@ -146,7 +147,9 @@ CPError CPB_GetCommandLineArgumentsCommon(const char* url, ReplaceSubstringsAfterOffset(&url_string, 0, ";", ""); ReplaceSubstringsAfterOffset(&url_string, 0, "$", ""); std::wstring url_w = UTF8ToWide(url_string); - arguments_w += std::wstring(L"--") + switches::kApp + L"=\"" + url_w + L"\""; + // TODO(evanm): use CommandLine APIs instead of this. + arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kApp) + + L"=\"" + url_w + L"\""; *arguments = WideToUTF8(arguments_w); diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 26ce6a49630f..6d3fb14fa55e 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -12,454 +12,454 @@ namespace switches { // base/base_switches.cc instead. // Suppresses hang monitor dialogs in renderer processes. -const wchar_t kDisableHangMonitor[] = L"disable-hang-monitor"; +const char kDisableHangMonitor[] = "disable-hang-monitor"; // Completely disables UMA metrics system. -const wchar_t kDisableMetrics[] = L"disable-metrics"; +const char kDisableMetrics[] = "disable-metrics"; // Enables the recording of metrics reports but disables reporting. // In contrast to kDisableMetrics, this executes all the code that a normal // client would use for reporting, except the report is dropped rather than sent // to the server. This is useful for finding issues in the metrics code during // UI and performance tests. -const wchar_t kMetricsRecordingOnly[] = L"metrics-recording-only"; +const char kMetricsRecordingOnly[] = "metrics-recording-only"; // Causes the browser process to throw an assertion on startup. -const wchar_t kBrowserAssertTest[] = L"assert-test"; +const char kBrowserAssertTest[] = "assert-test"; // Causes the renderer process to throw an assertion on launch. -const wchar_t kRendererAssertTest[] = L"renderer-assert-test"; +const char kRendererAssertTest[] = "renderer-assert-test"; // Causes the browser process to crash on startup. -const wchar_t kBrowserCrashTest[] = L"crash-test"; +const char kBrowserCrashTest[] = "crash-test"; // Causes the renderer process to crash on launch. -const wchar_t kRendererCrashTest[] = L"renderer-crash-test"; +const char kRendererCrashTest[] = "renderer-crash-test"; // Causes the renderer process to display a dialog on launch. -const wchar_t kRendererStartupDialog[] = L"renderer-startup-dialog"; +const char kRendererStartupDialog[] = "renderer-startup-dialog"; // Causes the plugin process to display a dialog on launch. -const wchar_t kPluginStartupDialog[] = L"plugin-startup-dialog"; +const char kPluginStartupDialog[] = "plugin-startup-dialog"; // Specifies a command that should be used to launch the plugin process. Useful // for running the plugin process through purify or quantify. Ex: // --plugin-launcher="path\to\purify /Run=yes" -const wchar_t kPluginLauncher[] = L"plugin-launcher"; +const char kPluginLauncher[] = "plugin-launcher"; // The value of this switch tells the app to listen for and broadcast // testing-related messages on IPC channel with the given ID. -const wchar_t kTestingChannelID[] = L"testing-channel"; +const char kTestingChannelID[] = "testing-channel"; // The value of this switch specifies which page will be displayed // in newly-opened tabs. We need this for testing purposes so // that the UI tests don't depend on what comes up for http://google.com. -const wchar_t kHomePage[] = L"homepage"; +const char kHomePage[] = "homepage"; // Causes the process to run as renderer instead of as browser. -const wchar_t kRendererProcess[] = L"renderer"; +const char kRendererProcess[] = "renderer"; // Causes the process to run as a renderer zygote. -const wchar_t kZygoteProcess[] = L"zygote"; +const char kZygoteProcess[] = "zygote"; // Path to the exe to run for the renderer and plugin subprocesses. -const wchar_t kBrowserSubprocessPath[] = L"browser-subprocess-path"; +const char kBrowserSubprocessPath[] = "browser-subprocess-path"; // Causes the process to run as a plugin subprocess. -const wchar_t kPluginProcess[] = L"plugin"; +const char kPluginProcess[] = "plugin"; // Causes the process to run as a worker subprocess. -const wchar_t kWorkerProcess[] = L"worker"; +const char kWorkerProcess[] = "worker"; // Causes the process to run as a NativeClient's sel_ldr subprocess. -const wchar_t kNaClProcess[] = L"nacl"; +const char kNaClProcess[] = "nacl"; // Causes the process to run as a utility subprocess. -const wchar_t kUtilityProcess[] = L"utility"; +const char kUtilityProcess[] = "utility"; // Causes the process to run as a profile import subprocess. -const wchar_t kProfileImportProcess[] = L"profile-import"; +const char kProfileImportProcess[] = "profile-import"; // Runs the renderer and plugins in the same process as the browser -const wchar_t kSingleProcess[] = L"single-process"; +const char kSingleProcess[] = "single-process"; // Runs each set of script-connected tabs (i.e., a BrowsingInstance) in its own // renderer process. We default to using a renderer process for each // site instance (i.e., group of pages from the same registered domain with // script connections to each other). -const wchar_t kProcessPerTab[] = L"process-per-tab"; +const char kProcessPerTab[] = "process-per-tab"; // Runs a single process for each site (i.e., group of pages from the same // registered domain) the user visits. We default to using a renderer process // for each site instance (i.e., group of pages from the same registered // domain with script connections to each other). -const wchar_t kProcessPerSite[] = L"process-per-site"; +const char kProcessPerSite[] = "process-per-site"; // Runs plugins inside the renderer process -const wchar_t kInProcessPlugins[] = L"in-process-plugins"; +const char kInProcessPlugins[] = "in-process-plugins"; // Runs the renderer outside the sandbox. -const wchar_t kNoSandbox[] = L"no-sandbox"; +const char kNoSandbox[] = "no-sandbox"; // Disables the alternate window station for the renderer. -const wchar_t kDisableAltWinstation[] = L"disable-winsta"; +const char kDisableAltWinstation[] = "disable-winsta"; // Runs the plugin processes inside the sandbox. -const wchar_t kSafePlugins[] = L"safe-plugins"; +const char kSafePlugins[] = "safe-plugins"; // Excludes these plugins from the plugin sandbox. // This is a comma-separated list of plugin library names. -const wchar_t kTrustedPlugins[] = L"trusted-plugins"; +const char kTrustedPlugins[] = "trusted-plugins"; // Runs the security test for the sandbox. -const wchar_t kTestSandbox[] = L"test-sandbox"; +const char kTestSandbox[] = "test-sandbox"; // Specifies the user data directory, which is where the browser will look // for all of its state. -const wchar_t kUserDataDir[] = L"user-data-dir"; +const char kUserDataDir[] = "user-data-dir"; // Specifies the plugin data directory, which is where plugins (Gears // specifically) will store its state. -const wchar_t kPluginDataDir[] = L"plugin-data-dir"; +const char kPluginDataDir[] = "plugin-data-dir"; // Use a specific disk cache location, rather than one derived from the // UserDatadir. -const wchar_t kDiskCacheDir[] = L"disk-cache-dir"; +const char kDiskCacheDir[] = "disk-cache-dir"; // Forces the maximum disk space to be used by the disk cache, in bytes. -const wchar_t kDiskCacheSize[] = L"disk-cache-size"; +const char kDiskCacheSize[] = "disk-cache-size"; // Forces the maximum disk space to be used by the media cache, in bytes. -const wchar_t kMediaCacheSize[] = L"media-cache-size"; +const char kMediaCacheSize[] = "media-cache-size"; // Whether the multiple profiles feature based on the user-data-dir flag is // enabled or not. -const wchar_t kEnableUserDataDirProfiles[] = L"enable-udd-profiles"; +const char kEnableUserDataDirProfiles[] = "enable-udd-profiles"; // Specifies the path to the user data folder for the parent profile. -const wchar_t kParentProfile[] = L"parent-profile"; +const char kParentProfile[] = "parent-profile"; // Specifies that the associated value should be launched in "application" mode. -const wchar_t kApp[] = L"app"; +const char kApp[] = "app"; // Specifies if the dom_automation_controller_ needs to be bound in the // renderer. This binding happens on per-frame basis and hence can potentially // be a performance bottleneck. One should only enable it when automating // dom based tests. -const wchar_t kDomAutomationController[] = L"dom-automation"; +const char kDomAutomationController[] = "dom-automation"; // Tells the plugin process the path of the plugin to load -const wchar_t kPluginPath[] = L"plugin-path"; +const char kPluginPath[] = "plugin-path"; // A string used to override the default user agent with a custom one. -const wchar_t kUserAgent[] = L"user-agent"; +const char kUserAgent[] = "user-agent"; // Specifies the flags passed to JS engine -const wchar_t kJavaScriptFlags[] = L"js-flags"; +const char kJavaScriptFlags[] = "js-flags"; // The Country we should use. This is normally obtained from the operating // system during first run and cached in the preferences afterwards. This is a // string value, the 2 letter code from ISO 3166-1. -const wchar_t kCountry[] = L"country"; +const char kCountry[] = "country"; // Will add kWaitForDebugger to every child processes. If a value is passed, it // will be used as a filter to determine if the child process should have the // kWaitForDebugger flag passed on or not. -const wchar_t kWaitForDebuggerChildren[] = L"wait-for-debugger-children"; +const char kWaitForDebuggerChildren[] = "wait-for-debugger-children"; // Will filter log messages to show only the messages that are prefixed // with the specified value -const wchar_t kLogFilterPrefix[] = L"log-filter-prefix"; +const char kLogFilterPrefix[] = "log-filter-prefix"; // Force logging to be enabled. Logging is disabled by default in release // builds. -const wchar_t kEnableLogging[] = L"enable-logging"; +const char kEnableLogging[] = "enable-logging"; // Force logging to be disabled. Logging is enabled by default in debug // builds. -const wchar_t kDisableLogging[] = L"disable-logging"; +const char kDisableLogging[] = "disable-logging"; // Sets the minimum log level. Valid values are from 0 to 3: // INFO = 0, WARNING = 1, LOG_ERROR = 2, LOG_FATAL = 3. -const wchar_t kLoggingLevel[] = L"log-level"; +const char kLoggingLevel[] = "log-level"; // Make plugin processes log their sent and received messages to LOG(INFO). -const wchar_t kLogPluginMessages[] = L"log-plugin-messages"; +const char kLogPluginMessages[] = "log-plugin-messages"; // Dump any accumualted histograms to the log when browser terminates (requires // logging to be enabled to really do anything). Used by developers and test // scripts. -const wchar_t kDumpHistogramsOnExit[] = L"dump-histograms-on-exit"; +const char kDumpHistogramsOnExit[] = "dump-histograms-on-exit"; // enable remote debug / automation shell on the specified port -const wchar_t kRemoteShellPort[] = L"remote-shell-port"; +const char kRemoteShellPort[] = "remote-shell-port"; // Runs un-installation steps that were done by chrome first-run. -const wchar_t kUninstall[] = L"uninstall"; +const char kUninstall[] = "uninstall"; // Number of entries to show in the omnibox popup. -const wchar_t kOmniBoxPopupCount[] = L"omnibox-popup-count"; +const char kOmniBoxPopupCount[] = "omnibox-popup-count"; // The value of this switch tells the app to listen for and broadcast // automation-related messages on IPC channel with the given ID. -const wchar_t kAutomationClientChannelID[] = L"automation-channel"; +const char kAutomationClientChannelID[] = "automation-channel"; // Indicates the last session should be restored on startup. This overrides // the preferences value and is primarily intended for testing. The value of // this switch is the number of tabs to wait until loaded before // 'load completed' is sent to the ui_test. -const wchar_t kRestoreLastSession[] = L"restore-last-session"; +const char kRestoreLastSession[] = "restore-last-session"; // Chrome supports a playback and record mode. Record mode saves *everything* // to the cache. Playback mode reads data exclusively from the cache. This // allows us to record a session into the cache and then replay it at will. -const wchar_t kRecordMode[] = L"record-mode"; -const wchar_t kPlaybackMode[] = L"playback-mode"; +const char kRecordMode[] = "record-mode"; +const char kPlaybackMode[] = "playback-mode"; // Don't record/playback events when using record & playback. -const wchar_t kNoEvents[] = L"no-events"; +const char kNoEvents[] = "no-events"; // Support a separate switch that enables the v8 playback extension. // The extension causes javascript calls to Date.now() and Math.random() // to return consistent values, such that subsequent loads of the same // page will result in consistent js-generated data and XHR requests. // Pages may still be able to generate inconsistent data from plugins. -const wchar_t kNoJsRandomness[] = L"no-js-randomness"; +const char kNoJsRandomness[] = "no-js-randomness"; // Make Windows happy by allowing it to show "Enable access to this program" // checkbox in Add/Remove Programs->Set Program Access and Defaults. This // only shows an error box because the only way to hide Chrome is by // uninstalling it. -const wchar_t kHideIcons[] = L"hide-icons"; +const char kHideIcons[] = "hide-icons"; -const wchar_t kShowIcons[] = L"show-icons"; +const char kShowIcons[] = "show-icons"; // Make Chrome default browser -const wchar_t kMakeDefaultBrowser[] = L"make-default-browser"; +const char kMakeDefaultBrowser[] = "make-default-browser"; // Use a specified proxy server, overrides system settings. This switch only // affects HTTP and HTTPS requests. -const wchar_t kProxyServer[] = L"proxy-server"; +const char kProxyServer[] = "proxy-server"; // Don't use a proxy server, always make direct connections. Overrides any // other proxy server flags that are passed. -const wchar_t kNoProxyServer[] = L"no-proxy-server"; +const char kNoProxyServer[] = "no-proxy-server"; // Specify a list of hosts for whom we bypass proxy settings and use direct // connections. Ignored if --proxy-auto-detect or --no-proxy-server are // also specified. // TODO(robertshield): Specify host format. -const wchar_t kProxyBypassList[] = L"proxy-bypass-list"; +const char kProxyBypassList[] = "proxy-bypass-list"; // Force proxy auto-detection. -const wchar_t kProxyAutoDetect[] = L"proxy-auto-detect"; +const char kProxyAutoDetect[] = "proxy-auto-detect"; // Use the pac script at the given URL -const wchar_t kProxyPacUrl[] = L"proxy-pac-url"; +const char kProxyPacUrl[] = "proxy-pac-url"; // Use WinHTTP to fetch and evaluate PAC scripts. Otherwise the default is // to use Chromium's network stack to fetch, and V8 to evaluate. -const wchar_t kWinHttpProxyResolver[] = L"winhttp-proxy-resolver"; +const char kWinHttpProxyResolver[] = "winhttp-proxy-resolver"; // Chrome will support prefetching of DNS information. Until this becomes // the default, we'll provide a command line switch. -extern const wchar_t kDnsLogDetails[] = L"dns-log-details"; -extern const wchar_t kDnsPrefetchDisable[] = L"dns-prefetch-disable"; +extern const char kDnsLogDetails[] = "dns-log-details"; +extern const char kDnsPrefetchDisable[] = "dns-prefetch-disable"; // Enables support to debug printing subsystem. -const wchar_t kDebugPrint[] = L"debug-print"; +const char kDebugPrint[] = "debug-print"; // Prints the pages on the screen. -const wchar_t kPrint[] = L"print"; +const char kPrint[] = "print"; // Browser flag to disable the web inspector for all renderers. -const wchar_t kDisableDevTools[] = L"disable-dev-tools"; +const char kDisableDevTools[] = "disable-dev-tools"; // Enable web inspector for all windows, even if they're part of the browser. // Allows us to use our dev tools to debug browser windows itself. -const wchar_t kAlwaysEnableDevTools[] = L"always-enable-dev-tools"; +const char kAlwaysEnableDevTools[] = "always-enable-dev-tools"; // Enable experimental timeline API. -const wchar_t kEnableExtensionTimelineApi[] = - L"enable-extension-timeline-api"; +const char kEnableExtensionTimelineApi[] = + "enable-extension-timeline-api"; // Used to set the value of SessionRestore::num_tabs_to_load_. See // session_restore.h for details. -const wchar_t kTabCountToLoadOnSessionRestore[]= - L"tab-count-to-load-on-session-restore"; +const char kTabCountToLoadOnSessionRestore[]= + "tab-count-to-load-on-session-restore"; // Enable dynamic loading of the Memory Profiler DLL, which will trace // all memory allocations during the run. -const wchar_t kMemoryProfiling[] = L"memory-profile"; +const char kMemoryProfiling[] = "memory-profile"; // Adds a "Purge memory" button to the Task Manager, which tries to dump as much // memory as possible. This is mostly useful for testing how well the // MemoryPurger functionality (which is normally triggered on Suspend) works. // // NOTE: This is only implemented for Views. -const wchar_t kPurgeMemoryButton[] = L"purge-memory-button"; +const char kPurgeMemoryButton[] = "purge-memory-button"; // By default, cookies are not allowed on file://. They are needed in for // testing, for example page cycler and layout tests. See bug 1157243. -const wchar_t kEnableFileCookies[] = L"enable-file-cookies"; +const char kEnableFileCookies[] = "enable-file-cookies"; // Start the browser maximized, regardless of any previous settings. -const wchar_t kStartMaximized[] = L"start-maximized"; +const char kStartMaximized[] = "start-maximized"; // Spawn threads to watch for excessive delays in specified message loops. // User should set breakpoints on Alarm() to examine problematic thread. // Usage: -enable-watchdog=[ui][io] // Order of the listed sub-arguments does not matter. -const wchar_t kEnableWatchdog[] = L"enable-watchdog"; +const char kEnableWatchdog[] = "enable-watchdog"; // Display the First Run experience when the browser is started, regardless of // whether or not it's actually the first run. -const wchar_t kFirstRun[] = L"first-run"; +const char kFirstRun[] = "first-run"; // Bypass the First Run experience when the browser is started, regardless of // whether or not it's actually the first run. Overrides kFirstRun in case // you're for some reason tempted to pass them both. -const wchar_t kNoFirstRun[] = L"no-first-run"; +const char kNoFirstRun[] = "no-first-run"; #if defined(OS_POSIX) // Bypass the error dialog when the profile lock couldn't be attained. // This switch is used during automated testing. -const wchar_t kNoProcessSingletonDialog[] = L"no-process-singleton-dialog"; +const char kNoProcessSingletonDialog[] = "no-process-singleton-dialog"; #endif // Enable histograming of tasks served by MessageLoop. See about:histograms/Loop // for results, which show frequency of messages on each thread, including APC // count, object signalling count, etc. -const wchar_t kMessageLoopHistogrammer[] = L"message-loop-histogrammer"; +const char kMessageLoopHistogrammer[] = "message-loop-histogrammer"; // Perform importing from another browser. The value associated with this // setting encodes the target browser and what items to import. -const wchar_t kImport[] = L"import"; +const char kImport[] = "import"; // Change the DCHECKS to dump memory and continue instead of displaying error // dialog. This is valid only in Release mode when --enable-dcheck is // specified. -const wchar_t kSilentDumpOnDCHECK[] = L"silent-dump-on-dcheck"; +const char kSilentDumpOnDCHECK[] = "silent-dump-on-dcheck"; // Normally when the user attempts to navigate to a page that was the result of // a post we prompt to make sure they want to. This switch may be used to // disable that check. This switch is used during automated testing. -const wchar_t kDisablePromptOnRepost[] = L"disable-prompt-on-repost"; +const char kDisablePromptOnRepost[] = "disable-prompt-on-repost"; // Disable pop-up blocking. -const wchar_t kDisablePopupBlocking[] = L"disable-popup-blocking"; +const char kDisablePopupBlocking[] = "disable-popup-blocking"; // Don't execute JavaScript (browser JS like the new tab page still runs). -const wchar_t kDisableJavaScript[] = L"disable-javascript"; +const char kDisableJavaScript[] = "disable-javascript"; // Don't enforce the same-origin policy. (Used by people testing their sites.) -const wchar_t kDisableWebSecurity[] = L"disable-web-security"; +const char kDisableWebSecurity[] = "disable-web-security"; // Prevent Java from running. -const wchar_t kDisableJava[] = L"disable-java"; +const char kDisableJava[] = "disable-java"; // Prevent plugins from running. -const wchar_t kDisablePlugins[] = L"disable-plugins"; +const char kDisablePlugins[] = "disable-plugins"; // Prevent images from loading. -const wchar_t kDisableImages[] = L"disable-images"; +const char kDisableImages[] = "disable-images"; // Enable remote web font support. SVG font should always work whether // this option is specified or not. -const wchar_t kEnableRemoteFonts[] = L"enable-remote-fonts"; +const char kEnableRemoteFonts[] = "enable-remote-fonts"; // Use the low fragmentation heap for the CRT. -const wchar_t kUseLowFragHeapCrt[] = L"use-lf-heap"; +const char kUseLowFragHeapCrt[] = "use-lf-heap"; // Runs the Native Client inside the renderer process. -const wchar_t kInternalNaCl[] = L"internal-nacl"; +const char kInternalNaCl[] = "internal-nacl"; #ifndef NDEBUG // Debug only switch to specify which gears plugin dll to load. -const wchar_t kGearsPluginPathOverride[] = L"gears-plugin-path"; +const char kGearsPluginPathOverride[] = "gears-plugin-path"; #endif // Enable the fastback page cache. -const wchar_t kEnableFastback[] = L"enable-fastback"; +const char kEnableFastback[] = "enable-fastback"; // Disable syncing bookmarks to a Google Account. -const wchar_t kDisableSync[] = L"disable-sync"; +const char kDisableSync[] = "disable-sync"; // Use the SyncerThread implementation that matches up with the old pthread // impl semantics, but using Chrome synchronization primitives. The only // difference between this and the default is that we now have no timeout on // Stop(). Should only use if you experience problems with the default. -const wchar_t kSyncerThreadTimedStop[] = L"syncer-thread-timed-stop"; +const char kSyncerThreadTimedStop[] = "syncer-thread-timed-stop"; // Enable support for SDCH filtering (dictionary based expansion of content). // Optional argument is *the* only domain name that will have SDCH suppport. // Default is "-enable-sdch" to advertise SDCH on all domains. // Sample usage with argument: "-enable-sdch=.google.com" // SDCH is currently only supported server-side for searches on google.com. -const wchar_t kSdchFilter[] = L"enable-sdch"; +const char kSdchFilter[] = "enable-sdch"; // Enable user script support. -const wchar_t kEnableUserScripts[] = L"enable-user-scripts"; +const char kEnableUserScripts[] = "enable-user-scripts"; // Disable extensions. -const wchar_t kDisableExtensions[] = L"disable-extensions"; +const char kDisableExtensions[] = "disable-extensions"; // Frequency in seconds for Extensions auto-update. -const wchar_t kExtensionsUpdateFrequency[] = L"extensions-update-frequency"; +const char kExtensionsUpdateFrequency[] = "extensions-update-frequency"; // Load an extension from the specified directory. -const wchar_t kLoadExtension[] = L"load-extension"; +const char kLoadExtension[] = "load-extension"; // Package an extension to a .crx installable file from a given directory. -const wchar_t kPackExtension[] = L"pack-extension"; +const char kPackExtension[] = "pack-extension"; // Optional PEM private key is to use in signing packaged .crx. -const wchar_t kPackExtensionKey[] = L"pack-extension-key"; +const char kPackExtensionKey[] = "pack-extension-key"; // Show extensions on top with toolbar. -const wchar_t kShowExtensionsOnTop[] = L"show-extensions-on-top"; +const char kShowExtensionsOnTop[] = "show-extensions-on-top"; // Load an NPAPI plugin from the specified path. -const wchar_t kLoadPlugin[] = L"load-plugin"; +const char kLoadPlugin[] = "load-plugin"; // directory to locate user scripts in as an over-ride of the default -const wchar_t kUserScriptsDir[] = L"user-scripts-dir"; +const char kUserScriptsDir[] = "user-scripts-dir"; // Causes the browser to launch directly in incognito mode. -const wchar_t kIncognito[] = L"incognito"; +const char kIncognito[] = "incognito"; // Turns on the accessibility in the renderer. Off by default until // http://b/issue?id=1432077 is fixed. -const wchar_t kEnableRendererAccessibility[] = - L"enable-renderer-accessibility"; +const char kEnableRendererAccessibility[] = + "enable-renderer-accessibility"; // Pass the name of the current running automated test to Chrome. -const wchar_t kTestName[] = L"test-name"; +const char kTestName[] = "test-name"; // On POSIX only: the contents of this flag are prepended to the renderer // command line. Useful values might be "valgrind" or "xterm -e gdb --args". -const wchar_t kRendererCmdPrefix[] = L"renderer-cmd-prefix"; +const char kRendererCmdPrefix[] = "renderer-cmd-prefix"; // On POSIX only: the contents of this flag are prepended to the utility // process command line. Useful values might be "valgrind" or "xterm -e gdb // --args". -const wchar_t kUtilityCmdPrefix[] = L"utility-cmd-prefix"; +const char kUtilityCmdPrefix[] = "utility-cmd-prefix"; // On Windows only: use the old WinInet-based ftp implemetation. -const wchar_t kWininetFtp[] = L"wininet-ftp"; +const char kWininetFtp[] = "wininet-ftp"; // Enable Native Web Worker support -const wchar_t kEnableNativeWebWorkers[] = L"enable-native-web-workers"; +const char kEnableNativeWebWorkers[] = "enable-native-web-workers"; // Causes the worker process allocation to use as many processes as cores. -const wchar_t kWebWorkerProcessPerCore[] = L"web-worker-process-per-core"; +const char kWebWorkerProcessPerCore[] = "web-worker-process-per-core"; // Causes workers to run together in one process, depending on their domains. // Note this is duplicated in webworkerclient_impl.cc -const wchar_t kWebWorkerShareProcesses[] = L"web-worker-share-processes"; +const char kWebWorkerShareProcesses[] = "web-worker-share-processes"; // Enables the bookmark menu. -const wchar_t kBookmarkMenu[] = L"bookmark-menu"; +const char kBookmarkMenu[] = "bookmark-menu"; // Enables experimental features for Spellchecker. Right now, the first // experimental feature is auto spell correct, which corrects words which are @@ -468,11 +468,11 @@ const wchar_t kBookmarkMenu[] = L"bookmark-menu"; // 1 - Allow multiple spellcheckers to work simultaneously. // 2 - Allow automatic detection of spell check language. // TODO(sidchat): Implement the above fetaures to work under this flag. -const wchar_t kExperimentalSpellcheckerFeatures[] = - L"experimental-spellchecker-features"; +const char kExperimentalSpellcheckerFeatures[] = + "experimental-spellchecker-features"; // Enables StatsTable, logging statistics to a global named shared memory table. -const wchar_t kEnableStatsTable[] = L"enable-stats-table"; +const char kEnableStatsTable[] = "enable-stats-table"; // Replaces the audio IPC layer for