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

Unified Diff: chrome/browser/content_settings/tab_specific_content_settings.h

Issue 10584042: Bring up a content settings icon for ungestured registerProtocolHandler call. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make windows happy Created 8 years, 6 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/content_settings/tab_specific_content_settings.h
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.h b/chrome/browser/content_settings/tab_specific_content_settings.h
index ab3719db04ee4c2c6c8d965f269aad9f0e30209a..9fb97b926f92e93bcf8b942c4f3c2aea80a473c9 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.h
+++ b/chrome/browser/content_settings/tab_specific_content_settings.h
@@ -17,6 +17,7 @@
#include "chrome/browser/geolocation/geolocation_settings_state.h"
#include "chrome/common/content_settings.h"
#include "chrome/common/content_settings_types.h"
+#include "chrome/common/custom_handlers/protocol_handler.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
@@ -169,6 +170,41 @@ class TabSpecificContentSettings : public content::WebContentsObserver,
return geolocation_settings_state_;
}
+ // Call to indicate that there is a protocol handler pending user approval.
+ void SetPendingProtocolHandler(const ProtocolHandler& handler) {
Bernhard Bauer 2012/06/25 16:52:20 Trivial setters/getters should be named unix_hacke
Greg Billock 2012/06/26 19:17:04 Done.
+ pending_protocol_handler_ = handler;
+ }
+
+ const ProtocolHandler& GetPendingProtocolHandler() const {
+ return pending_protocol_handler_;
+ }
+
+ void ClearPendingProtocolHandler() {
+ pending_protocol_handler_ = ProtocolHandler::EmptyProtocolHandler();
+ }
+
+
+ // Sets the previous protocol handler which will be replaced by the
+ // pending protocol handler.
+ void SetPreviousProtocolHandler(const ProtocolHandler& handler) {
+ previous_protocol_handler_ = handler;
+ }
+
+ const ProtocolHandler& GetPreviousProtocolHandler() const {
+ return previous_protocol_handler_;
+ }
+
+ // Set whether the setting for the pending handler is DEFAULT (ignore),
+ // ALLOW, or DENY.
+ void SetPendingProtocolHandlerSetting(ContentSetting setting) {
+ pending_protocol_handler_setting_ = setting;
+ }
+
+ ContentSetting GetPendingProtocolHandlerSetting() const {
+ return pending_protocol_handler_setting_;
+ }
+
+
// Returns a pointer to the |LocalSharedObjectsContainer| that contains all
// allowed local shared objects like cookies, local storage, ... .
const LocalSharedObjectsContainer& allowed_local_shared_objects() const {
@@ -280,6 +316,20 @@ class TabSpecificContentSettings : public content::WebContentsObserver,
// Manages information about Geolocation API usage in this page.
GeolocationSettingsState geolocation_settings_state_;
+ // The pending protocol handler, if any. This can be set if
+ // registerProtocolHandler was invoked without user gesture.
+ // The |IsEmpty| method will be true if no protocol handler is
+ // pending registration.
+ ProtocolHandler pending_protocol_handler_;
+
+ // The previous protocol handler to be replaced by
+ // the pending_protocol_handler_, if there is one. Empty if
+ // there is no handler which would be replaced.
+ ProtocolHandler previous_protocol_handler_;
+
+ // The setting on the pending protocol handler registration.
Bernhard Bauer 2012/06/25 16:52:20 I think this is only interesting if we open the bu
Greg Billock 2012/06/26 19:17:04 You got it. Added clarification. On 2012/06/25 16
+ ContentSetting pending_protocol_handler_setting_;
+
// Stores whether the user can load blocked plugins on this page.
bool load_plugins_link_enabled_;

Powered by Google App Engine
This is Rietveld 408576698