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 15 matching lines...) Expand all Loading... |
26 } // namespace | 26 } // namespace |
27 | 27 |
28 extern "C" | 28 extern "C" |
29 int wmain(int argc, wchar_t* argv[]) { | 29 int wmain(int argc, wchar_t* argv[]) { |
30 // Initialize the commandline singleton from the environment. | 30 // Initialize the commandline singleton from the environment. |
31 CommandLine::Init(0, NULL); | 31 CommandLine::Init(0, NULL); |
32 // The exit manager is in charge of calling the dtors of singletons. | 32 // The exit manager is in charge of calling the dtors of singletons. |
33 base::AtExitManager exit_manager; | 33 base::AtExitManager exit_manager; |
34 logging::LoggingSettings settings; | 34 logging::LoggingSettings settings; |
35 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 35 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
36 settings.dcheck_state = | |
37 logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS; | |
38 logging::InitLogging(settings); | 36 logging::InitLogging(settings); |
39 logging::SetMinLogLevel(logging::LOG_VERBOSE); | 37 logging::SetMinLogLevel(logging::LOG_VERBOSE); |
40 | 38 |
41 ui::win::CreateATLModuleIfNeeded(); | 39 ui::win::CreateATLModuleIfNeeded(); |
42 | 40 |
43 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 41 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
44 base::string16 protocol(command_line->GetSwitchValueNative(kSwitchProtocol)); | 42 base::string16 protocol(command_line->GetSwitchValueNative(kSwitchProtocol)); |
45 if (protocol.empty()) | 43 if (protocol.empty()) |
46 protocol = kDefaultProtocol; | 44 protocol = kDefaultProtocol; |
47 | 45 |
(...skipping 10 matching lines...) Expand all Loading... |
58 printf("success\n"); | 56 printf("success\n"); |
59 } else if (!choices.empty()) { | 57 } else if (!choices.empty()) { |
60 printf("failed to set program. possible choices: %ls\n", | 58 printf("failed to set program. possible choices: %ls\n", |
61 JoinString(choices, L", ").c_str()); | 59 JoinString(choices, L", ").c_str()); |
62 } else { | 60 } else { |
63 printf("failed with HRESULT: %0x08X\n", result); | 61 printf("failed with HRESULT: %0x08X\n", result); |
64 } | 62 } |
65 | 63 |
66 return FAILED(result); | 64 return FAILED(result); |
67 } | 65 } |
OLD | NEW |