Make callers of CommandLine use it via the base:: namespace.
Covers testing/, tools/, ui/, and win8/. BUG=422426 TEST=none TBR=ben@chromium.org Review URL: https://codereview.chromium.org/819223002 Cr-Commit-Position: refs/heads/master@{#309538}
This commit is contained in:
testing/android
tools
android
gn
command_check.cccommand_desc.cccommand_gen.cccommand_help.cccommand_ls.cccommand_refs.ccexec_process.ccfunction_exec_script.ccgn_main.ccninja_build_writer.ccscheduler.ccsetup.cctrace.cc
imagediff
ipc_fuzzer
perf
clear_system_cache
set_default_handler
ui
app_list
aura
base
compositor
events
devices
gesture_detection
ozone
gfx
gl
gl_gl_api_implementation.ccgl_implementation_win.ccgl_implementation_x11.ccgl_surface.ccgl_surface_egl.ccgl_surface_win.ccgpu_switching_manager.cc
keyboard
message_center
native_theme
ozone
views
views_content_client
wm
win8
@@ -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));
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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],
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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,
|
||||
|
@@ -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;
|
||||
|
@@ -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 " +
|
||||
|
@@ -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();
|
||||
|
@@ -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.
|
||||
|
@@ -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");
|
||||
|
@@ -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,
|
||||
|
@@ -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) {
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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))
|
||||
|
@@ -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.
|
||||
|
@@ -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()));
|
||||
}
|
||||
|
@@ -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]),
|
||||
|
@@ -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";
|
||||
|
@@ -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();
|
||||
|
@@ -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();
|
||||
|
@@ -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_);
|
||||
}
|
||||
|
||||
|
@@ -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]);
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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());
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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_))
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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();
|
||||
|
@@ -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() {}
|
||||
|
@@ -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) :
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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)
|
||||
|
@@ -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;
|
||||
|
@@ -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()) {
|
||||
|
@@ -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);
|
||||
|
@@ -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))
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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();
|
||||
|
@@ -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) {
|
||||
|
@@ -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(
|
||||
|
@@ -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
|
||||
|
@@ -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,
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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.
|
||||
|
@@ -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");
|
||||
|
@@ -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;
|
||||
|
@@ -427,7 +427,7 @@ void MessageListView::DoUpdateIfPossible() {
|
||||
}
|
||||
|
||||
if (top_down_ ||
|
||||
CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval))
|
||||
AnimateNotificationsBelowTarget();
|
||||
else
|
||||
|
@@ -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;
|
||||
|
@@ -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 =
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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));
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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(
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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());
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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));
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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(),
|
||||
|
@@ -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];
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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 =
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user