| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 DISALLOW_COPY_AND_ASSIGN(SiteDataObserver); | 80 DISALLOW_COPY_AND_ASSIGN(SiteDataObserver); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 virtual ~TabSpecificContentSettings(); | 83 virtual ~TabSpecificContentSettings(); |
| 84 | 84 |
| 85 // Returns the object given a render view's id. | 85 // Returns the object given a render view's id. |
| 86 static TabSpecificContentSettings* Get(int render_process_id, | 86 static TabSpecificContentSettings* Get(int render_process_id, |
| 87 int render_view_id); | 87 int render_view_id); |
| 88 | 88 |
| 89 // Returns the object given a render frame's id. |
| 90 static TabSpecificContentSettings* GetForFrame(int render_process_id, |
| 91 int render_view_id); |
| 92 |
| 89 // Static methods called on the UI threads. | 93 // Static methods called on the UI threads. |
| 90 // Called when cookies for the given URL were read either from within the | 94 // Called when cookies for the given URL were read either from within the |
| 91 // current page or while loading it. |blocked_by_policy| should be true, if | 95 // current page or while loading it. |blocked_by_policy| should be true, if |
| 92 // reading cookies was blocked due to the user's content settings. In that | 96 // reading cookies was blocked due to the user's content settings. In that |
| 93 // case, this function should invoke OnContentBlocked. | 97 // case, this function should invoke OnContentBlocked. |
| 94 static void CookiesRead(int render_process_id, | 98 static void CookiesRead(int render_process_id, |
| 95 int render_view_id, | 99 int render_view_id, |
| 96 const GURL& url, | 100 const GURL& url, |
| 97 const GURL& first_party_url, | 101 const GURL& first_party_url, |
| 98 const net::CookieList& cookie_list, | 102 const net::CookieList& cookie_list, |
| 99 bool blocked_by_policy); | 103 bool blocked_by_policy); |
| 100 | 104 |
| 101 // Called when a specific cookie in the current page was changed. | 105 // Called when a specific cookie in the current page was changed. |
| 102 // |blocked_by_policy| should be true, if the cookie was blocked due to the | 106 // |blocked_by_policy| should be true, if the cookie was blocked due to the |
| 103 // user's content settings. In that case, this function should invoke | 107 // user's content settings. In that case, this function should invoke |
| 104 // OnContentBlocked. | 108 // OnContentBlocked. |
| 105 static void CookieChanged(int render_process_id, | 109 static void CookieChanged(int render_process_id, |
| 106 int render_view_id, | 110 int render_view_id, |
| 107 const GURL& url, | 111 const GURL& url, |
| 108 const GURL& first_party_url, | 112 const GURL& first_party_url, |
| 109 const std::string& cookie_line, | 113 const std::string& cookie_line, |
| 110 const net::CookieOptions& options, | 114 const net::CookieOptions& options, |
| 111 bool blocked_by_policy); | 115 bool blocked_by_policy); |
| 112 | 116 |
| 113 // Called when a specific Web database in the current page was accessed. If | 117 // Called when a specific Web database in the current page was accessed. If |
| 114 // access was blocked due to the user's content settings, | 118 // access was blocked due to the user's content settings, |
| 115 // |blocked_by_policy| should be true, and this function should invoke | 119 // |blocked_by_policy| should be true, and this function should invoke |
| 116 // OnContentBlocked. | 120 // OnContentBlocked. |
| 117 static void WebDatabaseAccessed(int render_process_id, | 121 static void WebDatabaseAccessed(int render_process_id, |
| 118 int render_view_id, | 122 int render_frame_id, |
| 119 const GURL& url, | 123 const GURL& url, |
| 120 const base::string16& name, | 124 const base::string16& name, |
| 121 const base::string16& display_name, | 125 const base::string16& display_name, |
| 122 bool blocked_by_policy); | 126 bool blocked_by_policy); |
| 123 | 127 |
| 124 // Called when a specific DOM storage area in the current page was | 128 // Called when a specific DOM storage area in the current page was |
| 125 // accessed. If access was blocked due to the user's content settings, | 129 // accessed. If access was blocked due to the user's content settings, |
| 126 // |blocked_by_policy| should be true, and this function should invoke | 130 // |blocked_by_policy| should be true, and this function should invoke |
| 127 // OnContentBlocked. | 131 // OnContentBlocked. |
| 128 static void DOMStorageAccessed(int render_process_id, | 132 static void DOMStorageAccessed(int render_process_id, |
| 129 int render_view_id, | 133 int render_frame_id, |
| 130 const GURL& url, | 134 const GURL& url, |
| 131 bool local, | 135 bool local, |
| 132 bool blocked_by_policy); | 136 bool blocked_by_policy); |
| 133 | 137 |
| 134 // Called when a specific indexed db factory in the current page was | 138 // Called when a specific indexed db factory in the current page was |
| 135 // accessed. If access was blocked due to the user's content settings, | 139 // accessed. If access was blocked due to the user's content settings, |
| 136 // |blocked_by_policy| should be true, and this function should invoke | 140 // |blocked_by_policy| should be true, and this function should invoke |
| 137 // OnContentBlocked. | 141 // OnContentBlocked. |
| 138 static void IndexedDBAccessed(int render_process_id, | 142 static void IndexedDBAccessed(int render_process_id, |
| 139 int render_view_id, | 143 int render_frame_id, |
| 140 const GURL& url, | 144 const GURL& url, |
| 141 const base::string16& description, | 145 const base::string16& description, |
| 142 bool blocked_by_policy); | 146 bool blocked_by_policy); |
| 143 | 147 |
| 144 // Called when a specific file system in the current page was accessed. | 148 // Called when a specific file system in the current page was accessed. |
| 145 // If access was blocked due to the user's content settings, | 149 // If access was blocked due to the user's content settings, |
| 146 // |blocked_by_policy| should be true, and this function should invoke | 150 // |blocked_by_policy| should be true, and this function should invoke |
| 147 // OnContentBlocked. | 151 // OnContentBlocked. |
| 148 static void FileSystemAccessed(int render_process_id, | 152 static void FileSystemAccessed(int render_process_id, |
| 149 int render_view_id, | 153 int render_frame_id, |
| 150 const GURL& url, | 154 const GURL& url, |
| 151 bool blocked_by_policy); | 155 bool blocked_by_policy); |
| 152 | 156 |
| 153 // Resets the |content_blocked_| and |content_allowed_| arrays, except for | 157 // Resets the |content_blocked_| and |content_allowed_| arrays, except for |
| 154 // CONTENT_SETTINGS_TYPE_COOKIES related information. | 158 // CONTENT_SETTINGS_TYPE_COOKIES related information. |
| 155 void ClearBlockedContentSettingsExceptForCookies(); | 159 void ClearBlockedContentSettingsExceptForCookies(); |
| 156 | 160 |
| 157 // Resets all cookies related information. | 161 // Resets all cookies related information. |
| 158 void ClearCookieSpecificContentSettings(); | 162 void ClearCookieSpecificContentSettings(); |
| 159 | 163 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; } | 269 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; } |
| 266 void set_load_plugins_link_enabled(bool enabled) { | 270 void set_load_plugins_link_enabled(bool enabled) { |
| 267 load_plugins_link_enabled_ = enabled; | 271 load_plugins_link_enabled_ = enabled; |
| 268 } | 272 } |
| 269 | 273 |
| 270 // Called to indicate whether access to the Pepper broker was allowed or | 274 // Called to indicate whether access to the Pepper broker was allowed or |
| 271 // blocked. | 275 // blocked. |
| 272 void SetPepperBrokerAllowed(bool allowed); | 276 void SetPepperBrokerAllowed(bool allowed); |
| 273 | 277 |
| 274 // content::WebContentsObserver overrides. | 278 // content::WebContentsObserver overrides. |
| 275 virtual void RenderViewForInterstitialPageCreated( | 279 virtual void RenderFrameForInterstitialPageCreated( |
| 276 content::RenderViewHost* render_view_host) OVERRIDE; | 280 content::RenderFrameHost* render_frame_host) OVERRIDE; |
| 277 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 281 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 278 virtual void DidNavigateMainFrame( | 282 virtual void DidNavigateMainFrame( |
| 279 const content::LoadCommittedDetails& details, | 283 const content::LoadCommittedDetails& details, |
| 280 const content::FrameNavigateParams& params) OVERRIDE; | 284 const content::FrameNavigateParams& params) OVERRIDE; |
| 281 virtual void DidStartProvisionalLoadForFrame( | 285 virtual void DidStartProvisionalLoadForFrame( |
| 282 int64 frame_id, | 286 int64 frame_id, |
| 283 int64 parent_frame_id, | 287 int64 parent_frame_id, |
| 284 bool is_main_frame, | 288 bool is_main_frame, |
| 285 const GURL& validated_url, | 289 const GURL& validated_url, |
| 286 bool is_error_page, | 290 bool is_error_page, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 | 410 |
| 407 // The devices to be displayed in the media bubble when the media stream | 411 // The devices to be displayed in the media bubble when the media stream |
| 408 // request is requesting certain specific devices. | 412 // request is requesting certain specific devices. |
| 409 std::string media_stream_requested_audio_device_; | 413 std::string media_stream_requested_audio_device_; |
| 410 std::string media_stream_requested_video_device_; | 414 std::string media_stream_requested_video_device_; |
| 411 | 415 |
| 412 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); | 416 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); |
| 413 }; | 417 }; |
| 414 | 418 |
| 415 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 419 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
| OLD | NEW |