summaryrefslogtreecommitdiffstats
path: root/chrome/browser/custom_handlers
diff options
context:
space:
mode:
authorkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-22 15:45:31 +0000
committerkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-22 15:45:31 +0000
commite24be072268be5ca69f68b9fffdc872e3444c320 (patch)
treeb66f6364cb8604d99b6ea0c4746910e2d65ac1d8 /chrome/browser/custom_handlers
parentf95f89147dbc66f2b3c54f6e8179c9400607338c (diff)
downloadchromium_src-e24be072268be5ca69f68b9fffdc872e3444c320.zip
chromium_src-e24be072268be5ca69f68b9fffdc872e3444c320.tar.gz
chromium_src-e24be072268be5ca69f68b9fffdc872e3444c320.tar.bz2
Makes it so that when a user clicks "No" in the infobar that asks if they want to register a protocol handler, it adds the protocol to the ignored list for that user, which means it won't show up in their right-click menu for links with that protocol, and appears in an ignored list in the settings at chrome://settings/handlers
TEST=Manual testing Review URL: http://codereview.chromium.org/7358012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93636 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/custom_handlers')
-rw-r--r--chrome/browser/custom_handlers/protocol_handler_registry.cc6
-rw-r--r--chrome/browser/custom_handlers/protocol_handler_registry.h3
-rw-r--r--chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc4
3 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry.cc b/chrome/browser/custom_handlers/protocol_handler_registry.cc
index 0418a4fa..745e2af 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry.cc
+++ b/chrome/browser/custom_handlers/protocol_handler_registry.cc
@@ -74,6 +74,11 @@ ProtocolHandlerRegistry::GetHandlersFor(
return p->second;
}
+ProtocolHandlerRegistry::ProtocolHandlerList
+ProtocolHandlerRegistry::GetIgnoredHandlers() {
+ return ignored_protocol_handlers_;
+}
+
void ProtocolHandlerRegistry::RegisterProtocolHandler(
const ProtocolHandler& handler) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -416,6 +421,7 @@ void ProtocolHandlerRegistry::OnIgnoreRegisterProtocolHandler(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
IgnoreProtocolHandler(handler);
Save();
+ NotifyChanged();
}
// static
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry.h b/chrome/browser/custom_handlers/protocol_handler_registry.h
index 776078d..445751d 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry.h
+++ b/chrome/browser/custom_handlers/protocol_handler_registry.h
@@ -112,6 +112,9 @@ class ProtocolHandlerRegistry
// Get the list of protocol handlers for the given scheme.
ProtocolHandlerList GetHandlersFor(const std::string& scheme) const;
+ // Get the list of ignored protocol handlers.
+ ProtocolHandlerList GetIgnoredHandlers();
+
// Yields a list of the protocols that have handlers registered in this
// registry.
void GetRegisteredProtocols(std::vector<std::string>* output) const;
diff --git a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
index d78e159..d614e43 100644
--- a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
+++ b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
@@ -30,7 +30,7 @@ bool RegisterProtocolHandlerInfoBarDelegate::ShouldExpire(
}
InfoBarDelegate::Type
- RegisterProtocolHandlerInfoBarDelegate::GetInfoBarType() const {
+RegisterProtocolHandlerInfoBarDelegate::GetInfoBarType() const {
return PAGE_ACTION_TYPE;
}
@@ -68,7 +68,7 @@ bool RegisterProtocolHandlerInfoBarDelegate::Accept() {
}
bool RegisterProtocolHandlerInfoBarDelegate::Cancel() {
- registry_->OnDenyRegisterProtocolHandler(handler_);
+ registry_->OnIgnoreRegisterProtocolHandler(handler_);
return true;
}