OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "win8/test/metro_registration_helper.h" | 5 #include "win8/test/metro_registration_helper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // Copied from util_constants.cc to avoid taking a dependency on installer_util. | 21 // Copied from util_constants.cc to avoid taking a dependency on installer_util. |
22 const wchar_t kChromeExe[] = L"chrome.exe"; | 22 const wchar_t kChromeExe[] = L"chrome.exe"; |
23 const wchar_t kRegistrar[] = L"test_registrar.exe"; | 23 const wchar_t kRegistrar[] = L"test_registrar.exe"; |
24 | 24 |
25 } | 25 } |
26 | 26 |
27 namespace win8 { | 27 namespace win8 { |
28 | 28 |
29 bool RegisterTestDefaultBrowser(const string16& app_user_model_id, | 29 bool RegisterTestDefaultBrowser(const string16& app_user_model_id, |
30 const string16& viewer_process_name) { | 30 const string16& viewer_process_name) { |
31 FilePath dir; | 31 base::FilePath dir; |
32 if (!PathService::Get(base::DIR_EXE, &dir)) | 32 if (!PathService::Get(base::DIR_EXE, &dir)) |
33 return false; | 33 return false; |
34 | 34 |
35 FilePath chrome_exe(dir.Append(kChromeExe)); | 35 base::FilePath chrome_exe(dir.Append(kChromeExe)); |
36 FilePath registrar(dir.Append(kRegistrar)); | 36 base::FilePath registrar(dir.Append(kRegistrar)); |
37 | 37 |
38 if (!file_util::PathExists(chrome_exe) || !file_util::PathExists(registrar)) { | 38 if (!file_util::PathExists(chrome_exe) || !file_util::PathExists(registrar)) { |
39 LOG(ERROR) << "Could not locate " << kChromeExe << " or " << kRegistrar; | 39 LOG(ERROR) << "Could not locate " << kChromeExe << " or " << kRegistrar; |
40 return false; | 40 return false; |
41 } | 41 } |
42 | 42 |
43 // Perform the registration by invoking test_registrar.exe with the | 43 // Perform the registration by invoking test_registrar.exe with the |
44 // necessary flags: | 44 // necessary flags: |
45 // test_registrar.exe /RegServer --appid=<appid> --exe-name=<name> | 45 // test_registrar.exe /RegServer --appid=<appid> --exe-name=<name> |
46 CommandLine register_command(registrar); | 46 CommandLine register_command(registrar); |
(...skipping 22 matching lines...) Expand all Loading... |
69 << register_command.GetCommandLineString() << " timed out."; | 69 << register_command.GetCommandLineString() << " timed out."; |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 PLOG(ERROR) << "Failed to launch Win8 registration utility using " | 73 PLOG(ERROR) << "Failed to launch Win8 registration utility using " |
74 << register_command.GetCommandLineString(); | 74 << register_command.GetCommandLineString(); |
75 return false; | 75 return false; |
76 } | 76 } |
77 | 77 |
78 } // namespace win8 | 78 } // namespace win8 |
OLD | NEW |