OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Work around warning in atlbase.h | 5 // Work around warning in atlbase.h |
6 // https://connect.microsoft.com/VisualStudio/feedback/details/1032199/atlbase-h -gives-warning-c4189-when-compiling-with-atl-no-com-support | 6 // https://connect.microsoft.com/VisualStudio/feedback/details/1032199/atlbase-h -gives-warning-c4189-when-compiling-with-atl-no-com-support |
7 #pragma warning(push) | 7 #pragma warning(push) |
8 #pragma warning(disable:4189) | 8 #pragma warning(disable:4189) |
9 #include <atlbase.h> | 9 #include <atlbase.h> |
10 #pragma warning(pop) | 10 #pragma warning(pop) |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include "base/callback_helpers.h" | 21 #include "base/callback_helpers.h" |
22 #include "base/command_line.h" | 22 #include "base/command_line.h" |
23 #include "base/files/file_util.h" | 23 #include "base/files/file_util.h" |
24 #include "base/guid.h" | 24 #include "base/guid.h" |
25 #include "base/logging.h" | 25 #include "base/logging.h" |
26 #include "base/path_service.h" | 26 #include "base/path_service.h" |
27 #include "base/strings/string_util.h" | 27 #include "base/strings/string_util.h" |
28 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
29 #include "base/win/scoped_handle.h" | 29 #include "base/win/scoped_handle.h" |
30 #include "chrome/common/chrome_constants.h" | 30 #include "chrome/common/chrome_constants.h" |
31 #include "chrome/common/chrome_paths.h" | |
31 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
32 #include "cloud_print/common/win/cloud_print_utils.h" | 33 #include "cloud_print/common/win/cloud_print_utils.h" |
33 #include "cloud_print/service/service_constants.h" | 34 #include "cloud_print/service/service_constants.h" |
34 #include "cloud_print/service/service_state.h" | 35 #include "cloud_print/service/service_state.h" |
35 #include "cloud_print/service/service_switches.h" | 36 #include "cloud_print/service/service_switches.h" |
36 #include "cloud_print/service/win/chrome_launcher.h" | 37 #include "cloud_print/service/win/chrome_launcher.h" |
37 #include "cloud_print/service/win/service_controller.h" | 38 #include "cloud_print/service/win/service_controller.h" |
38 #include "cloud_print/service/win/service_listener.h" | 39 #include "cloud_print/service/win/service_listener.h" |
39 #include "cloud_print/service/win/service_utils.h" | 40 #include "cloud_print/service/win/service_utils.h" |
40 #include "cloud_print/service/win/setup_listener.h" | 41 #include "cloud_print/service/win/setup_listener.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 return Base::PostMessageLoop(); | 203 return Base::PostMessageLoop(); |
203 } | 204 } |
204 | 205 |
205 private: | 206 private: |
206 HRESULT ParseCommandLine(const base::CommandLine& command_line, | 207 HRESULT ParseCommandLine(const base::CommandLine& command_line, |
207 bool* is_service) { | 208 bool* is_service) { |
208 if (!is_service) | 209 if (!is_service) |
209 return E_INVALIDARG; | 210 return E_INVALIDARG; |
210 *is_service = false; | 211 *is_service = false; |
211 | 212 |
212 user_data_dir_switch_ = | 213 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_switch_); |
grt (UTC plus 2)
2015/03/26 18:36:22
leave this one alone, too
noms (inactive)
2015/03/30 14:06:33
Done.
| |
213 command_line.GetSwitchValuePath(switches::kUserDataDir); | |
214 if (!user_data_dir_switch_.empty()) | 214 if (!user_data_dir_switch_.empty()) |
215 user_data_dir_switch_ = base::MakeAbsoluteFilePath(user_data_dir_switch_); | 215 user_data_dir_switch_ = base::MakeAbsoluteFilePath(user_data_dir_switch_); |
216 | 216 |
217 if (command_line.HasSwitch(kStopSwitch)) | 217 if (command_line.HasSwitch(kStopSwitch)) |
218 return controller_->StopService(); | 218 return controller_->StopService(); |
219 | 219 |
220 if (command_line.HasSwitch(kUninstallSwitch)) | 220 if (command_line.HasSwitch(kUninstallSwitch)) |
221 return controller_->UninstallService(); | 221 return controller_->UninstallService(); |
222 | 222 |
223 if (command_line.HasSwitch(kInstallSwitch)) { | 223 if (command_line.HasSwitch(kInstallSwitch)) { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 417 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
418 logging::InitLogging(settings); | 418 logging::InitLogging(settings); |
419 | 419 |
420 logging::SetMinLogLevel( | 420 logging::SetMinLogLevel( |
421 command_line->HasSwitch(switches::kEnableLogging) ? | 421 command_line->HasSwitch(switches::kEnableLogging) ? |
422 logging::LOG_INFO : logging::LOG_FATAL); | 422 logging::LOG_INFO : logging::LOG_FATAL); |
423 | 423 |
424 return _AtlModule.WinMain(0); | 424 return _AtlModule.WinMain(0); |
425 } | 425 } |
426 | 426 |
OLD | NEW |