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