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 11 matching lines...) Expand all Loading... |
22 #include "cloud_print/service/service_state.h" | 22 #include "cloud_print/service/service_state.h" |
23 #include "cloud_print/service/service_switches.h" | 23 #include "cloud_print/service/service_switches.h" |
24 #include "cloud_print/service/win/chrome_launcher.h" | 24 #include "cloud_print/service/win/chrome_launcher.h" |
25 #include "cloud_print/service/win/service_controller.h" | 25 #include "cloud_print/service/win/service_controller.h" |
26 #include "cloud_print/service/win/service_listener.h" | 26 #include "cloud_print/service/win/service_listener.h" |
27 #include "cloud_print/service/win/service_utils.h" | 27 #include "cloud_print/service/win/service_utils.h" |
28 #include "cloud_print/service/win/setup_listener.h" | 28 #include "cloud_print/service/win/setup_listener.h" |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 const wchar_t kAppDataSubDir[] = L"Google\\Cloud Printe Service"; | 32 const wchar_t kAppDataSubDir[] = L"Google\\Cloud Print Service"; |
33 | 33 |
34 void InvalidUsage() { | 34 void InvalidUsage() { |
35 base::FilePath service_path; | 35 base::FilePath service_path; |
36 CHECK(PathService::Get(base::FILE_EXE, &service_path)); | 36 CHECK(PathService::Get(base::FILE_EXE, &service_path)); |
37 | 37 |
38 std::cout << "Usage: "; | 38 std::cout << "Usage: "; |
39 std::cout << service_path.BaseName().value(); | 39 std::cout << service_path.BaseName().value(); |
40 std::cout << " ["; | 40 std::cout << " ["; |
41 std::cout << "["; | 41 std::cout << "["; |
42 std::cout << "["; | 42 std::cout << "["; |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 continue; | 267 continue; |
268 } | 268 } |
269 if (setup.user_data_dir().empty()) { | 269 if (setup.user_data_dir().empty()) { |
270 LOG(ERROR) << "Service can't access user data dir."; | 270 LOG(ERROR) << "Service can't access user data dir."; |
271 continue; | 271 continue; |
272 } | 272 } |
273 if (setup.chrome_path().empty()) { | 273 if (setup.chrome_path().empty()) { |
274 LOG(ERROR) << "Chrome is not available for " << *run_as_user << "."; | 274 LOG(ERROR) << "Chrome is not available for " << *run_as_user << "."; |
275 continue; | 275 continue; |
276 } | 276 } |
277 if (!setup.is_xps_availible()) { | 277 if (!setup.is_xps_available()) { |
278 LOG(ERROR) << "XPS pack is not installed."; | 278 LOG(ERROR) << "XPS pack is not installed."; |
279 continue; | 279 continue; |
280 } | 280 } |
281 | 281 |
282 std::cout << "\nService requirements check result: \n"; | 282 std::cout << "\nService requirements check result: \n"; |
283 std::cout << "Username: " << setup.user_name()<< "\n"; | 283 std::cout << "Username: " << setup.user_name()<< "\n"; |
284 std::cout << "Chrome: " << setup.chrome_path().value()<< "\n"; | 284 std::cout << "Chrome: " << setup.chrome_path().value()<< "\n"; |
285 std::cout << "UserDataDir: " << setup.user_data_dir().value()<< "\n"; | 285 std::cout << "UserDataDir: " << setup.user_data_dir().value()<< "\n"; |
286 std::cout << "Printers:\n "; | 286 std::cout << "Printers:\n "; |
287 std::ostream_iterator<std::string> cout_it(std::cout, "\n "); | 287 std::ostream_iterator<std::string> cout_it(std::cout, "\n "); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 PostThreadMessage(_AtlModule.m_dwThreadID, WM_QUIT, 0, 0); | 384 PostThreadMessage(_AtlModule.m_dwThreadID, WM_QUIT, 0, 0); |
385 return TRUE; | 385 return TRUE; |
386 } | 386 } |
387 | 387 |
388 int main(int argc, char** argv) { | 388 int main(int argc, char** argv) { |
389 CommandLine::Init(argc, argv); | 389 CommandLine::Init(argc, argv); |
390 base::AtExitManager at_exit; | 390 base::AtExitManager at_exit; |
391 return _AtlModule.WinMain(0); | 391 return _AtlModule.WinMain(0); |
392 } | 392 } |
393 | 393 |
OLD | NEW |