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. | 25 // Exposed for unit testing. |
26 bool IsSensitiveURL(const GURL& url); | 26 bool IsSensitiveURL(const GURL& url, |
| 27 bool is_request_from_browser_or_webui_renderer); |
27 | 28 |
28 // This class is used to test whether extensions may modify web requests. | 29 // This class is used to test whether extensions may modify web requests. |
29 class WebRequestPermissions { | 30 class WebRequestPermissions { |
30 public: | 31 public: |
31 // Different host permission checking modes for CanExtensionAccessURL. | 32 // Different host permission checking modes for CanExtensionAccessURL. |
32 enum HostPermissionsCheck { | 33 enum HostPermissionsCheck { |
33 DO_NOT_CHECK_HOST = 0, // No check. | 34 DO_NOT_CHECK_HOST = 0, // No check. |
34 REQUIRE_HOST_PERMISSION, // Permission needed for given URL. | 35 REQUIRE_HOST_PERMISSION, // Permission needed for given URL. |
35 REQUIRE_ALL_URLS // Permission needed for <all_urls>. | 36 REQUIRE_ALL_URLS // Permission needed for <all_urls>. |
36 }; | 37 }; |
(...skipping 16 matching lines...) Expand all Loading... |
53 const GURL& url, | 54 const GURL& url, |
54 int tab_id, | 55 int tab_id, |
55 bool crosses_incognito, | 56 bool crosses_incognito, |
56 HostPermissionsCheck host_permissions_check); | 57 HostPermissionsCheck host_permissions_check); |
57 | 58 |
58 private: | 59 private: |
59 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); | 60 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); |
60 }; | 61 }; |
61 | 62 |
62 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ | 63 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ |
OLD | NEW |