OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |
6 #define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 6 #define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // content::NotificationObserver: | 87 // content::NotificationObserver: |
88 virtual void Observe(int type, | 88 virtual void Observe(int type, |
89 const content::NotificationSource& source, | 89 const content::NotificationSource& source, |
90 const content::NotificationDetails& details) OVERRIDE; | 90 const content::NotificationDetails& details) OVERRIDE; |
91 | 91 |
92 virtual void OnRadioClicked(int radio_index) {} | 92 virtual void OnRadioClicked(int radio_index) {} |
93 virtual void OnPopupClicked(int index) {} | 93 virtual void OnPopupClicked(int index) {} |
94 virtual void OnCustomLinkClicked() {} | 94 virtual void OnCustomLinkClicked() {} |
95 virtual void OnManageLinkClicked() {} | 95 virtual void OnManageLinkClicked() {} |
96 | 96 |
| 97 // Called by the view code when the bubble is closed by the user using the |
| 98 // Done button. |
| 99 virtual void OnDoneClicked() {} |
| 100 |
97 protected: | 101 protected: |
98 ContentSettingBubbleModel(TabContents* tab_contents, Profile* profile, | 102 ContentSettingBubbleModel(TabContents* tab_contents, Profile* profile, |
99 ContentSettingsType content_type); | 103 ContentSettingsType content_type); |
100 | 104 |
101 TabContents* tab_contents() const { return tab_contents_; } | 105 TabContents* tab_contents() const { return tab_contents_; } |
102 Profile* profile() const { return profile_; } | 106 Profile* profile() const { return profile_; } |
103 | 107 |
104 void set_title(const std::string& title) { bubble_content_.title = title; } | 108 void set_title(const std::string& title) { bubble_content_.title = title; } |
105 void add_popup(const PopupItem& popup) { | 109 void add_popup(const PopupItem& popup) { |
106 bubble_content_.popup_items.push_back(popup); | 110 bubble_content_.popup_items.push_back(popup); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 160 |
157 class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel { | 161 class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel { |
158 public: | 162 public: |
159 ContentSettingRPHBubbleModel(Delegate* delegate, | 163 ContentSettingRPHBubbleModel(Delegate* delegate, |
160 TabContents* tab_contents, | 164 TabContents* tab_contents, |
161 Profile* profile, | 165 Profile* profile, |
162 ProtocolHandlerRegistry* registry, | 166 ProtocolHandlerRegistry* registry, |
163 ContentSettingsType content_type); | 167 ContentSettingsType content_type); |
164 | 168 |
165 virtual void OnRadioClicked(int radio_index) OVERRIDE; | 169 virtual void OnRadioClicked(int radio_index) OVERRIDE; |
| 170 virtual void OnDoneClicked() OVERRIDE; |
166 | 171 |
167 private: | 172 private: |
168 // These states must match the order of appearance of the radio buttons | 173 // These states must match the order of appearance of the radio buttons |
169 // in the XIB file for the Mac port. | 174 // in the XIB file for the Mac port. |
170 enum RPHState { | 175 enum RPHState { |
171 RPH_ALLOW = 0, | 176 RPH_ALLOW = 0, |
172 RPH_BLOCK, | 177 RPH_BLOCK, |
173 RPH_IGNORE, | 178 RPH_IGNORE, |
174 }; | 179 }; |
175 | 180 |
176 void RegisterProtocolHandler(); | 181 void RegisterProtocolHandler(); |
177 void UnregisterProtocolHandler(); | 182 void UnregisterProtocolHandler(); |
178 void IgnoreProtocolHandler(); | 183 void IgnoreProtocolHandler(); |
179 void ClearOrSetPreviousHandler(); | 184 void ClearOrSetPreviousHandler(); |
180 | 185 |
181 int selected_item_; | 186 int selected_item_; |
182 ProtocolHandlerRegistry* registry_; | 187 ProtocolHandlerRegistry* registry_; |
183 ProtocolHandler pending_handler_; | 188 ProtocolHandler pending_handler_; |
184 ProtocolHandler previous_handler_; | 189 ProtocolHandler previous_handler_; |
185 }; | 190 }; |
186 | 191 |
187 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 192 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |
OLD | NEW |