summaryrefslogtreecommitdiffstats
path: root/win8
diff options
context:
space:
mode:
authoravi <avi@chromium.org>2014-12-22 21:51:23 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-23 05:52:27 +0000
commit6b10fd03dd0b8ddb91235c49d3f498fb2002c20d (patch)
treed7aab532283c818d2103fc9b5ca8bcf29d50b2c8 /win8
parentb126eb8f934f25877b0e6d992902e88eac3fec7f (diff)
downloadchromium_src-6b10fd03dd0b8ddb91235c49d3f498fb2002c20d.zip
chromium_src-6b10fd03dd0b8ddb91235c49d3f498fb2002c20d.tar.gz
chromium_src-6b10fd03dd0b8ddb91235c49d3f498fb2002c20d.tar.bz2
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}
Diffstat (limited to 'win8')
-rw-r--r--win8/delegate_execute/command_execute_impl.cc13
-rw-r--r--win8/delegate_execute/delegate_execute.cc6
-rw-r--r--win8/delegate_execute/delegate_execute_operation.cc2
-rw-r--r--win8/delegate_execute/delegate_execute_util.cc14
-rw-r--r--win8/delegate_execute/delegate_execute_util_unittest.cc11
-rw-r--r--win8/metro_driver/chrome_url_launch_handler.cc5
-rw-r--r--win8/metro_driver/metro_driver.cc2
-rw-r--r--win8/test/metro_registration_helper.cc2
-rw-r--r--win8/test/test_registrar.cc6
9 files changed, 31 insertions, 30 deletions
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);