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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // Called when the TabSpecificContentSettings is destroyed; nulls out | 74 // Called when the TabSpecificContentSettings is destroyed; nulls out |
75 // the local reference. | 75 // the local reference. |
76 void ContentSettingsDestroyed(); | 76 void ContentSettingsDestroyed(); |
77 | 77 |
78 private: | 78 private: |
79 TabSpecificContentSettings* tab_specific_content_settings_; | 79 TabSpecificContentSettings* tab_specific_content_settings_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(SiteDataObserver); | 81 DISALLOW_COPY_AND_ASSIGN(SiteDataObserver); |
82 }; | 82 }; |
83 | 83 |
84 virtual ~TabSpecificContentSettings(); | 84 ~TabSpecificContentSettings() override; |
85 | 85 |
86 // Returns the object given a render view's id. | 86 // Returns the object given a render view's id. |
87 static TabSpecificContentSettings* Get(int render_process_id, | 87 static TabSpecificContentSettings* Get(int render_process_id, |
88 int render_view_id); | 88 int render_view_id); |
89 | 89 |
90 // Returns the object given a render frame's id. | 90 // Returns the object given a render frame's id. |
91 static TabSpecificContentSettings* GetForFrame(int render_process_id, | 91 static TabSpecificContentSettings* GetForFrame(int render_process_id, |
92 int render_view_id); | 92 int render_view_id); |
93 | 93 |
94 // Static methods called on the UI threads. | 94 // Static methods called on the UI threads. |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; } | 295 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; } |
296 void set_load_plugins_link_enabled(bool enabled) { | 296 void set_load_plugins_link_enabled(bool enabled) { |
297 load_plugins_link_enabled_ = enabled; | 297 load_plugins_link_enabled_ = enabled; |
298 } | 298 } |
299 | 299 |
300 // Called to indicate whether access to the Pepper broker was allowed or | 300 // Called to indicate whether access to the Pepper broker was allowed or |
301 // blocked. | 301 // blocked. |
302 void SetPepperBrokerAllowed(bool allowed); | 302 void SetPepperBrokerAllowed(bool allowed); |
303 | 303 |
304 // content::WebContentsObserver overrides. | 304 // content::WebContentsObserver overrides. |
305 virtual void RenderFrameForInterstitialPageCreated( | 305 void RenderFrameForInterstitialPageCreated( |
306 content::RenderFrameHost* render_frame_host) override; | 306 content::RenderFrameHost* render_frame_host) override; |
307 virtual bool OnMessageReceived( | 307 bool OnMessageReceived(const IPC::Message& message, |
308 const IPC::Message& message, | 308 content::RenderFrameHost* render_frame_host) override; |
309 content::RenderFrameHost* render_frame_host) override; | 309 void DidNavigateMainFrame( |
310 virtual void DidNavigateMainFrame( | |
311 const content::LoadCommittedDetails& details, | 310 const content::LoadCommittedDetails& details, |
312 const content::FrameNavigateParams& params) override; | 311 const content::FrameNavigateParams& params) override; |
313 virtual void DidStartProvisionalLoadForFrame( | 312 void DidStartProvisionalLoadForFrame( |
314 content::RenderFrameHost* render_frame_host, | 313 content::RenderFrameHost* render_frame_host, |
315 const GURL& validated_url, | 314 const GURL& validated_url, |
316 bool is_error_page, | 315 bool is_error_page, |
317 bool is_iframe_srcdoc) override; | 316 bool is_iframe_srcdoc) override; |
318 virtual void AppCacheAccessed(const GURL& manifest_url, | 317 void AppCacheAccessed(const GURL& manifest_url, |
319 bool blocked_by_policy) override; | 318 bool blocked_by_policy) override; |
320 | 319 |
321 // Message handlers. Public for testing. | 320 // Message handlers. Public for testing. |
322 void OnContentBlocked(ContentSettingsType type); | 321 void OnContentBlocked(ContentSettingsType type); |
323 void OnContentAllowed(ContentSettingsType type); | 322 void OnContentAllowed(ContentSettingsType type); |
324 | 323 |
325 // These methods are invoked on the UI thread by the static functions above. | 324 // These methods are invoked on the UI thread by the static functions above. |
326 // Public for testing. | 325 // Public for testing. |
327 void OnCookiesRead(const GURL& url, | 326 void OnCookiesRead(const GURL& url, |
328 const GURL& first_party_url, | 327 const GURL& first_party_url, |
329 const net::CookieList& cookie_list, | 328 const net::CookieList& cookie_list, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 void AddSiteDataObserver(SiteDataObserver* observer); | 368 void AddSiteDataObserver(SiteDataObserver* observer); |
370 | 369 |
371 // Removes the given |SiteDataObserver|. | 370 // Removes the given |SiteDataObserver|. |
372 void RemoveSiteDataObserver(SiteDataObserver* observer); | 371 void RemoveSiteDataObserver(SiteDataObserver* observer); |
373 | 372 |
374 private: | 373 private: |
375 explicit TabSpecificContentSettings(content::WebContents* tab); | 374 explicit TabSpecificContentSettings(content::WebContents* tab); |
376 friend class content::WebContentsUserData<TabSpecificContentSettings>; | 375 friend class content::WebContentsUserData<TabSpecificContentSettings>; |
377 | 376 |
378 // content_settings::Observer implementation. | 377 // content_settings::Observer implementation. |
379 virtual void OnContentSettingChanged( | 378 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, |
380 const ContentSettingsPattern& primary_pattern, | 379 const ContentSettingsPattern& secondary_pattern, |
381 const ContentSettingsPattern& secondary_pattern, | 380 ContentSettingsType content_type, |
382 ContentSettingsType content_type, | 381 std::string resource_identifier) override; |
383 std::string resource_identifier) override; | |
384 | 382 |
385 // Notifies all registered |SiteDataObserver|s. | 383 // Notifies all registered |SiteDataObserver|s. |
386 void NotifySiteDataObservers(); | 384 void NotifySiteDataObservers(); |
387 | 385 |
388 // All currently registered |SiteDataObserver|s. | 386 // All currently registered |SiteDataObserver|s. |
389 ObserverList<SiteDataObserver> observer_list_; | 387 ObserverList<SiteDataObserver> observer_list_; |
390 | 388 |
391 // Stores which content setting types actually have blocked content. | 389 // Stores which content setting types actually have blocked content. |
392 bool content_blocked_[CONTENT_SETTINGS_NUM_TYPES]; | 390 bool content_blocked_[CONTENT_SETTINGS_NUM_TYPES]; |
393 | 391 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 std::string media_stream_requested_audio_device_; | 443 std::string media_stream_requested_audio_device_; |
446 std::string media_stream_requested_video_device_; | 444 std::string media_stream_requested_video_device_; |
447 | 445 |
448 // Observer to watch for content settings changed. | 446 // Observer to watch for content settings changed. |
449 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; | 447 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; |
450 | 448 |
451 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); | 449 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); |
452 }; | 450 }; |
453 | 451 |
454 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 452 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
OLD | NEW |