Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_permissions.h

Issue 63933003: Moved ExtensionInfoMap and ExtensionsQuotaService to extensions/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment fix Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ 6 #define CHROME_BROWSER_EXTENSIONS_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/basictypes.h" 11 #include "base/basictypes.h"
12 12
13 class ExtensionInfoMap;
14 class GURL; 13 class GURL;
15 14
15 namespace extensions {
16 class InfoMap;
17 }
18
16 namespace net { 19 namespace net {
17 class URLRequest; 20 class URLRequest;
18 } 21 }
19 22
20 // This class is used to test whether extensions may modify web requests. 23 // This class is used to test whether extensions may modify web requests.
21 class WebRequestPermissions { 24 class WebRequestPermissions {
22 public: 25 public:
23 // Different host permission checking modes for CanExtensionAccessURL. 26 // Different host permission checking modes for CanExtensionAccessURL.
24 enum HostPermissionsCheck { 27 enum HostPermissionsCheck {
25 DO_NOT_CHECK_HOST = 0, // No check. 28 DO_NOT_CHECK_HOST = 0, // No check.
26 REQUIRE_HOST_PERMISSION, // Permission needed for given URL. 29 REQUIRE_HOST_PERMISSION, // Permission needed for given URL.
27 REQUIRE_ALL_URLS // Permission needed for <all_urls>. 30 REQUIRE_ALL_URLS // Permission needed for <all_urls>.
28 }; 31 };
29 32
30 // Returns true if the request shall not be reported to extensions. 33 // Returns true if the request shall not be reported to extensions.
31 static bool HideRequest(const ExtensionInfoMap* extension_info_map, 34 static bool HideRequest(const extensions::InfoMap* extension_info_map,
32 const net::URLRequest* request); 35 const net::URLRequest* request);
33 36
34 // |host_permission_check| controls how permissions are checked with regard to 37 // |host_permission_check| controls how permissions are checked with regard to
35 // |url|. 38 // |url|.
36 static bool CanExtensionAccessURL( 39 static bool CanExtensionAccessURL(
37 const ExtensionInfoMap* extension_info_map, 40 const extensions::InfoMap* extension_info_map,
38 const std::string& extension_id, 41 const std::string& extension_id,
39 const GURL& url, 42 const GURL& url,
40 bool crosses_incognito, 43 bool crosses_incognito,
41 HostPermissionsCheck host_permissions_check); 44 HostPermissionsCheck host_permissions_check);
42 45
43 private: 46 private:
44 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); 47 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions);
45 }; 48 };
46 49
47 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ 50 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698