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 "base/optional.h" | |
13 #include "extensions/common/permissions/permissions_data.h" | 12 #include "extensions/common/permissions/permissions_data.h" |
14 #include "url/origin.h" | |
15 | 13 |
16 class GURL; | 14 class GURL; |
17 | 15 |
18 namespace extensions { | 16 namespace extensions { |
19 class ExtensionNavigationUIData; | 17 class ExtensionNavigationUIData; |
20 class InfoMap; | 18 class InfoMap; |
21 } | 19 } |
22 | 20 |
23 namespace net { | 21 namespace net { |
24 class URLRequest; | 22 class URLRequest; |
(...skipping 17 matching lines...) Expand all Loading... |
42 static bool HideRequest( | 40 static bool HideRequest( |
43 const extensions::InfoMap* extension_info_map, | 41 const extensions::InfoMap* extension_info_map, |
44 const net::URLRequest* request, | 42 const net::URLRequest* request, |
45 extensions::ExtensionNavigationUIData* navigation_ui_data); | 43 extensions::ExtensionNavigationUIData* navigation_ui_data); |
46 | 44 |
47 // Helper function used only in tests, sets a variable which enables or | 45 // Helper function used only in tests, sets a variable which enables or |
48 // disables a CHECK. | 46 // disables a CHECK. |
49 static void AllowAllExtensionLocationsInPublicSessionForTesting(bool value); | 47 static void AllowAllExtensionLocationsInPublicSessionForTesting(bool value); |
50 | 48 |
51 // |host_permission_check| controls how permissions are checked with regard to | 49 // |host_permission_check| controls how permissions are checked with regard to |
52 // |url| and |initiator| if an initiator exists. | 50 // |url|. |
53 static extensions::PermissionsData::AccessType CanExtensionAccessURL( | 51 static extensions::PermissionsData::AccessType CanExtensionAccessURL( |
54 const extensions::InfoMap* extension_info_map, | 52 const extensions::InfoMap* extension_info_map, |
55 const std::string& extension_id, | 53 const std::string& extension_id, |
56 const GURL& url, | 54 const GURL& url, |
57 int tab_id, | 55 int tab_id, |
58 bool crosses_incognito, | 56 bool crosses_incognito, |
59 HostPermissionsCheck host_permissions_check, | 57 HostPermissionsCheck host_permissions_check); |
60 const base::Optional<url::Origin>& initiator); | |
61 | 58 |
62 private: | 59 private: |
63 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); | 60 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); |
64 }; | 61 }; |
65 | 62 |
66 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ | 63 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ |
OLD | NEW |