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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // If access was blocked due to the user's content settings, | 156 // If access was blocked due to the user's content settings, |
157 // |blocked_by_policy| should be true, and this function should invoke | 157 // |blocked_by_policy| should be true, and this function should invoke |
158 // OnContentBlocked. | 158 // OnContentBlocked. |
159 static void FileSystemAccessed(int render_process_id, | 159 static void FileSystemAccessed(int render_process_id, |
160 int render_frame_id, | 160 int render_frame_id, |
161 const GURL& url, | 161 const GURL& url, |
162 bool blocked_by_policy); | 162 bool blocked_by_policy); |
163 | 163 |
164 // Called when a specific Service Worker scope was accessed. | 164 // Called when a specific Service Worker scope was accessed. |
165 // If access was blocked due to the user's content settings, | 165 // If access was blocked due to the user's content settings, |
166 // |blocked_by_policy| should be true, and this function should invoke | 166 // |blocked_by_policy_javascript| or/and |blocked_by_policy_cookie| should be |
167 // OnContentBlocked. | 167 // true, and this function should invoke OnContentBlocked for JavaScript |
| 168 // or/and cookies respectively. |
168 static void ServiceWorkerAccessed(int render_process_id, | 169 static void ServiceWorkerAccessed(int render_process_id, |
169 int render_frame_id, | 170 int render_frame_id, |
170 const GURL& scope, | 171 const GURL& scope, |
171 bool blocked_by_policy); | 172 bool blocked_by_policy_javascript, |
| 173 bool blocked_by_policy_cookie); |
172 | 174 |
173 // Resets the |content_blocked_| and |content_allowed_| arrays, except for | 175 // Resets the |content_settings_status_|, except for |
174 // CONTENT_SETTINGS_TYPE_COOKIES related information. | 176 // information which are needed for navigation: CONTENT_SETTINGS_TYPE_COOKIES |
| 177 // for cookies and service workers, and CONTENT_SETTINGS_TYPE_JAVASCRIPT for |
| 178 // service workers. |
175 // TODO(vabr): Only public for tests. Move to a test client. | 179 // TODO(vabr): Only public for tests. Move to a test client. |
176 void ClearBlockedContentSettingsExceptForCookies(); | 180 void ClearContentSettingsExceptForNavigationRelatedSettings(); |
177 | 181 |
178 // Resets all cookies related information. | 182 // Resets navigation related information (CONTENT_SETTINGS_TYPE_COOKIES and |
| 183 // CONTENT_SETTINGS_TYPE_JAVASCRIPT). |
179 // TODO(vabr): Only public for tests. Move to a test client. | 184 // TODO(vabr): Only public for tests. Move to a test client. |
180 void ClearCookieSpecificContentSettings(); | 185 void ClearNavigationRelatedContentSettings(); |
181 | 186 |
182 // Changes the |content_blocked_| entry for popups. | 187 // Changes the |content_blocked_| entry for popups. |
183 void SetPopupsBlocked(bool blocked); | 188 void SetPopupsBlocked(bool blocked); |
184 | 189 |
185 // Changes the |content_blocked_| entry for downloads. | 190 // Changes the |content_blocked_| entry for downloads. |
186 void SetDownloadsBlocked(bool blocked); | 191 void SetDownloadsBlocked(bool blocked); |
187 | 192 |
188 // Changes |subresource_filter_enabled_| entry for the Safe Browsing | 193 // Changes |subresource_filter_enabled_| entry for the Safe Browsing |
189 // Subresource Filter. | 194 // Subresource Filter. |
190 void SetSubresourceBlocked(bool enabled); | 195 void SetSubresourceBlocked(bool enabled); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 const net::CookieOptions& options, | 349 const net::CookieOptions& options, |
345 bool blocked_by_policy); | 350 bool blocked_by_policy); |
346 void OnFileSystemAccessed(const GURL& url, | 351 void OnFileSystemAccessed(const GURL& url, |
347 bool blocked_by_policy); | 352 bool blocked_by_policy); |
348 void OnIndexedDBAccessed(const GURL& url, | 353 void OnIndexedDBAccessed(const GURL& url, |
349 const base::string16& description, | 354 const base::string16& description, |
350 bool blocked_by_policy); | 355 bool blocked_by_policy); |
351 void OnLocalStorageAccessed(const GURL& url, | 356 void OnLocalStorageAccessed(const GURL& url, |
352 bool local, | 357 bool local, |
353 bool blocked_by_policy); | 358 bool blocked_by_policy); |
354 void OnServiceWorkerAccessed(const GURL& scope, bool blocked_by_policy); | 359 void OnServiceWorkerAccessed(const GURL& scope, |
| 360 bool blocked_by_policy_javascript, |
| 361 bool blocked_by_policy_cookie); |
355 void OnWebDatabaseAccessed(const GURL& url, | 362 void OnWebDatabaseAccessed(const GURL& url, |
356 const base::string16& name, | 363 const base::string16& name, |
357 const base::string16& display_name, | 364 const base::string16& display_name, |
358 bool blocked_by_policy); | 365 bool blocked_by_policy); |
359 void OnGeolocationPermissionSet(const GURL& requesting_frame, | 366 void OnGeolocationPermissionSet(const GURL& requesting_frame, |
360 bool allowed); | 367 bool allowed); |
361 void OnDidUseKeygen(const GURL& url); | 368 void OnDidUseKeygen(const GURL& url); |
362 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 369 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
363 void OnProtectedMediaIdentifierPermissionSet(const GURL& requesting_frame, | 370 void OnProtectedMediaIdentifierPermissionSet(const GURL& requesting_frame, |
364 bool allowed); | 371 bool allowed); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 // Holds the previous committed url during a navigation. | 498 // Holds the previous committed url during a navigation. |
492 GURL previous_url_; | 499 GURL previous_url_; |
493 | 500 |
494 // Observer to watch for content settings changed. | 501 // Observer to watch for content settings changed. |
495 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; | 502 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; |
496 | 503 |
497 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); | 504 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); |
498 }; | 505 }; |
499 | 506 |
500 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 507 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
OLD | NEW |