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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 27 matching lines...) Expand all Loading... |
38 // ContentSettingMediaStreamBubbleModel - media (camera and mic) | 38 // ContentSettingMediaStreamBubbleModel - media (camera and mic) |
39 // ContentSettingSimpleBubbleModel - single content setting | 39 // ContentSettingSimpleBubbleModel - single content setting |
40 // ContentSettingMixedScriptBubbleModel - mixed script | 40 // ContentSettingMixedScriptBubbleModel - mixed script |
41 // ContentSettingRPHBubbleModel - protocol handlers | 41 // ContentSettingRPHBubbleModel - protocol handlers |
42 // ContentSettingMidiSysExBubbleModel - midi sysex | 42 // ContentSettingMidiSysExBubbleModel - midi sysex |
43 // ContentSettingDomainListBubbleModel - domain list (geolocation) | 43 // ContentSettingDomainListBubbleModel - domain list (geolocation) |
44 // ContentSettingSingleRadioGroup - radio group | 44 // ContentSettingSingleRadioGroup - radio group |
45 // ContentSettingCookiesBubbleModel - cookies | 45 // ContentSettingCookiesBubbleModel - cookies |
46 // ContentSettingPluginBubbleModel - plugins | 46 // ContentSettingPluginBubbleModel - plugins |
47 // ContentSettingPopupBubbleModel - popups | 47 // ContentSettingPopupBubbleModel - popups |
| 48 // ContentSettingSubresourceFilterBubbleModel - deceptive content |
48 | 49 |
49 // Forward declaration necessary for downcasts. | 50 // Forward declaration necessary for downcasts. |
50 class ContentSettingSimpleBubbleModel; | 51 class ContentSettingSimpleBubbleModel; |
51 class ContentSettingMediaStreamBubbleModel; | 52 class ContentSettingMediaStreamBubbleModel; |
| 53 class ContentSettingSubresourceFilterBubbleModel; |
52 | 54 |
53 // This model provides data for ContentSettingBubble, and also controls | 55 // This model provides data for ContentSettingBubble, and also controls |
54 // the action triggered when the allow / block radio buttons are triggered. | 56 // the action triggered when the allow / block radio buttons are triggered. |
55 class ContentSettingBubbleModel : public content::NotificationObserver { | 57 class ContentSettingBubbleModel : public content::NotificationObserver { |
56 public: | 58 public: |
57 typedef ContentSettingBubbleModelDelegate Delegate; | 59 typedef ContentSettingBubbleModelDelegate Delegate; |
58 | 60 |
59 struct ListItem { | 61 struct ListItem { |
60 ListItem(const gfx::Image& image, | 62 ListItem(const gfx::Image& image, |
61 const std::string& title, | 63 const std::string& title, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // TODO(msramek): The casting methods below are only necessary because | 157 // TODO(msramek): The casting methods below are only necessary because |
156 // ContentSettingBubbleController in the Cocoa UI needs to know the type of | 158 // ContentSettingBubbleController in the Cocoa UI needs to know the type of |
157 // the bubble it wraps. Find a solution that does not require reflection nor | 159 // the bubble it wraps. Find a solution that does not require reflection nor |
158 // recreating the entire hierarchy for Cocoa UI. | 160 // recreating the entire hierarchy for Cocoa UI. |
159 // Cast this bubble into ContentSettingSimpleBubbleModel if possible. | 161 // Cast this bubble into ContentSettingSimpleBubbleModel if possible. |
160 virtual ContentSettingSimpleBubbleModel* AsSimpleBubbleModel(); | 162 virtual ContentSettingSimpleBubbleModel* AsSimpleBubbleModel(); |
161 | 163 |
162 // Cast this bubble into ContentSettingMediaStreamBubbleModel if possible. | 164 // Cast this bubble into ContentSettingMediaStreamBubbleModel if possible. |
163 virtual ContentSettingMediaStreamBubbleModel* AsMediaStreamBubbleModel(); | 165 virtual ContentSettingMediaStreamBubbleModel* AsMediaStreamBubbleModel(); |
164 | 166 |
| 167 // Cast this bubble into ContentSettingSubresourceFilterBubbleModel |
| 168 // if possible. |
| 169 virtual ContentSettingSubresourceFilterBubbleModel* |
| 170 AsSubresourceFilterBubbleModel(); |
| 171 |
165 protected: | 172 protected: |
166 ContentSettingBubbleModel( | 173 ContentSettingBubbleModel( |
167 Delegate* delegate, | 174 Delegate* delegate, |
168 content::WebContents* web_contents, | 175 content::WebContents* web_contents, |
169 Profile* profile); | 176 Profile* profile); |
170 | 177 |
171 content::WebContents* web_contents() const { return web_contents_; } | 178 content::WebContents* web_contents() const { return web_contents_; } |
172 Profile* profile() const { return profile_; } | 179 Profile* profile() const { return profile_; } |
173 Delegate* delegate() const { return delegate_; } | 180 Delegate* delegate() const { return delegate_; } |
174 | 181 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 int selected_item_; | 334 int selected_item_; |
328 // The content settings that are associated with the individual radio | 335 // The content settings that are associated with the individual radio |
329 // buttons. | 336 // buttons. |
330 ContentSetting radio_item_setting_[2]; | 337 ContentSetting radio_item_setting_[2]; |
331 // The state of the microphone and camera access. | 338 // The state of the microphone and camera access. |
332 TabSpecificContentSettings::MicrophoneCameraState state_; | 339 TabSpecificContentSettings::MicrophoneCameraState state_; |
333 | 340 |
334 DISALLOW_COPY_AND_ASSIGN(ContentSettingMediaStreamBubbleModel); | 341 DISALLOW_COPY_AND_ASSIGN(ContentSettingMediaStreamBubbleModel); |
335 }; | 342 }; |
336 | 343 |
| 344 class ContentSettingSubresourceFilterBubbleModel |
| 345 : public ContentSettingBubbleModel { |
| 346 public: |
| 347 ContentSettingSubresourceFilterBubbleModel(Delegate* delegate, |
| 348 content::WebContents* web_contents, |
| 349 Profile* profile); |
| 350 |
| 351 ~ContentSettingSubresourceFilterBubbleModel() override; |
| 352 |
| 353 void OnManageLinkClicked() override; |
| 354 ContentSettingSubresourceFilterBubbleModel* AsSubresourceFilterBubbleModel() |
| 355 override; |
| 356 |
| 357 private: |
| 358 // ContentSettingBubbleModel: |
| 359 void SetTitle() override; |
| 360 void SetManageLink() override; |
| 361 |
| 362 DISALLOW_COPY_AND_ASSIGN(ContentSettingSubresourceFilterBubbleModel); |
| 363 }; |
| 364 |
337 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 365 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |
OLD | NEW |