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