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 #include <atlbase.h> | 5 #include <atlbase.h> |
6 #include <security.h> | 6 #include <security.h> |
7 | 7 |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <iostream> | 9 #include <iostream> |
10 | 10 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 private: | 178 private: |
179 HRESULT ParseCommandLine(const CommandLine& command_line, bool* is_service) { | 179 HRESULT ParseCommandLine(const CommandLine& command_line, bool* is_service) { |
180 if (!is_service) | 180 if (!is_service) |
181 return E_INVALIDARG; | 181 return E_INVALIDARG; |
182 *is_service = false; | 182 *is_service = false; |
183 | 183 |
184 user_data_dir_switch_ = | 184 user_data_dir_switch_ = |
185 command_line.GetSwitchValuePath(switches::kUserDataDir); | 185 command_line.GetSwitchValuePath(switches::kUserDataDir); |
186 if (!user_data_dir_switch_.empty()) | 186 if (!user_data_dir_switch_.empty()) |
187 file_util::AbsolutePath(&user_data_dir_switch_); | 187 user_data_dir_switch_ = base::MakeAbsoluteFilePath(user_data_dir_switch_); |
188 if (command_line.HasSwitch(kStopSwitch)) | 188 if (command_line.HasSwitch(kStopSwitch)) |
189 return controller_->StopService(); | 189 return controller_->StopService(); |
190 | 190 |
191 if (command_line.HasSwitch(kUninstallSwitch)) | 191 if (command_line.HasSwitch(kUninstallSwitch)) |
192 return controller_->UninstallService(); | 192 return controller_->UninstallService(); |
193 | 193 |
194 if (command_line.HasSwitch(kInstallSwitch)) { | 194 if (command_line.HasSwitch(kInstallSwitch)) { |
195 string16 run_as_user; | 195 string16 run_as_user; |
196 string16 run_as_password; | 196 string16 run_as_password; |
197 base::FilePath user_data_dir; | 197 base::FilePath user_data_dir; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 PostThreadMessage(_AtlModule.m_dwThreadID, WM_QUIT, 0, 0); | 385 PostThreadMessage(_AtlModule.m_dwThreadID, WM_QUIT, 0, 0); |
386 return TRUE; | 386 return TRUE; |
387 } | 387 } |
388 | 388 |
389 int main(int argc, char** argv) { | 389 int main(int argc, char** argv) { |
390 CommandLine::Init(argc, argv); | 390 CommandLine::Init(argc, argv); |
391 base::AtExitManager at_exit; | 391 base::AtExitManager at_exit; |
392 return _AtlModule.WinMain(0); | 392 return _AtlModule.WinMain(0); |
393 } | 393 } |
394 | 394 |
OLD | NEW |