Index: cloud_print/service/win/service_controller.cc |
diff --git a/cloud_print/service/win/service_controller.cc b/cloud_print/service/win/service_controller.cc |
index 428f2829b0a83c8cecbf509355c574ac40b7af78..e3e05e713ecf6efb5734264760686dc1ea2bfffc 100644 |
--- a/cloud_print/service/win/service_controller.cc |
+++ b/cloud_print/service/win/service_controller.cc |
@@ -1,5 +1,5 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
#include "cloud_print/service/win/service_controller.h" |
@@ -114,7 +114,8 @@ HRESULT ServiceController::StopService() { |
HRESULT ServiceController::InstallService(const string16& user, |
const string16& password, |
const std::string& run_switch, |
- const base::FilePath& user_data_dir) { |
+ const base::FilePath& user_data_dir, |
+ bool auto_start) { |
// TODO(vitalybuka): consider "lite" version if we don't want unregister |
// printers here. |
HRESULT hr = UninstallService(); |
@@ -152,9 +153,10 @@ HRESULT ServiceController::InstallService(const string16& user, |
ServiceHandle service( |
::CreateService( |
scm, name_.c_str(), name_.c_str(), SERVICE_ALL_ACCESS, |
- SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, |
- command_line.GetCommandLineString().c_str(), NULL, NULL, NULL, |
- user.empty() ? NULL : user.c_str(), |
+ SERVICE_WIN32_OWN_PROCESS, |
+ auto_start ? SERVICE_AUTO_START : SERVICE_DEMAND_START, |
+ SERVICE_ERROR_NORMAL, command_line.GetCommandLineString().c_str(), |
+ NULL, NULL, NULL, user.empty() ? NULL : user.c_str(), |
password.empty() ? NULL : password.c_str())); |
if (!service.IsValid()) { |