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

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

Issue 152143003: [ProtocolHandlers] Add a permission bubble client for RPH requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 dbeda49a088579a2bc60211604999f0137ddae93..733e935d834f1c1791d4216eaf9227b55038828a 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry.cc
+++ b/chrome/browser/custom_handlers/protocol_handler_registry.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/profiles/profile_io_data.h"
+#include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/custom_handlers/protocol_handler.h"
#include "chrome/common/pref_names.h"
@@ -332,6 +333,17 @@ bool ProtocolHandlerRegistry::SilentlyHandleRegisterHandlerRequest(
return false;
}
+void ProtocolHandlerRegistry::RequestPermission(
+ content::WebContents* web_contents,
+ const ProtocolHandler& handler) {
+ if (PermissionBubbleManager::Enabled()) {
+ return;
+ }
+
+ RegisterProtocolHandlerInfoBarDelegate::Create(
+ InfoBarService::FromWebContents(web_contents), this, handler);
+}
+
void ProtocolHandlerRegistry::OnAcceptRegisterProtocolHandler(
const ProtocolHandler& handler) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));

Powered by Google App Engine
This is Rietveld 408576698