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 <shlobj.h> | 7 #include <shlobj.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 // presence of test_registrar.exe, a viewer process, and all needed DLLs in the | 36 // presence of test_registrar.exe, a viewer process, and all needed DLLs in the |
37 // same directory as the calling module. | 37 // same directory as the calling module. |
38 bool RegisterTestDefaultBrowser() { | 38 bool RegisterTestDefaultBrowser() { |
39 base::FilePath dir; | 39 base::FilePath dir; |
40 if (!PathService::Get(base::DIR_EXE, &dir)) | 40 if (!PathService::Get(base::DIR_EXE, &dir)) |
41 return false; | 41 return false; |
42 | 42 |
43 base::FilePath chrome_exe(dir.Append(kChromeExe)); | 43 base::FilePath chrome_exe(dir.Append(kChromeExe)); |
44 base::FilePath registrar(dir.Append(kRegistrar)); | 44 base::FilePath registrar(dir.Append(kRegistrar)); |
45 | 45 |
46 if (!file_util::PathExists(chrome_exe) || !file_util::PathExists(registrar)) { | 46 if (!base::PathExists(chrome_exe) || !base::PathExists(registrar)) { |
47 LOG(ERROR) << "Could not locate " << kChromeExe << " or " << kRegistrar; | 47 LOG(ERROR) << "Could not locate " << kChromeExe << " or " << kRegistrar; |
48 return false; | 48 return false; |
49 } | 49 } |
50 | 50 |
51 // Perform the registration by invoking test_registrar.exe. | 51 // Perform the registration by invoking test_registrar.exe. |
52 CommandLine register_command(registrar); | 52 CommandLine register_command(registrar); |
53 register_command.AppendArg("/RegServer"); | 53 register_command.AppendArg("/RegServer"); |
54 | 54 |
55 base::win::ScopedHandle register_handle; | 55 base::win::ScopedHandle register_handle; |
56 if (base::LaunchProcess(register_command, base::LaunchOptions(), | 56 if (base::LaunchProcess(register_command, base::LaunchOptions(), |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 std::vector<base::string16> choices; | 122 std::vector<base::string16> choices; |
123 OpenWithDialogController controller; | 123 OpenWithDialogController controller; |
124 HRESULT hr = controller.RunSynchronously( | 124 HRESULT hr = controller.RunSynchronously( |
125 NULL, kDefaultBrowserProtocol, win8::test::kDefaultTestExeName, &choices); | 125 NULL, kDefaultBrowserProtocol, win8::test::kDefaultTestExeName, &choices); |
126 LOG_IF(ERROR, FAILED(hr)) << std::hex << hr; | 126 LOG_IF(ERROR, FAILED(hr)) << std::hex << hr; |
127 DCHECK(IsTestDefaultForProtocol(kDefaultBrowserProtocol)); | 127 DCHECK(IsTestDefaultForProtocol(kDefaultBrowserProtocol)); |
128 return SUCCEEDED(hr); | 128 return SUCCEEDED(hr); |
129 } | 129 } |
130 | 130 |
131 } // namespace win8 | 131 } // namespace win8 |
OLD | NEW |