| 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 | 38 |
| 39 // The hierarchy of bubble models: | 39 // The hierarchy of bubble models: |
| 40 // | 40 // |
| 41 // ContentSettingsBubbleModel - base class | 41 // ContentSettingsBubbleModel - base class |
| 42 // ContentSettingMediaStreamBubbleModel - media (camera and mic) | 42 // ContentSettingMediaStreamBubbleModel - media (camera and mic) |
| 43 // ContentSettingSimpleBubbleModel - single content setting | 43 // ContentSettingSimpleBubbleModel - single content setting |
| 44 // ContentSettingMixedScriptBubbleModel - mixed script | 44 // ContentSettingMixedScriptBubbleModel - mixed script |
| 45 // ContentSettingRPHBubbleModel - protocol handlers | 45 // ContentSettingRPHBubbleModel - protocol handlers |
| 46 // ContentSettingMidiSysExBubbleModel - midi sysex | 46 // ContentSettingMidiSysExBubbleModel - midi sysex |
| 47 // ContentSettingDomainListBubbleModel - domain list (geolocation) | 47 // ContentSettingDomainListBubbleModel - domain list (geolocation) |
| 48 // ContentSettingPluginBubbleModel - plugins |
| 48 // ContentSettingSingleRadioGroup - radio group | 49 // ContentSettingSingleRadioGroup - radio group |
| 49 // ContentSettingCookiesBubbleModel - cookies | 50 // ContentSettingCookiesBubbleModel - cookies |
| 50 // ContentSettingPluginBubbleModel - plugins | |
| 51 // ContentSettingPopupBubbleModel - popups | 51 // ContentSettingPopupBubbleModel - popups |
| 52 // ContentSettingSubresourceFilterBubbleModel - filtered subresources | 52 // ContentSettingSubresourceFilterBubbleModel - filtered subresources |
| 53 | 53 |
| 54 // Forward declaration necessary for downcasts. | 54 // Forward declaration necessary for downcasts. |
| 55 class ContentSettingMediaStreamBubbleModel; | 55 class ContentSettingMediaStreamBubbleModel; |
| 56 class ContentSettingSimpleBubbleModel; | 56 class ContentSettingSimpleBubbleModel; |
| 57 class ContentSettingSubresourceFilterBubbleModel; | 57 class ContentSettingSubresourceFilterBubbleModel; |
| 58 | 58 |
| 59 // This model provides data for ContentSettingBubble, and also controls | 59 // This model provides data for ContentSettingBubble, and also controls |
| 60 // the action triggered when the allow / block radio buttons are triggered. | 60 // the action triggered when the allow / block radio buttons are triggered. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 } | 220 } |
| 221 void set_learn_more_link(const std::string& link) { | 221 void set_learn_more_link(const std::string& link) { |
| 222 bubble_content_.learn_more_link = link; | 222 bubble_content_.learn_more_link = link; |
| 223 } | 223 } |
| 224 void add_media_menu(content::MediaStreamType type, const MediaMenu& menu) { | 224 void add_media_menu(content::MediaStreamType type, const MediaMenu& menu) { |
| 225 bubble_content_.media_menus[type] = menu; | 225 bubble_content_.media_menus[type] = menu; |
| 226 } | 226 } |
| 227 void set_selected_device(const content::MediaStreamDevice& device) { | 227 void set_selected_device(const content::MediaStreamDevice& device) { |
| 228 bubble_content_.media_menus[device.type].selected_device = device; | 228 bubble_content_.media_menus[device.type].selected_device = device; |
| 229 } | 229 } |
| 230 bool setting_is_managed() { | |
| 231 return setting_is_managed_; | |
| 232 } | |
| 233 void set_setting_is_managed(bool managed) { | |
| 234 setting_is_managed_ = managed; | |
| 235 } | |
| 236 rappor::RapporService* rappor_service() const { return rappor_service_; } | 230 rappor::RapporService* rappor_service() const { return rappor_service_; } |
| 237 | 231 |
| 238 private: | 232 private: |
| 239 virtual void SetTitle() = 0; | 233 virtual void SetTitle() = 0; |
| 240 virtual void SetManageText() = 0; | 234 virtual void SetManageText() = 0; |
| 241 | 235 |
| 242 content::WebContents* web_contents_; | 236 content::WebContents* web_contents_; |
| 243 Profile* profile_; | 237 Profile* profile_; |
| 244 Delegate* delegate_; | 238 Delegate* delegate_; |
| 245 BubbleContent bubble_content_; | 239 BubbleContent bubble_content_; |
| 246 // A registrar for listening for WEB_CONTENTS_DESTROYED notifications. | 240 // A registrar for listening for WEB_CONTENTS_DESTROYED notifications. |
| 247 content::NotificationRegistrar registrar_; | 241 content::NotificationRegistrar registrar_; |
| 248 // A flag that indicates if the content setting managed i.e. can't be | |
| 249 // controlled by the user. | |
| 250 bool setting_is_managed_; | |
| 251 // The service used to record Rappor metrics. Can be set for testing. | 242 // The service used to record Rappor metrics. Can be set for testing. |
| 252 rappor::RapporService* rappor_service_; | 243 rappor::RapporService* rappor_service_; |
| 253 | 244 |
| 254 DISALLOW_COPY_AND_ASSIGN(ContentSettingBubbleModel); | 245 DISALLOW_COPY_AND_ASSIGN(ContentSettingBubbleModel); |
| 255 }; | 246 }; |
| 256 | 247 |
| 257 // A generic bubble used for a single content setting. | 248 // A generic bubble used for a single content setting. |
| 258 class ContentSettingSimpleBubbleModel : public ContentSettingBubbleModel { | 249 class ContentSettingSimpleBubbleModel : public ContentSettingBubbleModel { |
| 259 public: | 250 public: |
| 260 ContentSettingSimpleBubbleModel(Delegate* delegate, | 251 ContentSettingSimpleBubbleModel(Delegate* delegate, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 // The content settings that are associated with the individual radio | 374 // The content settings that are associated with the individual radio |
| 384 // buttons. | 375 // buttons. |
| 385 ContentSetting radio_item_setting_[2]; | 376 ContentSetting radio_item_setting_[2]; |
| 386 // The state of the microphone and camera access. | 377 // The state of the microphone and camera access. |
| 387 TabSpecificContentSettings::MicrophoneCameraState state_; | 378 TabSpecificContentSettings::MicrophoneCameraState state_; |
| 388 | 379 |
| 389 DISALLOW_COPY_AND_ASSIGN(ContentSettingMediaStreamBubbleModel); | 380 DISALLOW_COPY_AND_ASSIGN(ContentSettingMediaStreamBubbleModel); |
| 390 }; | 381 }; |
| 391 | 382 |
| 392 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 383 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |
| OLD | NEW |