summaryrefslogtreecommitdiffstats
path: root/cloud_print/service/win
diff options
context:
space:
mode:
authorpgal.u-szeged <pgal.u-szeged@partner.samsung.com>2014-11-18 18:06:03 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-19 02:06:18 +0000
commit588a3ead6ef36c3ccb9dd51dd028c251a4fb511b (patch)
tree07deba5a66eff63e8482ae1b1e87688c209014ff /cloud_print/service/win
parent539d8860344b808a289bf9361da51621a57c03a4 (diff)
downloadchromium_src-588a3ead6ef36c3ccb9dd51dd028c251a4fb511b.zip
chromium_src-588a3ead6ef36c3ccb9dd51dd028c251a4fb511b.tar.gz
chromium_src-588a3ead6ef36c3ccb9dd51dd028c251a4fb511b.tar.bz2
Prefix CommandLine usage with base namespace (Part 7: cloud_print/)
Prefix all CommandLine usage in the cloud_print/ directory with the base:: namespace. R=vitalybuka@chromium.org BUG=422426 Review URL: https://codereview.chromium.org/735053002 Cr-Commit-Position: refs/heads/master@{#304744}
Diffstat (limited to 'cloud_print/service/win')
-rw-r--r--cloud_print/service/win/chrome_launcher.cc8
-rw-r--r--cloud_print/service/win/cloud_print_service.cc10
-rw-r--r--cloud_print/service/win/cloud_print_service_config.cc2
-rw-r--r--cloud_print/service/win/installer.cc5
-rw-r--r--cloud_print/service/win/service_controller.cc6
-rw-r--r--cloud_print/service/win/service_utils.cc4
6 files changed, 19 insertions, 16 deletions
diff --git a/cloud_print/service/win/chrome_launcher.cc b/cloud_print/service/win/chrome_launcher.cc
index 5dd876d..d63dc8f 100644
--- a/cloud_print/service/win/chrome_launcher.cc
+++ b/cloud_print/service/win/chrome_launcher.cc
@@ -67,7 +67,7 @@ void CloseChrome(HANDLE process, DWORD thread_id) {
ShutdownChrome(process, thread_id);
}
-bool LaunchProcess(const CommandLine& cmdline,
+bool LaunchProcess(const base::CommandLine& cmdline,
base::win::ScopedHandle* process_handle,
DWORD* thread_id) {
STARTUPINFO startup_info = {};
@@ -149,7 +149,7 @@ void DeleteAutorunKeys(const base::FilePath& user_data_dir) {
base::win::RegistryValueIterator value(HKEY_CURRENT_USER, kAutoRunKeyPath);
for (; value.Valid(); ++value) {
if (value.Type() == REG_SZ && value.Value()) {
- CommandLine cmd = CommandLine::FromString(value.Value());
+ base::CommandLine cmd = base::CommandLine::FromString(value.Value());
if (cmd.GetSwitchValueASCII(switches::kProcessType) ==
switches::kServiceProcess &&
cmd.HasSwitch(switches::kUserDataDir)) {
@@ -201,7 +201,7 @@ void ChromeLauncher::Run() {
base::FilePath chrome_path = chrome_launcher_support::GetAnyChromePath();
if (!chrome_path.empty()) {
- CommandLine cmd(chrome_path);
+ base::CommandLine cmd(chrome_path);
CopyChromeSwitchesFromCurrentProcess(&cmd);
// Required switches.
@@ -278,7 +278,7 @@ std::string ChromeLauncher::CreateServiceStateFile(
return std::string();
}
- CommandLine cmd(chrome_path);
+ base::CommandLine cmd(chrome_path);
CopyChromeSwitchesFromCurrentProcess(&cmd);
cmd.AppendSwitchPath(switches::kUserDataDir, temp_user_data.path());
cmd.AppendSwitchPath(switches::kCloudPrintSetupProxy, printers_file);
diff --git a/cloud_print/service/win/cloud_print_service.cc b/cloud_print/service/win/cloud_print_service.cc
index 5565269..18d9a198 100644
--- a/cloud_print/service/win/cloud_print_service.cc
+++ b/cloud_print/service/win/cloud_print_service.cc
@@ -154,7 +154,7 @@ class CloudPrintServiceModule
bool ParseCommandLine(LPCTSTR lpCmdLine, HRESULT* pnRetCode) {
CHECK(pnRetCode);
- CommandLine command_line(CommandLine::NO_PROGRAM);
+ base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
command_line.ParseFromString(lpCmdLine);
LOG(INFO) << command_line.GetCommandLineString();
@@ -198,7 +198,8 @@ class CloudPrintServiceModule
}
private:
- HRESULT ParseCommandLine(const CommandLine& command_line, bool* is_service) {
+ HRESULT ParseCommandLine(const base::CommandLine& command_line,
+ bool* is_service) {
if (!is_service)
return E_INVALIDARG;
*is_service = false;
@@ -404,7 +405,8 @@ BOOL CloudPrintServiceModule::ConsoleCtrlHandler(DWORD type) {
}
int main(int argc, char** argv) {
- CommandLine::Init(argc, argv);
+ base::CommandLine::Init(argc, argv);
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
base::AtExitManager at_exit;
logging::LoggingSettings settings;
@@ -412,7 +414,7 @@ int main(int argc, char** argv) {
logging::InitLogging(settings);
logging::SetMinLogLevel(
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableLogging) ?
+ command_line->HasSwitch(switches::kEnableLogging) ?
logging::LOG_INFO : logging::LOG_FATAL);
return _AtlModule.WinMain(0);
diff --git a/cloud_print/service/win/cloud_print_service_config.cc b/cloud_print/service/win/cloud_print_service_config.cc
index a1e13dba..f188f2c 100644
--- a/cloud_print/service/win/cloud_print_service_config.cc
+++ b/cloud_print/service/win/cloud_print_service_config.cc
@@ -443,7 +443,7 @@ int WINAPI WinMain(__in HINSTANCE hInstance,
__in LPSTR lpCmdLine,
__in int nCmdShow) {
base::AtExitManager at_exit;
- CommandLine::Init(0, NULL);
+ base::CommandLine::Init(0, NULL);
base::MessageLoopForUI loop;
scoped_refptr<SetupDialog> dialog(new SetupDialog());
diff --git a/cloud_print/service/win/installer.cc b/cloud_print/service/win/installer.cc
index e3ff6a4..312af6e 100644
--- a/cloud_print/service/win/installer.cc
+++ b/cloud_print/service/win/installer.cc
@@ -77,7 +77,8 @@ void DeleteShortcuts() {
} // namespace
HRESULT ProcessInstallerSwitches() {
- const CommandLine& command_line(*CommandLine::ForCurrentProcess());
+ const base::CommandLine& command_line(
+ *base::CommandLine::ForCurrentProcess());
if (command_line.HasSwitch(kInstallSwitch)) {
base::FilePath old_location =
@@ -139,6 +140,6 @@ int WINAPI WinMain(__in HINSTANCE hInstance,
__in LPSTR lpCmdLine,
__in int nCmdShow) {
base::AtExitManager at_exit;
- CommandLine::Init(0, NULL);
+ base::CommandLine::Init(0, NULL);
return ProcessInstallerSwitches();
}
diff --git a/cloud_print/service/win/service_controller.cc b/cloud_print/service/win/service_controller.cc
index 0c269b9..102e998 100644
--- a/cloud_print/service/win/service_controller.cc
+++ b/cloud_print/service/win/service_controller.cc
@@ -83,7 +83,7 @@ HRESULT OpenService(const base::string16& name, DWORD access,
ServiceController::ServiceController()
: name_(cloud_print::LoadLocalString(IDS_SERVICE_NAME)),
- command_line_(CommandLine::NO_PROGRAM) {
+ command_line_(base::CommandLine::NO_PROGRAM) {
}
ServiceController::~ServiceController() {
@@ -164,7 +164,7 @@ HRESULT ServiceController::InstallService(const base::string16& user,
base::FilePath service_path = GetBinary();
if (!base::PathExists(service_path))
return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
- CommandLine command_line(service_path);
+ base::CommandLine command_line(service_path);
command_line.AppendSwitch(run_switch);
if (!user_data_dir.empty())
command_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir);
@@ -304,7 +304,7 @@ void ServiceController::UpdateState() {
return;
}
- command_line_ = CommandLine::FromString(config->lpBinaryPathName);
+ command_line_ = base::CommandLine::FromString(config->lpBinaryPathName);
if (!command_line_.HasSwitch(kServiceSwitch)) {
state_ = STATE_NOT_FOUND;
return;
diff --git a/cloud_print/service/win/service_utils.cc b/cloud_print/service/win/service_utils.cc
index b71bca2..6bced80 100644
--- a/cloud_print/service/win/service_utils.cc
+++ b/cloud_print/service/win/service_utils.cc
@@ -48,7 +48,7 @@ base::string16 GetCurrentUserName() {
return result;
}
-void CopyChromeSwitchesFromCurrentProcess(CommandLine* destination) {
+void CopyChromeSwitchesFromCurrentProcess(base::CommandLine* destination) {
static const char* const kSwitchesToCopy[] = {
switches::kCloudPrintURL,
switches::kCloudPrintXmppEndpoint,
@@ -58,7 +58,7 @@ void CopyChromeSwitchesFromCurrentProcess(CommandLine* destination) {
switches::kLsoUrl,
switches::kV,
};
- destination->CopySwitchesFrom(*CommandLine::ForCurrentProcess(),
+ destination->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(),
kSwitchesToCopy,
arraysize(kSwitchesToCopy));
}