diff options
84 files changed, 231 insertions, 200 deletions
diff --git a/testing/android/native_test_launcher.cc b/testing/android/native_test_launcher.cc index b7c9d28..26553c9 100644 --- a/testing/android/native_test_launcher.cc +++ b/testing/android/native_test_launcher.cc @@ -126,7 +126,7 @@ static void RunTests(JNIEnv* env, // Command line initialized basically, will be fully initialized later. static const char* const kInitialArgv[] = { "ChromeTestActivity" }; - CommandLine::Init(arraysize(kInitialArgv), kInitialArgv); + base::CommandLine::Init(arraysize(kInitialArgv), kInitialArgv); // Set the application context in base. base::android::ScopedJavaLocalRef<jobject> scoped_context( @@ -151,9 +151,10 @@ static void RunTests(JNIEnv* env, int argc = ArgsToArgv(args, &argv); // Fully initialize command line with arguments. - CommandLine::ForCurrentProcess()->AppendArguments( - CommandLine(argc, &argv[0]), false); - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + base::CommandLine::ForCurrentProcess()->AppendArguments( + base::CommandLine(argc, &argv[0]), false); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); base::FilePath files_dir( base::android::ConvertJavaStringToUTF8(env, jfiles_dir)); diff --git a/tools/android/common/daemon.cc b/tools/android/common/daemon.cc index 699c615..9434576 100644 --- a/tools/android/common/daemon.cc +++ b/tools/android/common/daemon.cc @@ -33,11 +33,11 @@ void CloseFileDescriptor(int fd) { namespace tools { -bool HasHelpSwitch(const CommandLine& command_line) { +bool HasHelpSwitch(const base::CommandLine& command_line) { return command_line.HasSwitch("h") || command_line.HasSwitch("help"); } -bool HasNoSpawnDaemonSwitch(const CommandLine& command_line) { +bool HasNoSpawnDaemonSwitch(const base::CommandLine& command_line) { return command_line.HasSwitch(kNoSpawnDaemon); } diff --git a/tools/android/forwarder/forwarder.cc b/tools/android/forwarder/forwarder.cc index fe49903..1d24ad2 100644 --- a/tools/android/forwarder/forwarder.cc +++ b/tools/android/forwarder/forwarder.cc @@ -377,8 +377,8 @@ int main(int argc, char** argv) { printf("Android device to host TCP forwarder\n"); printf("Like 'adb forward' but in the reverse direction\n"); - CommandLine command_line(argc, argv); - CommandLine::StringVector server_args = command_line.GetArgs(); + base::CommandLine command_line(argc, argv); + base::CommandLine::StringVector server_args = command_line.GetArgs(); if (tools::HasHelpSwitch(command_line) || server_args.empty()) { tools::ShowHelp( argv[0], diff --git a/tools/android/forwarder2/device_forwarder_main.cc b/tools/android/forwarder2/device_forwarder_main.cc index be99aeb..c215efa 100644 --- a/tools/android/forwarder2/device_forwarder_main.cc +++ b/tools/android/forwarder2/device_forwarder_main.cc @@ -139,9 +139,9 @@ class ClientDelegate : public Daemon::ClientDelegate { }; int RunDeviceForwarder(int argc, char** argv) { - CommandLine::Init(argc, argv); // Needed by logging. - const bool kill_server = CommandLine::ForCurrentProcess()->HasSwitch( - "kill-server"); + base::CommandLine::Init(argc, argv); // Needed by logging. + const bool kill_server = + base::CommandLine::ForCurrentProcess()->HasSwitch("kill-server"); if ((kill_server && argc != 2) || (!kill_server && argc != 1)) { std::cerr << "Usage: device_forwarder [--kill-server]" << std::endl; return 1; diff --git a/tools/android/forwarder2/host_forwarder_main.cc b/tools/android/forwarder2/host_forwarder_main.cc index 56ce4f2..47f2252 100644 --- a/tools/android/forwarder2/host_forwarder_main.cc +++ b/tools/android/forwarder2/host_forwarder_main.cc @@ -406,8 +406,8 @@ int PortToInt(const std::string& s) { } int RunHostForwarder(int argc, char** argv) { - CommandLine::Init(argc, argv); - const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); + base::CommandLine::Init(argc, argv); + const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess(); bool kill_server = false; Pickle pickle; diff --git a/tools/gn/command_check.cc b/tools/gn/command_check.cc index 3d03950..5d30a09 100644 --- a/tools/gn/command_check.cc +++ b/tools/gn/command_check.cc @@ -92,7 +92,7 @@ int RunCheck(const std::vector<std::string>& args) { } } - const CommandLine* cmdline = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); bool force = cmdline->HasSwitch("force"); if (!CheckPublicHeaders(&setup->build_settings(), all_targets, diff --git a/tools/gn/command_desc.cc b/tools/gn/command_desc.cc index 6defd37..5c2e2d4 100644 --- a/tools/gn/command_desc.cc +++ b/tools/gn/command_desc.cc @@ -102,7 +102,7 @@ void RecursivePrintDeps(const Target* target, } void PrintDeps(const Target* target, bool display_header) { - const CommandLine* cmdline = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); Label toolchain_label = target->label().GetToolchainLabel(); // Tree mode is separate. @@ -407,7 +407,8 @@ template<typename T> void OutputRecursiveTargetConfig( const Target* target, const char* header_name, const std::vector<T>& (ConfigValues::* getter)() const) { - bool display_blame = CommandLine::ForCurrentProcess()->HasSwitch("blame"); + bool display_blame = + base::CommandLine::ForCurrentProcess()->HasSwitch("blame"); DescValueWriter<T> writer; std::ostringstream out; diff --git a/tools/gn/command_gen.cc b/tools/gn/command_gen.cc index b90b206..cacab84 100644 --- a/tools/gn/command_gen.cc +++ b/tools/gn/command_gen.cc @@ -78,7 +78,7 @@ int RunGen(const std::vector<std::string>& args) { if (!setup->DoSetup(args[0], true)) return 1; - if (CommandLine::ForCurrentProcess()->HasSwitch(kSwitchCheck)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch(kSwitchCheck)) setup->set_check_public_headers(true); // Cause the load to also generate the ninja files for each target. We wrap @@ -103,7 +103,7 @@ int RunGen(const std::vector<std::string>& args) { base::TimeDelta elapsed_time = timer.Elapsed(); - if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kQuiet)) { + if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kQuiet)) { OutputString("Done. ", DECORATION_GREEN); std::string stats = "Wrote " + diff --git a/tools/gn/command_help.cc b/tools/gn/command_help.cc index b57ecc8..0f8c347 100644 --- a/tools/gn/command_help.cc +++ b/tools/gn/command_help.cc @@ -105,7 +105,7 @@ int RunHelp(const std::vector<std::string>& args) { // If no argument is specified, check for switches to allow things like // "gn help --args" for help on the args switch. const base::CommandLine::SwitchMap& switches = - CommandLine::ForCurrentProcess()->GetSwitches(); + base::CommandLine::ForCurrentProcess()->GetSwitches(); if (switches.empty()) { // Still nothing, show help overview. PrintToplevelHelp(); diff --git a/tools/gn/command_ls.cc b/tools/gn/command_ls.cc index c22129a..8aefa76 100644 --- a/tools/gn/command_ls.cc +++ b/tools/gn/command_ls.cc @@ -70,7 +70,7 @@ int RunLs(const std::vector<std::string>& args) { if (!setup->DoSetup(args[0], false) || !setup->Run()) return 1; - const CommandLine* cmdline = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); bool all_toolchains = cmdline->HasSwitch("all-toolchains"); // Find matching targets. diff --git a/tools/gn/command_refs.cc b/tools/gn/command_refs.cc index 2bb7fe2..39f8c10 100644 --- a/tools/gn/command_refs.cc +++ b/tools/gn/command_refs.cc @@ -287,7 +287,7 @@ int RunRefs(const std::vector<std::string>& args) { return 1; } - const CommandLine* cmdline = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); bool tree = cmdline->HasSwitch("tree"); bool all = cmdline->HasSwitch("all"); bool all_toolchains = cmdline->HasSwitch("all-toolchains"); diff --git a/tools/gn/exec_process.cc b/tools/gn/exec_process.cc index 2c2ad1d..5c99b47 100644 --- a/tools/gn/exec_process.cc +++ b/tools/gn/exec_process.cc @@ -26,7 +26,7 @@ namespace internal { #if defined(OS_WIN) -bool ExecProcess(const CommandLine& cmdline, +bool ExecProcess(const base::CommandLine& cmdline, const base::FilePath& startup_dir, std::string* std_out, std::string* std_err, @@ -138,7 +138,7 @@ bool ReadFromPipe(int fd, std::string* output) { return true; } -bool ExecProcess(const CommandLine& cmdline, +bool ExecProcess(const base::CommandLine& cmdline, const base::FilePath& startup_dir, std::string* std_out, std::string* std_err, diff --git a/tools/gn/function_exec_script.cc b/tools/gn/function_exec_script.cc index 9d6521f..e0b5afa 100644 --- a/tools/gn/function_exec_script.cc +++ b/tools/gn/function_exec_script.cc @@ -128,7 +128,7 @@ Value RunExecScript(Scope* scope, // Make the command line. const base::FilePath& python_path = build_settings->python_path(); - CommandLine cmdline(python_path); + base::CommandLine cmdline(python_path); cmdline.AppendArgPath(script_path); if (args.size() >= 2) { diff --git a/tools/gn/gn_main.cc b/tools/gn/gn_main.cc index 6a409f9..50d55e7 100644 --- a/tools/gn/gn_main.cc +++ b/tools/gn/gn_main.cc @@ -21,8 +21,8 @@ namespace { -std::vector<std::string> GetArgs(const CommandLine& cmdline) { - CommandLine::StringVector in_args = cmdline.GetArgs(); +std::vector<std::string> GetArgs(const base::CommandLine& cmdline) { + base::CommandLine::StringVector in_args = cmdline.GetArgs(); #if defined(OS_WIN) std::vector<std::string> out_args; for (const auto& arg : in_args) @@ -38,11 +38,11 @@ std::vector<std::string> GetArgs(const CommandLine& cmdline) { int main(int argc, char** argv) { base::AtExitManager at_exit; #if defined(OS_WIN) - CommandLine::set_slash_is_not_a_switch(); + base::CommandLine::set_slash_is_not_a_switch(); #endif - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); - const CommandLine& cmdline = *CommandLine::ForCurrentProcess(); + const base::CommandLine& cmdline = *base::CommandLine::ForCurrentProcess(); std::vector<std::string> args = GetArgs(cmdline); std::string command; diff --git a/tools/gn/ninja_build_writer.cc b/tools/gn/ninja_build_writer.cc index 8953cb3..8957661 100644 --- a/tools/gn/ninja_build_writer.cc +++ b/tools/gn/ninja_build_writer.cc @@ -35,7 +35,7 @@ std::string GetSelfInvocationCommand(const BuildSettings* build_settings) { base::FilePath executable; PathService::Get(base::FILE_EXE, &executable); - CommandLine cmdline(executable.NormalizePathSeparatorsTo('/')); + base::CommandLine cmdline(executable.NormalizePathSeparatorsTo('/')); cmdline.AppendArg("gen"); cmdline.AppendArg(build_settings->build_dir().value()); cmdline.AppendSwitchPath(std::string("--") + switches::kRoot, @@ -52,9 +52,10 @@ std::string GetSelfInvocationCommand(const BuildSettings* build_settings) { escape_shell.inhibit_quoting = true; #endif - const CommandLine& our_cmdline = *CommandLine::ForCurrentProcess(); - const CommandLine::SwitchMap& switches = our_cmdline.GetSwitches(); - for (CommandLine::SwitchMap::const_iterator i = switches.begin(); + const base::CommandLine& our_cmdline = + *base::CommandLine::ForCurrentProcess(); + const base::CommandLine::SwitchMap& switches = our_cmdline.GetSwitches(); + for (base::CommandLine::SwitchMap::const_iterator i = switches.begin(); i != switches.end(); ++i) { // Only write arguments we haven't already written. Always skip "args" // since those will have been written to the file and will be used diff --git a/tools/gn/scheduler.cc b/tools/gn/scheduler.cc index 86de705..488149b 100644 --- a/tools/gn/scheduler.cc +++ b/tools/gn/scheduler.cc @@ -16,7 +16,8 @@ namespace { int GetThreadCount() { std::string thread_count = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kThreads); + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kThreads); int result; if (thread_count.empty() || !base::StringToInt(thread_count, &result)) diff --git a/tools/gn/setup.cc b/tools/gn/setup.cc index f2eb846..e7bf100 100644 --- a/tools/gn/setup.cc +++ b/tools/gn/setup.cc @@ -202,7 +202,7 @@ bool CommonSetup::RunPostMessageLoop() { } // Write out tracing and timing if requested. - const CommandLine* cmdline = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); if (cmdline->HasSwitch(switches::kTime)) PrintLongHelp(SummarizeTraces()); if (cmdline->HasSwitch(switches::kTracelog)) @@ -231,7 +231,7 @@ Setup::~Setup() { } bool Setup::DoSetup(const std::string& build_dir, bool force_create) { - CommandLine* cmdline = CommandLine::ForCurrentProcess(); + base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); scheduler_.set_verbose_logging(cmdline->HasSwitch(switches::kVerbose)); if (cmdline->HasSwitch(switches::kTime) || @@ -282,7 +282,7 @@ SourceFile Setup::GetBuildArgFile() const { return SourceFile(build_settings_.build_dir().value() + kBuildArgFileName); } -bool Setup::FillArguments(const CommandLine& cmdline) { +bool Setup::FillArguments(const base::CommandLine& cmdline) { // Use the args on the command line if specified, and save them. Do this even // if the list is empty (this means clear any defaults). if (cmdline.HasSwitch(switches::kArgs)) { @@ -397,7 +397,7 @@ bool Setup::SaveArgsToFile() { return true; } -bool Setup::FillSourceDir(const CommandLine& cmdline) { +bool Setup::FillSourceDir(const base::CommandLine& cmdline) { // Find the .gn file. base::FilePath root_path; @@ -542,7 +542,7 @@ bool Setup::RunConfigFile() { return true; } -bool Setup::FillOtherConfig(const CommandLine& cmdline) { +bool Setup::FillOtherConfig(const base::CommandLine& cmdline) { Err err; // Secondary source path, read from the config file if present. diff --git a/tools/gn/trace.cc b/tools/gn/trace.cc index 333d9b8..036ac53 100644 --- a/tools/gn/trace.cc +++ b/tools/gn/trace.cc @@ -145,7 +145,7 @@ void ScopedTrace::SetToolchain(const Label& label) { item_->set_toolchain(label.GetUserVisibleName(false)); } -void ScopedTrace::SetCommandLine(const CommandLine& cmdline) { +void ScopedTrace::SetCommandLine(const base::CommandLine& cmdline) { if (item_) item_->set_cmdline(FilePathToUTF8(cmdline.GetArgumentsString())); } diff --git a/tools/imagediff/image_diff.cc b/tools/imagediff/image_diff.cc index 6a9ebb9..608b7c9 100644 --- a/tools/imagediff/image_diff.cc +++ b/tools/imagediff/image_diff.cc @@ -405,8 +405,9 @@ base::FilePath FilePathFromASCII(const std::string& str) { int main(int argc, const char* argv[]) { base::EnableTerminationOnHeapCorruption(); - CommandLine::Init(argc, argv); - const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); + base::CommandLine::Init(argc, argv); + const base::CommandLine& parsed_command_line = + *base::CommandLine::ForCurrentProcess(); bool histograms = parsed_command_line.HasSwitch(kOptionCompareHistograms); if (parsed_command_line.HasSwitch(kOptionPollStdin)) { // Watch stdin for filenames. @@ -432,7 +433,7 @@ int main(int argc, const char* argv[]) { return 0; } - const CommandLine::StringVector& args = parsed_command_line.GetArgs(); + const base::CommandLine::StringVector& args = parsed_command_line.GetArgs(); if (parsed_command_line.HasSwitch(kOptionGenerateDiff)) { if (args.size() == 3) { return DiffImages(base::FilePath(args[0]), diff --git a/tools/ipc_fuzzer/mutate/generate.cc b/tools/ipc_fuzzer/mutate/generate.cc index 8d11280..c3bb18a 100644 --- a/tools/ipc_fuzzer/mutate/generate.cc +++ b/tools/ipc_fuzzer/mutate/generate.cc @@ -1285,9 +1285,9 @@ static const char kCountSwitch[] = "count"; static const char kHelpSwitch[] = "help"; int GenerateMain(int argc, char** argv) { - CommandLine::Init(argc, argv); - CommandLine* cmd = CommandLine::ForCurrentProcess(); - CommandLine::StringVector args = cmd->GetArgs(); + base::CommandLine::Init(argc, argv); + base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); + base::CommandLine::StringVector args = cmd->GetArgs(); if (args.size() != 1 || cmd->HasSwitch(kHelpSwitch)) { std::cerr << "Usage: ipc_fuzzer_generate [--help] [--count=n] outfile\n"; diff --git a/tools/ipc_fuzzer/mutate/message_util.cc b/tools/ipc_fuzzer/mutate/message_util.cc index 4619af8..048f6e4 100644 --- a/tools/ipc_fuzzer/mutate/message_util.cc +++ b/tools/ipc_fuzzer/mutate/message_util.cc @@ -73,9 +73,9 @@ bool MessageMatches(const IPC::Message* msg, const RE2& pattern) { } // namespace int main(int argc, char** argv) { - CommandLine::Init(argc, argv); - CommandLine* cmd = CommandLine::ForCurrentProcess(); - CommandLine::StringVector args = cmd->GetArgs(); + base::CommandLine::Init(argc, argv); + base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); + base::CommandLine::StringVector args = cmd->GetArgs(); if (args.size() < 1 || args.size() > 2 || cmd->HasSwitch(kHelpSwitch)) { usage(); diff --git a/tools/ipc_fuzzer/mutate/mutate.cc b/tools/ipc_fuzzer/mutate/mutate.cc index 3a42f4e..68882d0 100644 --- a/tools/ipc_fuzzer/mutate/mutate.cc +++ b/tools/ipc_fuzzer/mutate/mutate.cc @@ -655,9 +655,9 @@ void usage() { } // namespace int MutateMain(int argc, char** argv) { - CommandLine::Init(argc, argv); - CommandLine* cmd = CommandLine::ForCurrentProcess(); - CommandLine::StringVector args = cmd->GetArgs(); + base::CommandLine::Init(argc, argv); + base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); + base::CommandLine::StringVector args = cmd->GetArgs(); if (args.size() != 2 || cmd->HasSwitch(kHelpSwitch)) { usage(); diff --git a/tools/ipc_fuzzer/replay/replay_process.cc b/tools/ipc_fuzzer/replay/replay_process.cc index 1e6f4c2..500e4d4 100644 --- a/tools/ipc_fuzzer/replay/replay_process.cc +++ b/tools/ipc_fuzzer/replay/replay_process.cc @@ -28,10 +28,10 @@ ReplayProcess::~ReplayProcess() { } bool ReplayProcess::Initialize(int argc, const char** argv) { - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); - if (!CommandLine::ForCurrentProcess()->HasSwitch( - switches::kIpcFuzzerTestcase)) { + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kIpcFuzzerTestcase)) { LOG(ERROR) << "This binary shouldn't be executed directly, " << "please use tools/ipc_fuzzer/play_testcase.py"; return false; @@ -52,7 +52,7 @@ bool ReplayProcess::Initialize(int argc, const char** argv) { void ReplayProcess::OpenChannel() { std::string channel_name = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kProcessChannelID); channel_ = IPC::ChannelProxy::Create(channel_name, @@ -62,8 +62,9 @@ void ReplayProcess::OpenChannel() { } bool ReplayProcess::OpenTestcase() { - base::FilePath path = CommandLine::ForCurrentProcess()->GetSwitchValuePath( - switches::kIpcFuzzerTestcase); + base::FilePath path = + base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( + switches::kIpcFuzzerTestcase); return MessageFile::Read(path, &messages_); } diff --git a/tools/perf/clear_system_cache/clear_system_cache_main.cc b/tools/perf/clear_system_cache/clear_system_cache_main.cc index e5f08a1..7b26055 100644 --- a/tools/perf/clear_system_cache/clear_system_cache_main.cc +++ b/tools/perf/clear_system_cache/clear_system_cache_main.cc @@ -22,10 +22,11 @@ void ClearCacheForFile(const base::FilePath& path) { } int main(int argc, const char* argv[]) { - CommandLine::Init(argc, argv); - const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); + base::CommandLine::Init(argc, argv); + const base::CommandLine& parsed_command_line = + *base::CommandLine::ForCurrentProcess(); bool should_recurse = parsed_command_line.HasSwitch("recurse"); - const CommandLine::StringVector& args = parsed_command_line.GetArgs(); + const base::CommandLine::StringVector& args = parsed_command_line.GetArgs(); if (args.size() < 1) { printf("USAGE: %s [--recurse] <files or directories>\n", argv[0]); diff --git a/tools/set_default_handler/set_default_handler_main.cc b/tools/set_default_handler/set_default_handler_main.cc index b07f50a..8b4b343 100644 --- a/tools/set_default_handler/set_default_handler_main.cc +++ b/tools/set_default_handler/set_default_handler_main.cc @@ -28,7 +28,7 @@ const wchar_t kDefaultProtocol[] = L"http"; extern "C" int wmain(int argc, wchar_t* argv[]) { // Initialize the commandline singleton from the environment. - CommandLine::Init(0, NULL); + base::CommandLine::Init(0, NULL); // The exit manager is in charge of calling the dtors of singletons. base::AtExitManager exit_manager; logging::LoggingSettings settings; @@ -38,7 +38,7 @@ int wmain(int argc, wchar_t* argv[]) { ui::win::CreateATLModuleIfNeeded(); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::string16 protocol(command_line->GetSwitchValueNative(kSwitchProtocol)); if (protocol.empty()) protocol = kDefaultProtocol; diff --git a/ui/app_list/app_list_switches.cc b/ui/app_list/app_list_switches.cc index 15722ba..deb52fa 100644 --- a/ui/app_list/app_list_switches.cc +++ b/ui/app_list/app_list_switches.cc @@ -40,9 +40,10 @@ const char kEnableSyncAppList[] = "enable-sync-app-list"; bool IsAppListSyncEnabled() { #if defined(TOOLKIT_VIEWS) - return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableSyncAppList); + return !base::CommandLine::ForCurrentProcess()->HasSwitch( + kDisableSyncAppList); #else - return CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList); + return base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList); #endif } @@ -66,17 +67,19 @@ bool IsVoiceSearchEnabled() { bool IsAppInfoEnabled() { #if defined(TOOLKIT_VIEWS) - return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableAppInfo); + return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableAppInfo); #else return false; #endif } bool IsExperimentalAppListEnabled() { - if (CommandLine::ForCurrentProcess()->HasSwitch(kEnableExperimentalAppList)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + kEnableExperimentalAppList)) return true; - if (CommandLine::ForCurrentProcess()->HasSwitch(kDisableExperimentalAppList)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + kDisableExperimentalAppList)) return false; #if defined(OS_CHROMEOS) @@ -87,18 +90,19 @@ bool IsExperimentalAppListEnabled() { } bool IsCenteredAppListEnabled() { - return CommandLine::ForCurrentProcess()->HasSwitch(kEnableCenteredAppList) || + return base::CommandLine::ForCurrentProcess()->HasSwitch( + kEnableCenteredAppList) || IsExperimentalAppListEnabled(); } bool ShouldNotDismissOnBlur() { - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( kDisableAppListDismissOnBlur); } bool IsDriveAppsInAppListEnabled() { #if defined(OS_CHROMEOS) - return !CommandLine::ForCurrentProcess()->HasSwitch( + return !base::CommandLine::ForCurrentProcess()->HasSwitch( kDisableDriveAppsInAppList); #else return false; diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc index 557fb6d..8375ae3 100644 --- a/ui/app_list/views/app_list_view.cc +++ b/ui/app_list/views/app_list_view.cc @@ -71,7 +71,7 @@ bool SupportsShadow() { #if defined(OS_WIN) // Shadows are not supported on Windows without Aero Glass. if (!ui::win::IsAeroGlassEnabled() || - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kDisableDwmComposition)) { return false; } diff --git a/ui/app_list/views/apps_grid_view_unittest.cc b/ui/app_list/views/apps_grid_view_unittest.cc index e7edc45..a585d93 100644 --- a/ui/app_list/views/apps_grid_view_unittest.cc +++ b/ui/app_list/views/apps_grid_view_unittest.cc @@ -108,7 +108,7 @@ class AppsGridViewTest : public views::ViewsTestBase { protected: void EnsureFoldersEnabled() { // Folders require AppList sync to be enabled. - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableSyncAppList); } diff --git a/ui/aura/bench/bench_main.cc b/ui/aura/bench/bench_main.cc index ebf3131..1e858e4 100644 --- a/ui/aura/bench/bench_main.cc +++ b/ui/aura/bench/bench_main.cc @@ -158,7 +158,7 @@ class WebGLBench : public BenchCompositorObserver { compositor_(compositor), fbo_(0), do_draw_(true) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); do_draw_ = !command_line->HasSwitch("disable-draw"); std::string webgl_size = command_line->GetSwitchValueASCII("webgl-size"); @@ -263,7 +263,7 @@ class SoftwareScrollBench : public BenchCompositorObserver { compositor_(compositor) { compositor->AddObserver(this); layer_->set_draw( - !CommandLine::ForCurrentProcess()->HasSwitch("disable-draw")); + !base::CommandLine::ForCurrentProcess()->HasSwitch("disable-draw")); } ~SoftwareScrollBench() override { compositor_->RemoveObserver(this); } @@ -284,7 +284,7 @@ class SoftwareScrollBench : public BenchCompositorObserver { } // namespace int main(int argc, char** argv) { - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); base::AtExitManager exit_manager; @@ -329,7 +329,7 @@ int main(int argc, char** argv) { Layer content_layer(ui::LAYER_NOT_DRAWN); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); bool force = command_line->HasSwitch("force-render-surface"); content_layer.SetForceRenderSurface(force); gfx::Rect bounds(window.bounds().size()); diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc index fe6ea80..0007ca0 100644 --- a/ui/aura/demo/demo_main.cc +++ b/ui/aura/demo/demo_main.cc @@ -170,7 +170,7 @@ int DemoMain() { } // namespace int main(int argc, char** argv) { - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); // The exit manager is in charge of calling the dtors of singleton objects. base::AtExitManager exit_manager; diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc index 4a73acf..955c010 100644 --- a/ui/aura/gestures/gesture_recognizer_unittest.cc +++ b/ui/aura/gestures/gesture_recognizer_unittest.cc @@ -670,7 +670,7 @@ class GestureRecognizerWithSwitchTest : public GestureRecognizerTest { void SetUp() override { GestureRecognizerTest::SetUp(); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kCompensateForUnstablePinchZoom); ui::GestureConfiguration::GetInstance()->set_min_pinch_update_span_delta(5); } diff --git a/ui/aura/window_tree_host_x11.cc b/ui/aura/window_tree_host_x11.cc index 7239b04..9a8c7f9 100644 --- a/ui/aura/window_tree_host_x11.cc +++ b/ui/aura/window_tree_host_x11.cc @@ -116,10 +116,9 @@ class TouchEventCalibrate : public ui::PlatformEventObserver { if (ui::PlatformEventSource::GetInstance()) ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this); std::vector<std::string> parts; - if (Tokenize(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + if (Tokenize(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kTouchCalibration), - ",", - &parts) >= 4) { + ",", &parts) >= 4) { if (!base::StringToInt(parts[0], &left_)) DLOG(ERROR) << "Incorrect left border calibration value passed."; if (!base::StringToInt(parts[1], &right_)) diff --git a/ui/base/cocoa/remote_layer_api.mm b/ui/base/cocoa/remote_layer_api.mm index 839daa1..9c00683 100644 --- a/ui/base/cocoa/remote_layer_api.mm +++ b/ui/base/cocoa/remote_layer_api.mm @@ -18,7 +18,7 @@ bool RemoteLayerAPISupported() { return false; bool disabled_at_command_line = - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableRemoteCoreAnimation); if (disabled_at_command_line) return false; diff --git a/ui/base/font_helper_chromeos.cc b/ui/base/font_helper_chromeos.cc index 6a77cf2..dc7fb07 100644 --- a/ui/base/font_helper_chromeos.cc +++ b/ui/base/font_helper_chromeos.cc @@ -10,8 +10,8 @@ namespace ui { void ReplaceNotoSansWithRobotoIfEnabled(std::string* font_family) { - if (CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kEnableRobotoFontUI)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableRobotoFontUI)) { static const char kNotoSansUI[] = "Noto Sans UI"; static const size_t kNotoSansUILen = arraysize(kNotoSansUI) - 1; std::string::size_type noto_position = font_family->find(kNotoSansUI); diff --git a/ui/base/ime/chromeos/component_extension_ime_manager.cc b/ui/base/ime/chromeos/component_extension_ime_manager.cc index 077461c..1486826 100644 --- a/ui/base/ime/chromeos/component_extension_ime_manager.cc +++ b/ui/base/ime/chromeos/component_extension_ime_manager.cc @@ -164,8 +164,9 @@ bool ComponentExtensionIMEManager::IsWhitelistedExtension( input_method::InputMethodDescriptors ComponentExtensionIMEManager::GetAllIMEAsInputMethodDescriptor() { - bool enable_new_korean_ime = CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableNewKoreanIme); + bool enable_new_korean_ime = + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableNewKoreanIme); input_method::InputMethodDescriptors result; for (std::map<std::string, ComponentExtensionIME>::const_iterator it = component_extension_imes_.begin(); diff --git a/ui/base/ime/remote_input_method_win.cc b/ui/base/ime/remote_input_method_win.cc index f198fc8..ceb8856 100644 --- a/ui/base/ime/remote_input_method_win.cc +++ b/ui/base/ime/remote_input_method_win.cc @@ -384,8 +384,8 @@ bool IsRemoteInputMethodWinRequired(gfx::AcceleratedWidget widget) { if (!process_handle.IsValid()) return false; return base::win::IsProcessImmersive(process_handle.Get()) || - CommandLine::ForCurrentProcess()->HasSwitch( - switches::kViewerConnect); + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kViewerConnect); } RemoteInputMethodPrivateWin::RemoteInputMethodPrivateWin() {} diff --git a/ui/base/touch/touch_enabled.cc b/ui/base/touch/touch_enabled.cc index 6d2aebf..89d3eac 100644 --- a/ui/base/touch/touch_enabled.cc +++ b/ui/base/touch/touch_enabled.cc @@ -12,7 +12,8 @@ namespace ui { bool AreTouchEventsEnabled() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); const std::string touch_enabled_switch = command_line.HasSwitch(switches::kTouchEvents) ? command_line.GetSwitchValueASCII(switches::kTouchEvents) : diff --git a/ui/base/ui_base_switches_util.cc b/ui/base/ui_base_switches_util.cc index 5fe380a..6dcb9ef 100644 --- a/ui/base/ui_base_switches_util.cc +++ b/ui/base/ui_base_switches_util.cc @@ -13,8 +13,8 @@ bool IsLinkDisambiguationPopupEnabled() { #if defined(OS_ANDROID) return true; #else - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableLinkDisambiguationPopup)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableLinkDisambiguationPopup)) { return true; } return false; @@ -22,33 +22,34 @@ bool IsLinkDisambiguationPopupEnabled() { } bool IsTextInputFocusManagerEnabled() { - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableTextInputFocusManager); } bool IsTouchDragDropEnabled() { #if defined(OS_CHROMEOS) - return !CommandLine::ForCurrentProcess()->HasSwitch( + return !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableTouchDragDrop); #else - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableTouchDragDrop); #endif } bool IsTouchEditingEnabled() { #if defined(USE_AURA) - return !CommandLine::ForCurrentProcess()->HasSwitch( + return !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableTouchEditing); #else - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableTouchEditing); #endif } bool IsTouchFeedbackEnabled() { - static bool touch_feedback_enabled = !CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kDisableTouchFeedback); + static bool touch_feedback_enabled = + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableTouchFeedback); return touch_feedback_enabled; } diff --git a/ui/base/win/shell.cc b/ui/base/win/shell.cc index 4751fc8..9e47f8c 100644 --- a/ui/base/win/shell.cc +++ b/ui/base/win/shell.cc @@ -144,8 +144,8 @@ bool IsAeroGlassEnabled() { // user can specify this command line switch to mimic the behavior. In this // mode, cross-HWND transparency is not supported and various types of // widgets fallback to more simplified rendering behavior. - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableDwmComposition)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableDwmComposition)) return false; // Technically Aero glass works in Vista but we want to put XP and Vista diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc index 088f6ec..0e91726 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc @@ -88,7 +88,7 @@ Compositor::Compositor(gfx::AcceleratedWidget widget, weak_ptr_factory_(this) { root_web_layer_ = cc::Layer::Create(); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); cc::LayerTreeSettings settings; // When impl-side painting is enabled, this will ensure PictureLayers always diff --git a/ui/compositor/compositor_switches.cc b/ui/compositor/compositor_switches.cc index a7ffc14..b041d88 100644 --- a/ui/compositor/compositor_switches.cc +++ b/ui/compositor/compositor_switches.cc @@ -28,13 +28,15 @@ const char kUIShowPaintRects[] = "ui-show-paint-rects"; namespace ui { bool IsUIImplSidePaintingEnabled() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); return command_line.HasSwitch(switches::kUIEnableImplSidePainting); } bool IsUIZeroCopyEnabled() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); return command_line.HasSwitch(switches::kUIEnableZeroCopy); } diff --git a/ui/compositor/test/context_factories_for_test.cc b/ui/compositor/test/context_factories_for_test.cc index f3eeeb3..10dba42 100644 --- a/ui/compositor/test/context_factories_for_test.cc +++ b/ui/compositor/test/context_factories_for_test.cc @@ -24,7 +24,7 @@ namespace ui { ui::ContextFactory* InitializeContextFactoryForTests(bool enable_pixel_output) { DCHECK(!g_implicit_factory) << "ContextFactory for tests already initialized."; - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kEnablePixelOutputInTests)) enable_pixel_output = true; if (enable_pixel_output) diff --git a/ui/compositor/test/in_process_context_factory.cc b/ui/compositor/test/in_process_context_factory.cc index 961f9b1..819f9e8 100644 --- a/ui/compositor/test/in_process_context_factory.cc +++ b/ui/compositor/test/in_process_context_factory.cc @@ -70,7 +70,7 @@ InProcessContextFactory::InProcessContextFactory() << "gfx::GLSurface::InitializeOneOffForTests()"; #if defined(OS_CHROMEOS) - bool use_thread = !CommandLine::ForCurrentProcess()->HasSwitch( + bool use_thread = !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kUIDisableThreadedCompositing); #else bool use_thread = false; diff --git a/ui/events/devices/x11/touch_factory_x11.cc b/ui/events/devices/x11/touch_factory_x11.cc index 0a35527..717e0c7 100644 --- a/ui/events/devices/x11/touch_factory_x11.cc +++ b/ui/events/devices/x11/touch_factory_x11.cc @@ -39,7 +39,7 @@ TouchFactory::TouchFactory() XDisplay* display = gfx::GetXDisplay(); UpdateDeviceList(display); - CommandLine* cmdline = CommandLine::ForCurrentProcess(); + base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); touch_events_disabled_ = cmdline->HasSwitch(switches::kTouchEvents) && cmdline->GetSwitchValueASCII(switches::kTouchEvents) == switches::kTouchEventsDisabled; @@ -59,7 +59,7 @@ void TouchFactory::SetTouchDeviceListFromCommandLine() { // This is primarily used for testing/debugging touch-event processing when a // touch-device isn't available. std::string touch_devices = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kTouchDevices); if (!touch_devices.empty()) { diff --git a/ui/events/gesture_detection/gesture_configuration_aura.cc b/ui/events/gesture_detection/gesture_configuration_aura.cc index 5561688..5608392 100644 --- a/ui/events/gesture_detection/gesture_configuration_aura.cc +++ b/ui/events/gesture_detection/gesture_configuration_aura.cc @@ -25,9 +25,10 @@ class GestureConfigurationAura : public GestureConfiguration { set_gesture_begin_end_types_enabled(true); set_min_gesture_bounds_length(default_radius()); set_min_pinch_update_span_delta( - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kCompensateForUnstablePinchZoom) - ? 5 : 0); + ? 5 + : 0); set_min_scaling_touch_major(default_radius() * 2); set_velocity_tracker_strategy(VelocityTracker::Strategy::LSQ2_RESTRICTED); set_span_slop(max_touch_move_in_pixels_for_click() * 2); diff --git a/ui/events/ozone/evdev/touch_event_converter_evdev.cc b/ui/events/ozone/evdev/touch_event_converter_evdev.cc index ae0293c..c30bba3 100644 --- a/ui/events/ozone/evdev/touch_event_converter_evdev.cc +++ b/ui/events/ozone/evdev/touch_event_converter_evdev.cc @@ -40,10 +40,9 @@ struct TouchCalibration { void GetTouchCalibration(TouchCalibration* cal) { std::vector<std::string> parts; - if (Tokenize(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + if (Tokenize(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kTouchCalibration), - ",", - &parts) >= 4) { + ",", &parts) >= 4) { if (!base::StringToInt(parts[0], &cal->bezel_left)) DLOG(ERROR) << "Incorrect left border calibration value passed."; if (!base::StringToInt(parts[1], &cal->bezel_right)) diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc index 92e4120..e5eb074 100644 --- a/ui/gfx/display.cc +++ b/ui/gfx/display.cc @@ -20,15 +20,16 @@ namespace gfx { namespace { bool HasForceDeviceScaleFactorImpl() { - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kForceDeviceScaleFactor); } float GetForcedDeviceScaleFactorImpl() { double scale_in_double = 1.0; if (HasForceDeviceScaleFactorImpl()) { - std::string value = CommandLine::ForCurrentProcess()-> - GetSwitchValueASCII(switches::kForceDeviceScaleFactor); + std::string value = + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kForceDeviceScaleFactor); if (!base::StringToDouble(value, &scale_in_double)) LOG(ERROR) << "Failed to parse the default device scale factor:" << value; } diff --git a/ui/gfx/font_render_params_linux.cc b/ui/gfx/font_render_params_linux.cc index ea0bac8..627b8e4 100644 --- a/ui/gfx/font_render_params_linux.cc +++ b/ui/gfx/font_render_params_linux.cc @@ -233,7 +233,7 @@ FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query, // flag. params.subpixel_positioning = actual_query.for_web_contents - ? CommandLine::ForCurrentProcess()->HasSwitch( + ? base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableWebkitTextSubpixelPositioning) : IsBrowserTextSubpixelPositioningEnabled(actual_query); diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc index 6d1067f..a95b80f 100644 --- a/ui/gfx/render_text.cc +++ b/ui/gfx/render_text.cc @@ -399,18 +399,21 @@ RenderText::~RenderText() { RenderText* RenderText::CreateInstance() { #if defined(OS_MACOSX) - static const bool use_harfbuzz = CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kEnableHarfBuzzRenderText); + static const bool use_harfbuzz = + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableHarfBuzzRenderText); #else - static const bool use_harfbuzz = !CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kDisableHarfBuzzRenderText); + static const bool use_harfbuzz = + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableHarfBuzzRenderText); #endif return use_harfbuzz ? new RenderTextHarfBuzz : CreateNativeInstance(); } RenderText* RenderText::CreateInstanceForEditing() { - static const bool use_harfbuzz = !CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kDisableHarfBuzzRenderText); + static const bool use_harfbuzz = + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableHarfBuzzRenderText); return use_harfbuzz ? new RenderTextHarfBuzz : CreateNativeInstance(); } diff --git a/ui/gfx/win/direct_write.cc b/ui/gfx/win/direct_write.cc index 2153f2c..8b313af 100644 --- a/ui/gfx/win/direct_write.cc +++ b/ui/gfx/win/direct_write.cc @@ -64,9 +64,9 @@ void MaybeInitializeDirectWrite() { tried_dwrite_initialize = true; if (!ShouldUseDirectWrite() || - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableDirectWriteForUI) || - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableHarfBuzzRenderText)) { return; } diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc index 7f6a647..ab3e48c 100644 --- a/ui/gl/gl_gl_api_implementation.cc +++ b/ui/gl/gl_gl_api_implementation.cc @@ -301,8 +301,8 @@ void InitializeStaticGLBindingsGL() { } g_real_gl->Initialize(&g_driver_gl); g_gl = g_real_gl; - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableGPUServiceTracing)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableGPUServiceTracing)) { g_gl = g_trace_gl; } SetGLToRealGLApi(); diff --git a/ui/gl/gl_implementation_win.cc b/ui/gl/gl_implementation_win.cc index fff9018..ff7d1d1 100644 --- a/ui/gl/gl_implementation_win.cc +++ b/ui/gl/gl_implementation_win.cc @@ -162,7 +162,8 @@ bool InitializeStaticGLBindings(GLImplementation implementation) { LoadD3DXLibrary(module_path, kD3DCompiler); base::FilePath gles_path; - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); bool using_swift_shader = command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"; if (using_swift_shader) { diff --git a/ui/gl/gl_implementation_x11.cc b/ui/gl/gl_implementation_x11.cc index 176f7d2..28c1a3e 100644 --- a/ui/gl/gl_implementation_x11.cc +++ b/ui/gl/gl_implementation_x11.cc @@ -65,7 +65,8 @@ bool InitializeStaticGLBindings(GLImplementation implementation) { return InitializeStaticGLBindingsOSMesaGL(); case kGLImplementationDesktopGL: { base::NativeLibrary library = NULL; - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kTestGLLib)) library = LoadLibraryAndPrintError( diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc index 3de560b..aaf12ac 100644 --- a/ui/gl/gl_surface.cc +++ b/ui/gl/gl_surface.cc @@ -37,7 +37,7 @@ bool GLSurface::InitializeOneOff() { GetAllowedGLImplementations(&allowed_impls); DCHECK(!allowed_impls.empty()); - CommandLine* cmd = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); // The default implementation is always the first one in list. GLImplementation impl = allowed_impls[0]; @@ -108,7 +108,8 @@ void GLSurface::InitializeOneOffForTests() { // We usually use OSMesa as this works on all bots. The command line can // override this behaviour to use hardware GL. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGpuInTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kUseGpuInTests)) use_osmesa = false; #if defined(OS_ANDROID) @@ -124,7 +125,7 @@ void GLSurface::InitializeOneOffForTests() { if (use_osmesa) impl = kGLImplementationOSMesaGL; - DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) + DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) << "kUseGL has not effect in tests"; bool fallback_to_osmesa = false; @@ -137,7 +138,7 @@ void GLSurface::InitializeOneOffForTests() { // static void GLSurface::InitializeOneOffWithMockBindingsForTests() { - DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) + DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) << "kUseGL has not effect in tests"; // This method may be called multiple times in the same process to set up diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc index 4018834..193eebf 100644 --- a/ui/gl/gl_surface_egl.cc +++ b/ui/gl/gl_surface_egl.cc @@ -313,7 +313,7 @@ static const EGLint kDisplayAttribsWarp[] { // static EGLDisplay GLSurfaceEGL::GetPlatformDisplay( EGLNativeDisplayType native_display) { - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseWarp)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseWarp)) { // Check for availability of WARP via ANGLE extension. bool supports_warp = false; const char* no_display_extensions = eglQueryString(EGL_NO_DISPLAY, diff --git a/ui/gl/gl_surface_win.cc b/ui/gl/gl_surface_win.cc index 5cf68afa..0e10bac 100644 --- a/ui/gl/gl_surface_win.cc +++ b/ui/gl/gl_surface_win.cc @@ -353,8 +353,9 @@ scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( } EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11) || - CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseWarp)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableD3D11) || + base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseWarp)) return GetDC(NULL); return EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE; } diff --git a/ui/gl/gpu_switching_manager.cc b/ui/gl/gpu_switching_manager.cc index 020592f..23fc2ff 100644 --- a/ui/gl/gpu_switching_manager.cc +++ b/ui/gl/gpu_switching_manager.cc @@ -73,7 +73,8 @@ void GpuSwitchingManager::ForceUseOfDiscreteGpu() { bool GpuSwitchingManager::SupportsDualGpus() { if (!supports_dual_gpus_set_) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); bool flag = false; if (command_line.HasSwitch(switches::kSupportsDualGpus)) { // GPU process, flag is passed down from browser process. diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc index 4ee23b1..9065ac6 100644 --- a/ui/keyboard/keyboard_controller.cc +++ b/ui/keyboard/keyboard_controller.cc @@ -132,7 +132,7 @@ void ToggleTouchEventLogging(bool enable) { #if defined(OS_CHROMEOS) if (!base::SysInfo::IsRunningOnChromeOS()) return; - CommandLine command( + base::CommandLine command( base::FilePath("/opt/google/touchscreen/toggle_touch_event_logging")); if (enable) command.AppendArg("1"); diff --git a/ui/keyboard/keyboard_util.cc b/ui/keyboard/keyboard_util.cc index 1752fd4..8a67e54 100644 --- a/ui/keyboard/keyboard_util.cc +++ b/ui/keyboard/keyboard_util.cc @@ -105,7 +105,7 @@ bool IsKeyboardEnabled() { if (g_keyboard_show_override == keyboard::KEYBOARD_SHOW_OVERRIDE_DISABLED) return false; // Check if any of the flags are enabled. - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableVirtualKeyboard) || g_touch_keyboard_enabled || (g_keyboard_show_override == keyboard::KEYBOARD_SHOW_OVERRIDE_ENABLED); @@ -127,8 +127,8 @@ bool IsKeyboardOverscrollEnabled() { KEYBOARD_OVERSCROLL_OVERRIDE_ENABLED; } - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableVirtualKeyboardOverscroll)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableVirtualKeyboardOverscroll)) { return false; } return true; @@ -143,17 +143,19 @@ void SetKeyboardShowOverride(KeyboardShowOverride override) { } bool IsInputViewEnabled() { - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableInputView)) return true; - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableInputView)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableInputView)) return false; // Default value if no command line flags specified. return true; } bool IsExperimentalInputViewEnabled() { - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableExperimentalInputViewFeatures)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableExperimentalInputViewFeatures)) { return true; } return false; diff --git a/ui/message_center/views/message_center_view.cc b/ui/message_center/views/message_center_view.cc index 73ef779..24dd10c 100644 --- a/ui/message_center/views/message_center_view.cc +++ b/ui/message_center/views/message_center_view.cc @@ -427,7 +427,7 @@ void MessageListView::DoUpdateIfPossible() { } if (top_down_ || - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval)) AnimateNotificationsBelowTarget(); else diff --git a/ui/native_theme/native_theme_switches.cc b/ui/native_theme/native_theme_switches.cc index ba46d18..873af51 100644 --- a/ui/native_theme/native_theme_switches.cc +++ b/ui/native_theme/native_theme_switches.cc @@ -18,7 +18,8 @@ const char kDisableOverlayScrollbar[] = "disable-overlay-scrollbar"; namespace ui { bool IsOverlayScrollbarEnabled() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kDisableOverlayScrollbar)) return false; diff --git a/ui/ozone/common/display_util.cc b/ui/ozone/common/display_util.cc index 01bc7fa..432e858 100644 --- a/ui/ozone/common/display_util.cc +++ b/ui/ozone/common/display_util.cc @@ -62,7 +62,7 @@ DisplaySnapshot_Params GetDisplaySnapshotParams( DisplaySnapshot_Params CreateSnapshotFromCommandLine() { DisplaySnapshot_Params display_param; - CommandLine* cmd = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); std::string spec = cmd->GetSwitchValueASCII(switches::kOzoneInitialDisplayBounds); std::string physical_spec = diff --git a/ui/ozone/demo/ozone_demo.cc b/ui/ozone/demo/ozone_demo.cc index b096d17..2f6df68 100644 --- a/ui/ozone/demo/ozone_demo.cc +++ b/ui/ozone/demo/ozone_demo.cc @@ -33,7 +33,7 @@ class DemoWindow : public ui::PlatformWindowDelegate { DemoWindow() : widget_(gfx::kNullAcceleratedWidget) { int width = kTestWindowWidth; int height = kTestWindowHeight; - sscanf(CommandLine::ForCurrentProcess() + sscanf(base::CommandLine::ForCurrentProcess() ->GetSwitchValueASCII(kWindowSize) .c_str(), "%dx%d", &width, &height); @@ -53,9 +53,9 @@ class DemoWindow : public ui::PlatformWindowDelegate { gfx::Size GetSize() { return platform_window_->GetBounds().size(); } void Start() { - if (!CommandLine::ForCurrentProcess()->HasSwitch(kDisableGpu) && + if (!base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableGpu) && gfx::GLSurface::InitializeOneOff() && StartInProcessGpu()) { - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kOzoneUseSurfaceless)) { renderer_.reset( new ui::SurfacelessGlRenderer(GetAcceleratedWidget(), GetSize())); @@ -119,7 +119,7 @@ class DemoWindow : public ui::PlatformWindowDelegate { }; int main(int argc, char** argv) { - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); base::AtExitManager exit_manager; // Build UI thread message loop. This is used by platform diff --git a/ui/ozone/platform/dri/gbm_surface_factory.cc b/ui/ozone/platform/dri/gbm_surface_factory.cc index 38ae784..cb0127b 100644 --- a/ui/ozone/platform/dri/gbm_surface_factory.cc +++ b/ui/ozone/platform/dri/gbm_surface_factory.cc @@ -160,7 +160,7 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( OverlayCandidatesOzone* GbmSurfaceFactory::GetOverlayCandidates( gfx::AcceleratedWidget w) { - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kOzoneTestSingleOverlaySupport)) return new SingleOverlay(); return NULL; diff --git a/ui/ozone/platform/dri/ozone_platform_gbm.cc b/ui/ozone/platform/dri/ozone_platform_gbm.cc index c7fca01..6464538 100644 --- a/ui/ozone/platform/dri/ozone_platform_gbm.cc +++ b/ui/ozone/platform/dri/ozone_platform_gbm.cc @@ -196,7 +196,7 @@ class OzonePlatformGbm : public OzonePlatform { } // namespace OzonePlatform* CreateOzonePlatformGbm() { - CommandLine* cmd = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); } diff --git a/ui/ozone/platform/test/ozone_platform_test.cc b/ui/ozone/platform/test/ozone_platform_test.cc index f7e95ac..5cdef6c 100644 --- a/ui/ozone/platform/test/ozone_platform_test.cc +++ b/ui/ozone/platform/test/ozone_platform_test.cc @@ -95,7 +95,7 @@ class OzonePlatformTest : public OzonePlatform { } // namespace OzonePlatform* CreateOzonePlatformTest() { - CommandLine* cmd = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); base::FilePath location; if (cmd->HasSwitch(switches::kOzoneDumpFile)) location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); diff --git a/ui/ozone/platform_selection.cc b/ui/ozone/platform_selection.cc index 823e2bd..1b49a08 100644 --- a/ui/ozone/platform_selection.cc +++ b/ui/ozone/platform_selection.cc @@ -16,10 +16,11 @@ namespace { // Returns the name of the platform to use (value of --ozone-platform flag). std::string GetPlatformName() { // The first platform is the default. - if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kOzonePlatform) && + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kOzonePlatform) && kPlatformCount > 0) return kPlatformNames[0]; - return CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kOzonePlatform); } diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc index 908e7e6..02c725f 100644 --- a/ui/views/controls/textfield/textfield_unittest.cc +++ b/ui/views/controls/textfield/textfield_unittest.cc @@ -1921,7 +1921,7 @@ TEST_F(TextfieldTest, TestLongPressInitiatesDragDrop) { const gfx::Point kStringPoint(GetCursorPositionX(9), 0); // Enable touch-drag-drop to make long press effective. - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableTouchDragDrop); // Create a long press event in the selected region should start a drag. @@ -1968,7 +1968,7 @@ class TextfieldTouchSelectionTest : public TextfieldTest { // TextfieldTest: void SetUp() override { TextfieldTest::SetUp(); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableTouchEditing); } @@ -2042,7 +2042,7 @@ TEST_F(TextfieldTouchSelectionTest, TouchSelectionAndDraggingTest) { // After disabling touch drag drop, long pressing again in the selection // region should not do anything. - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kDisableTouchDragDrop); ASSERT_FALSE(switches::IsTouchDragDropEnabled()); GestureEventForTest long_press_3( diff --git a/ui/views/examples/examples_main.cc b/ui/views/examples/examples_main.cc index b46f9a1..78f1656 100644 --- a/ui/views/examples/examples_main.cc +++ b/ui/views/examples/examples_main.cc @@ -42,7 +42,7 @@ int main(int argc, char** argv) { ui::ScopedOleInitializer ole_initializer_; #endif - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); base::AtExitManager at_exit; diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc index 078b733..a62c4ca 100644 --- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc +++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc @@ -66,7 +66,7 @@ class TouchSelectionControllerImplTest : public ViewsTestBase { widget_(nullptr), textfield_(nullptr), views_tsc_factory_(new ViewsTouchEditingControllerFactory) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableTouchEditing); ui::TouchEditingControllerFactory::SetInstance(views_tsc_factory_.get()); } diff --git a/ui/views/views_switches.cc b/ui/views/views_switches.cc index df711c8..41d2ce5 100644 --- a/ui/views/views_switches.cc +++ b/ui/views/views_switches.cc @@ -27,8 +27,8 @@ const char kEnableTransparentVisuals[] = "enable-transparent-visuals"; bool IsRectBasedTargetingEnabled() { #if defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_LINUX) - return !CommandLine::ForCurrentProcess()-> - HasSwitch(kDisableViewsRectBasedTargeting); + return !base::CommandLine::ForCurrentProcess()->HasSwitch( + kDisableViewsRectBasedTargeting); #else return false; #endif diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc index 5688da2..9a7851d 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc @@ -1034,10 +1034,10 @@ void DesktopWindowTreeHostX11::InitX11Window( // use the ARGB visual. Otherwise, just use our parent's visual. Visual* visual = CopyFromParent; int depth = CopyFromParent; - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableTransparentVisuals) && - XGetSelectionOwner(xdisplay_, - atom_cache_.GetAtom("_NET_WM_CM_S0")) != None) { + XGetSelectionOwner(xdisplay_, atom_cache_.GetAtom("_NET_WM_CM_S0")) != + None) { Visual* rgba_visual = GetARGBVisual(); if (rgba_visual) { visual = rgba_visual; diff --git a/ui/views/widget/widget_interactive_uitest.cc b/ui/views/widget/widget_interactive_uitest.cc index 9c10a88..a901b13 100644 --- a/ui/views/widget/widget_interactive_uitest.cc +++ b/ui/views/widget/widget_interactive_uitest.cc @@ -759,7 +759,8 @@ TEST_F(WidgetTestInteractive, CanActivateFlagIsHonored) { // Test that touch selection quick menu is not activated when opened. TEST_F(WidgetTestInteractive, TouchSelectionQuickMenuIsNotActivated) { - CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableTouchEditing); + base::CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableTouchEditing); #if defined(OS_WIN) views_delegate().set_use_desktop_native_widgets(true); #endif // !defined(OS_WIN) diff --git a/ui/views_content_client/views_content_main_delegate.cc b/ui/views_content_client/views_content_main_delegate.cc index 1fb3a69..c930577 100644 --- a/ui/views_content_client/views_content_main_delegate.cc +++ b/ui/views_content_client/views_content_main_delegate.cc @@ -40,7 +40,8 @@ ViewsContentMainDelegate::~ViewsContentMainDelegate() { } bool ViewsContentMainDelegate::BasicStartupComplete(int* exit_code) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); diff --git a/ui/wm/core/window_animations.cc b/ui/wm/core/window_animations.cc index 03bb1b9..ce15472 100644 --- a/ui/wm/core/window_animations.cc +++ b/ui/wm/core/window_animations.cc @@ -653,7 +653,7 @@ bool WindowAnimationsDisabled(aura::Window* window) { return true; // Animations can be disabled globally for testing. - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kWindowAnimationsDisabled)) return true; diff --git a/win8/delegate_execute/command_execute_impl.cc b/win8/delegate_execute/command_execute_impl.cc index e027078..d50037d 100644 --- a/win8/delegate_execute/command_execute_impl.cc +++ b/win8/delegate_execute/command_execute_impl.cc @@ -91,7 +91,7 @@ bool LaunchChromeBrowserProcess() { return false; } - CommandLine cl(chrome_exe_path); + base::CommandLine cl(chrome_exe_path); // Prevent a Chrome window from showing up on the desktop. cl.AppendSwitch(switches::kSilentLaunch); @@ -167,7 +167,7 @@ bool CommandExecuteImpl::path_provider_initialized_ = false; // mode again. // CommandExecuteImpl::CommandExecuteImpl() - : parameters_(CommandLine::NO_PROGRAM), + : parameters_(base::CommandLine::NO_PROGRAM), launch_scheme_(INTERNET_SCHEME_DEFAULT), integrity_level_(base::INTEGRITY_UNKNOWN) { memset(&start_info_, 0, sizeof(start_info_)); @@ -391,9 +391,8 @@ HRESULT CommandExecuteImpl::LaunchDesktopChrome() { break; } - CommandLine chrome( - delegate_execute::MakeChromeCommandLine(chrome_exe_, parameters_, - display_name)); + base::CommandLine chrome(delegate_execute::MakeChromeCommandLine( + chrome_exe_, parameters_, display_name)); base::string16 command_line(chrome.GetCommandLineString()); AtlTrace("Formatted command line is %ls\n", command_line.c_str()); @@ -454,11 +453,11 @@ EC_HOST_UI_MODE CommandExecuteImpl::GetLaunchMode() { if (parameters_.HasSwitch(switches::kForceImmersive)) { launch_mode = ECHUIM_IMMERSIVE; launch_mode_determined = true; - parameters_ = CommandLine(CommandLine::NO_PROGRAM); + parameters_ = base::CommandLine(base::CommandLine::NO_PROGRAM); } else if (parameters_.HasSwitch(switches::kForceDesktop)) { launch_mode = ECHUIM_DESKTOP; launch_mode_determined = true; - parameters_ = CommandLine(CommandLine::NO_PROGRAM); + parameters_ = base::CommandLine(base::CommandLine::NO_PROGRAM); } base::win::RegKey reg_key; diff --git a/win8/delegate_execute/delegate_execute.cc b/win8/delegate_execute/delegate_execute.cc index 118bfe2..0d2bbbb 100644 --- a/win8/delegate_execute/delegate_execute.cc +++ b/win8/delegate_execute/delegate_execute.cc @@ -146,7 +146,7 @@ int RelaunchChrome(const DelegateExecuteOperation& operation) { bool found_exe = CommandExecuteImpl::FindChromeExe(&chrome_exe_path); DCHECK(found_exe); if (found_exe) { - bool launch_ash = CommandLine::ForCurrentProcess()->HasSwitch( + bool launch_ash = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kForceImmersive); if (launch_ash) { AtlTrace(L"Relaunching Chrome into Windows ASH on Windows 7\n"); @@ -182,10 +182,10 @@ extern "C" int WINAPI _tWinMain(HINSTANCE , HINSTANCE, LPTSTR, int nShowCmd) { base::AtExitManager exit_manager; AtlTrace("delegate_execute enter\n"); - CommandLine::Init(0, NULL); + base::CommandLine::Init(0, NULL); HRESULT ret_code = E_UNEXPECTED; DelegateExecuteOperation operation; - if (operation.Init(CommandLine::ForCurrentProcess())) { + if (operation.Init(base::CommandLine::ForCurrentProcess())) { switch (operation.operation_type()) { case DelegateExecuteOperation::DELEGATE_EXECUTE: ret_code = _AtlModule.WinMain(nShowCmd); diff --git a/win8/delegate_execute/delegate_execute_operation.cc b/win8/delegate_execute/delegate_execute_operation.cc index ac36427..a4a61a12 100644 --- a/win8/delegate_execute/delegate_execute_operation.cc +++ b/win8/delegate_execute/delegate_execute_operation.cc @@ -20,7 +20,7 @@ DelegateExecuteOperation::DelegateExecuteOperation() DelegateExecuteOperation::~DelegateExecuteOperation() { } -bool DelegateExecuteOperation::Init(const CommandLine* cmd_line) { +bool DelegateExecuteOperation::Init(const base::CommandLine* cmd_line) { if (base::win::GetVersion() >= base::win::VERSION_WIN7) { base::FilePath shortcut( cmd_line->GetSwitchValuePath(switches::kRelaunchShortcut)); diff --git a/win8/delegate_execute/delegate_execute_util.cc b/win8/delegate_execute/delegate_execute_util.cc index 78203ed..87a5fb6 100644 --- a/win8/delegate_execute/delegate_execute_util.cc +++ b/win8/delegate_execute/delegate_execute_util.cc @@ -9,8 +9,8 @@ namespace delegate_execute { -CommandLine CommandLineFromParameters(const wchar_t* params) { - CommandLine command_line(CommandLine::NO_PROGRAM); +base::CommandLine CommandLineFromParameters(const wchar_t* params) { + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); if (params) { base::string16 command_string(L"noprogram.exe "); @@ -22,10 +22,10 @@ CommandLine CommandLineFromParameters(const wchar_t* params) { return command_line; } -CommandLine MakeChromeCommandLine(const base::FilePath& chrome_exe, - const CommandLine& params, - const base::string16& argument) { - CommandLine chrome_cmd(params); +base::CommandLine MakeChromeCommandLine(const base::FilePath& chrome_exe, + const base::CommandLine& params, + const base::string16& argument) { + base::CommandLine chrome_cmd(params); chrome_cmd.SetProgram(chrome_exe); if (!argument.empty()) @@ -38,7 +38,7 @@ base::string16 ParametersFromSwitch(const char* a_switch) { if (!a_switch) return base::string16(); - CommandLine cmd_line(CommandLine::NO_PROGRAM); + base::CommandLine cmd_line(base::CommandLine::NO_PROGRAM); cmd_line.AppendSwitch(a_switch); diff --git a/win8/delegate_execute/delegate_execute_util_unittest.cc b/win8/delegate_execute/delegate_execute_util_unittest.cc index 49c1776..63a5075 100644 --- a/win8/delegate_execute/delegate_execute_util_unittest.cc +++ b/win8/delegate_execute/delegate_execute_util_unittest.cc @@ -19,12 +19,12 @@ static const char kSomeSwitch[] = "some-switch"; } // namespace TEST(DelegateExecuteUtil, CommandLineFromParametersTest) { - CommandLine cl(CommandLine::NO_PROGRAM); + base::CommandLine cl(base::CommandLine::NO_PROGRAM); // Empty parameters means empty command-line string. cl = delegate_execute::CommandLineFromParameters(NULL); EXPECT_EQ(std::wstring(), cl.GetProgram().value()); - EXPECT_EQ(CommandLine::StringType(), cl.GetCommandLineString()); + EXPECT_EQ(base::CommandLine::StringType(), cl.GetCommandLineString()); // Parameters with a switch are parsed properly. cl = delegate_execute::CommandLineFromParameters( @@ -37,9 +37,10 @@ TEST(DelegateExecuteUtil, CommandLineFromParametersTest) { TEST(DelegateExecuteUtil, MakeChromeCommandLineTest) { static const wchar_t kSomeArgument[] = L"http://some.url/"; static const wchar_t kOtherArgument[] = L"http://some.other.url/"; - const base::FilePath this_exe(CommandLine::ForCurrentProcess()->GetProgram()); + const base::FilePath this_exe( + base::CommandLine::ForCurrentProcess()->GetProgram()); - CommandLine cl(CommandLine::NO_PROGRAM); + base::CommandLine cl(base::CommandLine::NO_PROGRAM); // Empty params and argument contains only the exe. cl = delegate_execute::MakeChromeCommandLine( @@ -68,7 +69,7 @@ TEST(DelegateExecuteUtil, MakeChromeCommandLineTest) { EXPECT_EQ(5, cl.argv().size()); EXPECT_EQ(this_exe.value(), cl.GetProgram().value()); EXPECT_TRUE(cl.HasSwitch(kSomeSwitch)); - CommandLine::StringVector args(cl.GetArgs()); + base::CommandLine::StringVector args(cl.GetArgs()); EXPECT_EQ(2, args.size()); EXPECT_NE( args.end(), diff --git a/win8/metro_driver/chrome_url_launch_handler.cc b/win8/metro_driver/chrome_url_launch_handler.cc index 7c99b13..f37706c 100644 --- a/win8/metro_driver/chrome_url_launch_handler.cc +++ b/win8/metro_driver/chrome_url_launch_handler.cc @@ -108,8 +108,9 @@ base::string16 ChromeUrlLaunchHandler::GetUrlFromLaunchArgs( } base::string16 dummy_command_line(L"dummy.exe "); dummy_command_line.append(launch_args); - CommandLine command_line = CommandLine::FromString(dummy_command_line); - CommandLine::StringVector args = command_line.GetArgs(); + base::CommandLine command_line = + base::CommandLine::FromString(dummy_command_line); + base::CommandLine::StringVector args = command_line.GetArgs(); if (args.size() > 0) return args[0]; diff --git a/win8/metro_driver/metro_driver.cc b/win8/metro_driver/metro_driver.cc index a60af6b..4eedfdc 100644 --- a/win8/metro_driver/metro_driver.cc +++ b/win8/metro_driver/metro_driver.cc @@ -85,7 +85,7 @@ int InitMetro() { if (base::win::GetVersion() < base::win::VERSION_WIN7) return 1; // Initialize the command line. - CommandLine::Init(0, NULL); + base::CommandLine::Init(0, NULL); // Initialize the logging system. logging::LoggingSettings settings; settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; diff --git a/win8/test/metro_registration_helper.cc b/win8/test/metro_registration_helper.cc index 59b2235..160f602 100644 --- a/win8/test/metro_registration_helper.cc +++ b/win8/test/metro_registration_helper.cc @@ -50,7 +50,7 @@ bool RegisterTestDefaultBrowser() { } // Perform the registration by invoking test_registrar.exe. - CommandLine register_command(registrar); + base::CommandLine register_command(registrar); register_command.AppendArg("/RegServer"); base::Process register_process = diff --git a/win8/test/test_registrar.cc b/win8/test/test_registrar.cc index b5cec10..0387bb4 100644 --- a/win8/test/test_registrar.cc +++ b/win8/test/test_registrar.cc @@ -33,7 +33,7 @@ const wchar_t kDelegateExecuteCLSID[] = L"{FC0064A6-D1DE-4A83-92D2-5BB4EEBB70B5}"; void InitializeCommandLineDefaultValues() { - CommandLine& command_line = *CommandLine::ForCurrentProcess(); + base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(win8::test::kTestAppUserModelId)) command_line.AppendSwitchNative(win8::test::kTestAppUserModelId, @@ -80,7 +80,7 @@ class TestDelegateExecuteModule registrar->AddReplacement(L"DELEGATE_EXECUTE_CLSID", kDelegateExecuteCLSID); - CommandLine& command_line = *CommandLine::ForCurrentProcess(); + base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); registrar->AddReplacement(L"APP_USER_MODEL_ID", command_line.GetSwitchValueNative( @@ -129,7 +129,7 @@ class ATL_NO_VTABLE DECLSPEC_UUID("FC0064A6-D1DE-4A83-92D2-5BB4EEBB70B5") extern "C" int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int nShowCmd) { base::AtExitManager exit_manager; - CommandLine::Init(0, NULL); + base::CommandLine::Init(0, NULL); InitializeCommandLineDefaultValues(); HRESULT ret_code = _AtlModule.WinMain(nShowCmd); |