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 // Makes a given program ("Google Chrome" by default) the default handler for | 5 // Makes a given program ("Google Chrome" by default) the default handler for |
6 // some URL protocol ("http" by default) on Windows 8. These defaults can be | 6 // some URL protocol ("http" by default) on Windows 8. These defaults can be |
7 // overridden via the --program and --protocol command line switches. | 7 // overridden via the --program and --protocol command line switches. |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 std::vector<base::string16> choices; | 50 std::vector<base::string16> choices; |
51 HRESULT result = S_OK; | 51 HRESULT result = S_OK; |
52 win8::OpenWithDialogController controller; | 52 win8::OpenWithDialogController controller; |
53 result = controller.RunSynchronously(NULL, protocol, program, &choices); | 53 result = controller.RunSynchronously(NULL, protocol, program, &choices); |
54 | 54 |
55 if (SUCCEEDED(result)) { | 55 if (SUCCEEDED(result)) { |
56 printf("success\n"); | 56 printf("success\n"); |
57 } else if (!choices.empty()) { | 57 } else if (!choices.empty()) { |
58 printf("failed to set program. possible choices: %ls\n", | 58 printf("failed to set program. possible choices: %ls\n", |
59 JoinString(choices, L", ").c_str()); | 59 base::JoinString(choices, L", ").c_str()); |
60 } else { | 60 } else { |
61 printf("failed with HRESULT: %0x08X\n", result); | 61 printf("failed with HRESULT: %0x08X\n", result); |
62 } | 62 } |
63 | 63 |
64 return FAILED(result); | 64 return FAILED(result); |
65 } | 65 } |
OLD | NEW |