Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1440)

Unified Diff: chrome/browser/custom_handlers/protocol_handler_registry.cc

Issue 8371023: Calls to rph updating existing handlers are ignored. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));

Powered by Google App Engine
This is Rietveld 408576698