| 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 EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ |
| 6 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ | 6 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "extensions/common/permissions/permissions_data.h" | 12 #include "extensions/common/permissions/permissions_data.h" |
| 13 | 13 |
| 14 class GURL; | 14 class GURL; |
| 15 | 15 |
| 16 namespace extensions { | 16 namespace extensions { |
| 17 class ExtensionNavigationUIData; | 17 class ExtensionNavigationUIData; |
| 18 class InfoMap; | 18 class InfoMap; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace net { | 21 namespace net { |
| 22 class URLRequest; | 22 class URLRequest; |
| 23 } | 23 } |
| 24 | 24 |
| 25 // Exposed for unit testing. |
| 26 bool IsSensitiveURL(const GURL& url); |
| 27 |
| 25 // This class is used to test whether extensions may modify web requests. | 28 // This class is used to test whether extensions may modify web requests. |
| 26 class WebRequestPermissions { | 29 class WebRequestPermissions { |
| 27 public: | 30 public: |
| 28 // Different host permission checking modes for CanExtensionAccessURL. | 31 // Different host permission checking modes for CanExtensionAccessURL. |
| 29 enum HostPermissionsCheck { | 32 enum HostPermissionsCheck { |
| 30 DO_NOT_CHECK_HOST = 0, // No check. | 33 DO_NOT_CHECK_HOST = 0, // No check. |
| 31 REQUIRE_HOST_PERMISSION, // Permission needed for given URL. | 34 REQUIRE_HOST_PERMISSION, // Permission needed for given URL. |
| 32 REQUIRE_ALL_URLS // Permission needed for <all_urls>. | 35 REQUIRE_ALL_URLS // Permission needed for <all_urls>. |
| 33 }; | 36 }; |
| 34 | 37 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 46 const GURL& url, | 49 const GURL& url, |
| 47 int tab_id, | 50 int tab_id, |
| 48 bool crosses_incognito, | 51 bool crosses_incognito, |
| 49 HostPermissionsCheck host_permissions_check); | 52 HostPermissionsCheck host_permissions_check); |
| 50 | 53 |
| 51 private: | 54 private: |
| 52 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); | 55 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); |
| 53 }; | 56 }; |
| 54 | 57 |
| 55 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ | 58 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ |
| OLD | NEW |