| 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 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 REQUIRE_HOST_PERMISSION, // Permission needed for given URL. | 34 REQUIRE_HOST_PERMISSION, // Permission needed for given URL. |
| 35 REQUIRE_ALL_URLS // Permission needed for <all_urls>. | 35 REQUIRE_ALL_URLS // Permission needed for <all_urls>. |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 // Returns true if the request shall not be reported to extensions. | 38 // Returns true if the request shall not be reported to extensions. |
| 39 static bool HideRequest( | 39 static bool HideRequest( |
| 40 const extensions::InfoMap* extension_info_map, | 40 const extensions::InfoMap* extension_info_map, |
| 41 const net::URLRequest* request, | 41 const net::URLRequest* request, |
| 42 extensions::ExtensionNavigationUIData* navigation_ui_data); | 42 extensions::ExtensionNavigationUIData* navigation_ui_data); |
| 43 | 43 |
| 44 // Helper function used only in tests, sets a variable which enables or |
| 45 // disables a CHECK. |
| 46 static void AllowAllExtensionLocationsInPublicSessionForTesting(bool value); |
| 47 |
| 44 // |host_permission_check| controls how permissions are checked with regard to | 48 // |host_permission_check| controls how permissions are checked with regard to |
| 45 // |url|. | 49 // |url|. |
| 46 static extensions::PermissionsData::AccessType CanExtensionAccessURL( | 50 static extensions::PermissionsData::AccessType CanExtensionAccessURL( |
| 47 const extensions::InfoMap* extension_info_map, | 51 const extensions::InfoMap* extension_info_map, |
| 48 const std::string& extension_id, | 52 const std::string& extension_id, |
| 49 const GURL& url, | 53 const GURL& url, |
| 50 int tab_id, | 54 int tab_id, |
| 51 bool crosses_incognito, | 55 bool crosses_incognito, |
| 52 HostPermissionsCheck host_permissions_check); | 56 HostPermissionsCheck host_permissions_check); |
| 53 | 57 |
| 54 private: | 58 private: |
| 55 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); | 59 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); |
| 56 }; | 60 }; |
| 57 | 61 |
| 58 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ | 62 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ |
| OLD | NEW |