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