Chromium Code Reviews| 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_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
| 6 #define CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/containers/hash_tables.h" | |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 14 #include "base/scoped_observer.h" | 15 #include "base/scoped_observer.h" |
| 15 #include "chrome/browser/browsing_data/cookies_tree_model.h" | 16 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
| 16 #include "chrome/browser/content_settings/content_settings_usages_state.h" | 17 #include "chrome/browser/content_settings/content_settings_usages_state.h" |
| 17 #include "chrome/browser/content_settings/local_shared_objects_container.h" | 18 #include "chrome/browser/content_settings/local_shared_objects_container.h" |
| 18 #include "chrome/common/custom_handlers/protocol_handler.h" | 19 #include "chrome/common/custom_handlers/protocol_handler.h" |
| 19 #include "components/content_settings/core/browser/content_settings_observer.h" | 20 #include "components/content_settings/core/browser/content_settings_observer.h" |
| 20 #include "components/content_settings/core/common/content_settings.h" | 21 #include "components/content_settings/core/common/content_settings.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 | 178 |
| 178 // Returns true if content blockage was indicated to the user. | 179 // Returns true if content blockage was indicated to the user. |
| 179 bool IsBlockageIndicated(ContentSettingsType content_type) const; | 180 bool IsBlockageIndicated(ContentSettingsType content_type) const; |
| 180 | 181 |
| 181 void SetBlockageHasBeenIndicated(ContentSettingsType content_type); | 182 void SetBlockageHasBeenIndicated(ContentSettingsType content_type); |
| 182 | 183 |
| 183 // Returns whether a particular kind of content has been allowed. Currently | 184 // Returns whether a particular kind of content has been allowed. Currently |
| 184 // only tracks cookies. | 185 // only tracks cookies. |
| 185 bool IsContentAllowed(ContentSettingsType content_type) const; | 186 bool IsContentAllowed(ContentSettingsType content_type) const; |
| 186 | 187 |
| 188 // Stores the names of plugins that have been blocked for this tab. | |
| 189 const base::string16 blocked_plugin_names() const; | |
|
Lei Zhang
2014/12/05 22:18:05
Non-trivial methods should be NamedLikeThis().
Will Harris
2014/12/08 00:21:11
Done.
| |
| 190 | |
| 187 const GURL& media_stream_access_origin() const { | 191 const GURL& media_stream_access_origin() const { |
| 188 return media_stream_access_origin_; | 192 return media_stream_access_origin_; |
| 189 } | 193 } |
| 190 | 194 |
| 191 const std::string& media_stream_requested_audio_device() const { | 195 const std::string& media_stream_requested_audio_device() const { |
| 192 return media_stream_requested_audio_device_; | 196 return media_stream_requested_audio_device_; |
| 193 } | 197 } |
| 194 | 198 |
| 195 const std::string& media_stream_requested_video_device() const { | 199 const std::string& media_stream_requested_video_device() const { |
| 196 return media_stream_requested_video_device_; | 200 return media_stream_requested_video_device_; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 load_plugins_link_enabled_ = enabled; | 290 load_plugins_link_enabled_ = enabled; |
| 287 } | 291 } |
| 288 | 292 |
| 289 // Called to indicate whether access to the Pepper broker was allowed or | 293 // Called to indicate whether access to the Pepper broker was allowed or |
| 290 // blocked. | 294 // blocked. |
| 291 void SetPepperBrokerAllowed(bool allowed); | 295 void SetPepperBrokerAllowed(bool allowed); |
| 292 | 296 |
| 293 // Message handlers. | 297 // Message handlers. |
| 294 // TODO(vabr): Only public for tests. Move to a test client. | 298 // TODO(vabr): Only public for tests. Move to a test client. |
| 295 void OnContentBlocked(ContentSettingsType type); | 299 void OnContentBlocked(ContentSettingsType type); |
| 300 void OnContentBlockedWithDetail(ContentSettingsType type, | |
| 301 const base::string16& details); | |
| 296 void OnContentAllowed(ContentSettingsType type); | 302 void OnContentAllowed(ContentSettingsType type); |
| 297 | 303 |
| 298 // These methods are invoked on the UI thread by the static functions above. | 304 // These methods are invoked on the UI thread by the static functions above. |
| 299 // TODO(vabr): Only public for tests. Move to a test client. | 305 // TODO(vabr): Only public for tests. Move to a test client. |
| 300 void OnCookiesRead(const GURL& url, | 306 void OnCookiesRead(const GURL& url, |
| 301 const GURL& first_party_url, | 307 const GURL& first_party_url, |
| 302 const net::CookieList& cookie_list, | 308 const net::CookieList& cookie_list, |
| 303 bool blocked_by_policy); | 309 bool blocked_by_policy); |
| 304 void OnCookieChanged(const GURL& url, | 310 void OnCookieChanged(const GURL& url, |
| 305 const GURL& first_party_url, | 311 const GURL& first_party_url, |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 419 | 425 |
| 420 // The previous protocol handler to be replaced by | 426 // The previous protocol handler to be replaced by |
| 421 // the pending_protocol_handler_, if there is one. Empty if | 427 // the pending_protocol_handler_, if there is one. Empty if |
| 422 // there is no handler which would be replaced. | 428 // there is no handler which would be replaced. |
| 423 ProtocolHandler previous_protocol_handler_; | 429 ProtocolHandler previous_protocol_handler_; |
| 424 | 430 |
| 425 // The setting on the pending protocol handler registration. Persisted in case | 431 // The setting on the pending protocol handler registration. Persisted in case |
| 426 // the user opens the bubble and makes changes multiple times. | 432 // the user opens the bubble and makes changes multiple times. |
| 427 ContentSetting pending_protocol_handler_setting_; | 433 ContentSetting pending_protocol_handler_setting_; |
| 428 | 434 |
| 435 // The name(s) of the plugin(s) being blocked. | |
| 436 base::hash_set<base::string16> blocked_plugin_names_; | |
| 437 | |
| 429 // Stores whether the user can load blocked plugins on this page. | 438 // Stores whether the user can load blocked plugins on this page. |
| 430 bool load_plugins_link_enabled_; | 439 bool load_plugins_link_enabled_; |
| 431 | 440 |
| 432 // The origin of the media stream request. Note that we only support handling | 441 // The origin of the media stream request. Note that we only support handling |
| 433 // settings for one request per tab. The latest request's origin will be | 442 // settings for one request per tab. The latest request's origin will be |
| 434 // stored here. http://crbug.com/259794 | 443 // stored here. http://crbug.com/259794 |
| 435 GURL media_stream_access_origin_; | 444 GURL media_stream_access_origin_; |
| 436 | 445 |
| 437 // The microphone and camera state at the last media stream request. | 446 // The microphone and camera state at the last media stream request. |
| 438 MicrophoneCameraState microphone_camera_state_; | 447 MicrophoneCameraState microphone_camera_state_; |
| 439 // The selected devices at the last media stream request. | 448 // The selected devices at the last media stream request. |
| 440 std::string media_stream_selected_audio_device_; | 449 std::string media_stream_selected_audio_device_; |
| 441 std::string media_stream_selected_video_device_; | 450 std::string media_stream_selected_video_device_; |
| 442 | 451 |
| 443 // The devices to be displayed in the media bubble when the media stream | 452 // The devices to be displayed in the media bubble when the media stream |
| 444 // request is requesting certain specific devices. | 453 // request is requesting certain specific devices. |
| 445 std::string media_stream_requested_audio_device_; | 454 std::string media_stream_requested_audio_device_; |
| 446 std::string media_stream_requested_video_device_; | 455 std::string media_stream_requested_video_device_; |
| 447 | 456 |
| 448 // Observer to watch for content settings changed. | 457 // Observer to watch for content settings changed. |
| 449 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; | 458 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; |
| 450 | 459 |
| 451 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); | 460 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); |
| 452 }; | 461 }; |
| 453 | 462 |
| 454 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 463 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
| OLD | NEW |