| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 return Base::PostMessageLoop(); | 174 return Base::PostMessageLoop(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 private: | 177 private: |
| 178 HRESULT ParseCommandLine(const CommandLine& command_line, bool* is_service) { | 178 HRESULT ParseCommandLine(const CommandLine& command_line, bool* is_service) { |
| 179 if (!is_service) | 179 if (!is_service) |
| 180 return E_INVALIDARG; | 180 return E_INVALIDARG; |
| 181 *is_service = false; | 181 *is_service = false; |
| 182 | 182 |
| 183 user_data_dir_switch_ = | 183 user_data_dir_switch_ = |
| 184 command_line.GetSwitchValuePath(switches::kUserDataDir); | 184 command_line.GetSwitchValuePath(switches::kUserDataDir).AsAbsolute(); |
| 185 file_util::AbsolutePath(&user_data_dir_switch_); | |
| 186 if (command_line.HasSwitch(kStopSwitch)) | 185 if (command_line.HasSwitch(kStopSwitch)) |
| 187 return controller_->StopService(); | 186 return controller_->StopService(); |
| 188 | 187 |
| 189 if (command_line.HasSwitch(kUninstallSwitch)) | 188 if (command_line.HasSwitch(kUninstallSwitch)) |
| 190 return controller_->UninstallService(); | 189 return controller_->UninstallService(); |
| 191 | 190 |
| 192 if (command_line.HasSwitch(kInstallSwitch)) { | 191 if (command_line.HasSwitch(kInstallSwitch)) { |
| 193 string16 run_as_user; | 192 string16 run_as_user; |
| 194 string16 run_as_password; | 193 string16 run_as_password; |
| 195 base::FilePath user_data_dir; | 194 base::FilePath user_data_dir; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 PostThreadMessage(_AtlModule.m_dwThreadID, WM_QUIT, 0, 0); | 380 PostThreadMessage(_AtlModule.m_dwThreadID, WM_QUIT, 0, 0); |
| 382 return TRUE; | 381 return TRUE; |
| 383 } | 382 } |
| 384 | 383 |
| 385 int main(int argc, char** argv) { | 384 int main(int argc, char** argv) { |
| 386 CommandLine::Init(argc, argv); | 385 CommandLine::Init(argc, argv); |
| 387 base::AtExitManager at_exit; | 386 base::AtExitManager at_exit; |
| 388 return _AtlModule.WinMain(0); | 387 return _AtlModule.WinMain(0); |
| 389 } | 388 } |
| 390 | 389 |
| OLD | NEW |