Chromium Code Reviews| Index: chrome/browser/ui/content_settings/content_setting_bubble_model.h |
| diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.h b/chrome/browser/ui/content_settings/content_setting_bubble_model.h |
| index db1856a825ae106a22ce681ab4e38fba16c4b71e..2cbd58978efd646270cd46f88aa23c9df6dff886 100644 |
| --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.h |
| +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.h |
| @@ -11,6 +11,7 @@ |
| #include "base/compiler_specific.h" |
| #include "chrome/common/content_settings.h" |
| +#include "chrome/common/custom_handlers/protocol_handler.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| #include "googleurl/src/gurl.h" |
| @@ -18,6 +19,7 @@ |
| class ContentSettingBubbleModelDelegate; |
| class Profile; |
| +class ProtocolHandlerRegistry; |
| class TabContents; |
| // This model provides data for ContentSettingBubble, and also controls |
| @@ -134,4 +136,60 @@ class ContentSettingBubbleModel : public content::NotificationObserver { |
| DISALLOW_COPY_AND_ASSIGN(ContentSettingBubbleModel); |
| }; |
| +class ContentSettingTitleAndLinkModel : public ContentSettingBubbleModel { |
|
Greg Billock
2012/07/19 14:49:57
Looks like this still needs merged.
Steve McKay
2012/07/19 16:59:55
Done.
|
| + public: |
| + ContentSettingTitleAndLinkModel(Delegate* delegate, |
| + TabContents* tab_contents, |
| + Profile* profile, |
| + ContentSettingsType content_type); |
| + virtual ~ContentSettingTitleAndLinkModel() {} |
| + Delegate* delegate() const { return delegate_; } |
| + |
| + private: |
| + void SetBlockedResources(); |
| + void SetTitle(); |
| + void SetManageLink(); |
| + virtual void OnManageLinkClicked() OVERRIDE; |
| + |
| + Delegate* delegate_; |
| +}; |
| + |
| +class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel { |
| + public: |
| + |
| + // Deprecated. Use constructor that accepts a |ProtocolHandlerRegistry|. |
| + ContentSettingRPHBubbleModel(Delegate* delegate, |
| + TabContents* tab_contents, |
| + Profile* profile, |
| + ContentSettingsType content_type); |
| + |
| + ContentSettingRPHBubbleModel(Delegate* delegate, |
| + TabContents* tab_contents, |
| + Profile* profile, |
| + ProtocolHandlerRegistry* registry, |
| + ContentSettingsType content_type); |
| + |
| + virtual void OnRadioClicked(int radio_index) OVERRIDE; |
| + |
| + private: |
| + // These states must match the order of appearance of the radio buttons |
| + // in the XIB file for the Mac port. |
| + enum RPHState { |
| + RPH_ALLOW = 0, |
| + RPH_BLOCK, |
| + RPH_IGNORE, |
| + }; |
| + |
| + void Init(); |
| + void RegisterProtocolHandler(); |
| + void UnregisterProtocolHandler(); |
| + void IgnoreProtocolHandler(); |
| + void ClearOrSetPreviousHandler(); |
| + |
| + int selected_item_; |
| + ProtocolHandlerRegistry* registry_; |
| + ProtocolHandler pending_handler_; |
| + ProtocolHandler previous_handler_; |
| +}; |
| + |
| #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |