| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 221 } |
| 222 void set_learn_more_link(const std::string& link) { | 222 void set_learn_more_link(const std::string& link) { |
| 223 bubble_content_.learn_more_link = link; | 223 bubble_content_.learn_more_link = link; |
| 224 } | 224 } |
| 225 void add_media_menu(content::MediaStreamType type, const MediaMenu& menu) { | 225 void add_media_menu(content::MediaStreamType type, const MediaMenu& menu) { |
| 226 bubble_content_.media_menus[type] = menu; | 226 bubble_content_.media_menus[type] = menu; |
| 227 } | 227 } |
| 228 void set_selected_device(const content::MediaStreamDevice& device) { | 228 void set_selected_device(const content::MediaStreamDevice& device) { |
| 229 bubble_content_.media_menus[device.type].selected_device = device; | 229 bubble_content_.media_menus[device.type].selected_device = device; |
| 230 } | 230 } |
| 231 bool setting_is_managed() { | |
| 232 return setting_is_managed_; | |
| 233 } | |
| 234 void set_setting_is_managed(bool managed) { | |
| 235 setting_is_managed_ = managed; | |
| 236 } | |
| 237 rappor::RapporServiceImpl* rappor_service() const { return rappor_service_; } | 231 rappor::RapporServiceImpl* rappor_service() const { return rappor_service_; } |
| 238 | 232 |
| 239 private: | 233 private: |
| 240 virtual void SetTitle() = 0; | 234 virtual void SetTitle() = 0; |
| 241 virtual void SetManageText() = 0; | 235 virtual void SetManageText() = 0; |
| 242 | 236 |
| 243 content::WebContents* web_contents_; | 237 content::WebContents* web_contents_; |
| 244 Profile* profile_; | 238 Profile* profile_; |
| 245 Delegate* delegate_; | 239 Delegate* delegate_; |
| 246 BubbleContent bubble_content_; | 240 BubbleContent bubble_content_; |
| 247 // A registrar for listening for WEB_CONTENTS_DESTROYED notifications. | 241 // A registrar for listening for WEB_CONTENTS_DESTROYED notifications. |
| 248 content::NotificationRegistrar registrar_; | 242 content::NotificationRegistrar registrar_; |
| 249 // A flag that indicates if the content setting managed i.e. can't be | |
| 250 // controlled by the user. | |
| 251 bool setting_is_managed_; | |
| 252 // The service used to record Rappor metrics. Can be set for testing. | 243 // The service used to record Rappor metrics. Can be set for testing. |
| 253 rappor::RapporServiceImpl* rappor_service_; | 244 rappor::RapporServiceImpl* rappor_service_; |
| 254 | 245 |
| 255 DISALLOW_COPY_AND_ASSIGN(ContentSettingBubbleModel); | 246 DISALLOW_COPY_AND_ASSIGN(ContentSettingBubbleModel); |
| 256 }; | 247 }; |
| 257 | 248 |
| 258 // A generic bubble used for a single content setting. | 249 // A generic bubble used for a single content setting. |
| 259 class ContentSettingSimpleBubbleModel : public ContentSettingBubbleModel { | 250 class ContentSettingSimpleBubbleModel : public ContentSettingBubbleModel { |
| 260 public: | 251 public: |
| 261 ContentSettingSimpleBubbleModel(Delegate* delegate, | 252 ContentSettingSimpleBubbleModel(Delegate* delegate, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 // The content settings that are associated with the individual radio | 375 // The content settings that are associated with the individual radio |
| 385 // buttons. | 376 // buttons. |
| 386 ContentSetting radio_item_setting_[2]; | 377 ContentSetting radio_item_setting_[2]; |
| 387 // The state of the microphone and camera access. | 378 // The state of the microphone and camera access. |
| 388 TabSpecificContentSettings::MicrophoneCameraState state_; | 379 TabSpecificContentSettings::MicrophoneCameraState state_; |
| 389 | 380 |
| 390 DISALLOW_COPY_AND_ASSIGN(ContentSettingMediaStreamBubbleModel); | 381 DISALLOW_COPY_AND_ASSIGN(ContentSettingMediaStreamBubbleModel); |
| 391 }; | 382 }; |
| 392 | 383 |
| 393 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 384 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |
| OLD | NEW |