OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/custom_handlers/protocol_handler_registry.h" | 5 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // If true default protocol handlers will be removed if the OS level | 32 // If true default protocol handlers will be removed if the OS level |
33 // registration for a protocol is no longer Chrome. | 33 // registration for a protocol is no longer Chrome. |
34 bool ShouldRemoveHandlersNotInOS() { | 34 bool ShouldRemoveHandlersNotInOS() { |
35 #if defined(OS_LINUX) | 35 #if defined(OS_LINUX) |
36 // We don't do this on Linux as the OS registration there is not reliable, | 36 // We don't do this on Linux as the OS registration there is not reliable, |
37 // and Chrome OS doesn't have any notion of OS registration. | 37 // and Chrome OS doesn't have any notion of OS registration. |
38 // TODO(benwells): When Linux support is more reliable remove this | 38 // TODO(benwells): When Linux support is more reliable remove this |
39 // difference (http://crbug.com/88255). | 39 // difference (http://crbug.com/88255). |
40 return false; | 40 return false; |
41 #else | 41 #else |
42 return ShellIntegration::CanSetAsDefaultProtocolClient(); | 42 return ShellIntegration::CanSetAsDefaultProtocolClient() != |
| 43 ShellIntegration::SET_DEFAULT_NOT_ALLOWED; |
43 #endif | 44 #endif |
44 } | 45 } |
45 | 46 |
46 } // namespace | 47 } // namespace |
47 | 48 |
48 static const ProtocolHandler& LookupHandler( | 49 static const ProtocolHandler& LookupHandler( |
49 const ProtocolHandlerRegistry::ProtocolHandlerMap& handler_map, | 50 const ProtocolHandlerRegistry::ProtocolHandlerMap& handler_map, |
50 const std::string& scheme) { | 51 const std::string& scheme) { |
51 ProtocolHandlerRegistry::ProtocolHandlerMap::const_iterator p = | 52 ProtocolHandlerRegistry::ProtocolHandlerMap::const_iterator p = |
52 handler_map.find(scheme); | 53 handler_map.find(scheme); |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 715 |
715 void ProtocolHandlerRegistry::AddPredefinedHandler( | 716 void ProtocolHandlerRegistry::AddPredefinedHandler( |
716 const ProtocolHandler& handler) { | 717 const ProtocolHandler& handler) { |
717 // If called after the load command was issued this function will fail. | 718 // If called after the load command was issued this function will fail. |
718 DCHECK(!is_loaded_); | 719 DCHECK(!is_loaded_); |
719 RegisterProtocolHandler(handler); | 720 RegisterProtocolHandler(handler); |
720 SetDefault(handler); | 721 SetDefault(handler); |
721 } | 722 } |
722 | 723 |
723 | 724 |
OLD | NEW |