Index: chrome/browser/custom_handlers/protocol_handler_registry.cc |
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry.cc b/chrome/browser/custom_handlers/protocol_handler_registry.cc |
index 2e75d8d21196424546aab41b69e74fe367a776de..70f0ca37bbb3cb2676613925ea85f17c327f989e 100644 |
--- a/chrome/browser/custom_handlers/protocol_handler_registry.cc |
+++ b/chrome/browser/custom_handlers/protocol_handler_registry.cc |
@@ -84,7 +84,7 @@ void ProtocolHandlerRegistry::RegisterProtocolHandler( |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(CanSchemeBeOverridden(handler.protocol())); |
DCHECK(!handler.IsEmpty()); |
- if (HasRegisteredEquivalent(handler)) { |
+ if (IsRegistered(handler)) { |
return; |
} |
if (enabled_ && !delegate_->IsExternalHandlerRegistered(handler.protocol())) |
@@ -428,6 +428,20 @@ Value* ProtocolHandlerRegistry::EncodeIgnoredHandlers() { |
return handlers; |
} |
+bool ProtocolHandlerRegistry::SilentlyHandleRegisterHandlerRequest( |
+ const ProtocolHandler& handler) { |
+ if (handler.IsEmpty() || !CanSchemeBeOverridden(handler.protocol())) |
+ return true; |
+ |
+ if (!enabled() || IsRegistered(handler) || HasIgnoredEquivalent(handler)) |
+ return true; |
+ |
+ if (AttemptReplace(handler)) |
+ return true; |
+ |
+ return false; |
+} |
+ |
void ProtocolHandlerRegistry::OnAcceptRegisterProtocolHandler( |
const ProtocolHandler& handler) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |