| 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 |
| 11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "base/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "ui/base/win/atl_module.h" | 16 #include "ui/base/win/atl_module.h" |
| 17 #include "win8/test/open_with_dialog_controller.h" | 17 #include "win8/test/open_with_dialog_controller.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 const char kSwitchProgram[] = "program"; | 21 const char kSwitchProgram[] = "program"; |
| 22 const char kSwitchProtocol[] = "protocol"; | 22 const char kSwitchProtocol[] = "protocol"; |
| 23 const wchar_t kDefaultProgram[] = L"Google Chrome"; | 23 const wchar_t kDefaultProgram[] = L"Google Chrome"; |
| 24 const wchar_t kDefaultProtocol[] = L"http"; | 24 const wchar_t kDefaultProtocol[] = L"http"; |
| 25 | 25 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 printf("success\n"); | 57 printf("success\n"); |
| 58 } else if (!choices.empty()) { | 58 } else if (!choices.empty()) { |
| 59 printf("failed to set program. possible choices: %ls\n", | 59 printf("failed to set program. possible choices: %ls\n", |
| 60 JoinString(choices, L", ").c_str()); | 60 JoinString(choices, L", ").c_str()); |
| 61 } else { | 61 } else { |
| 62 printf("failed with HRESULT: 0x08X\n", result); | 62 printf("failed with HRESULT: 0x08X\n", result); |
| 63 } | 63 } |
| 64 | 64 |
| 65 return FAILED(result); | 65 return FAILED(result); |
| 66 } | 66 } |
| OLD | NEW |