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

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

Issue 566823003: Move declarative_webrequest: action, rules_registry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing another weird re-base error. Created 6 years, 3 months 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/basictypes.h"
12
13 class GURL;
14
15 namespace extensions {
16 class InfoMap;
17 }
18
19 namespace net {
20 class URLRequest;
21 }
22
23 // This class is used to test whether extensions may modify web requests.
24 class WebRequestPermissions {
25 public:
26 // Different host permission checking modes for CanExtensionAccessURL.
27 enum HostPermissionsCheck {
28 DO_NOT_CHECK_HOST = 0, // No check.
29 REQUIRE_HOST_PERMISSION, // Permission needed for given URL.
30 REQUIRE_ALL_URLS // Permission needed for <all_urls>.
31 };
32
33 // Returns true if the request shall not be reported to extensions.
34 static bool HideRequest(const extensions::InfoMap* extension_info_map,
35 const net::URLRequest* request);
36
37 // |host_permission_check| controls how permissions are checked with regard to
38 // |url|.
39 static bool CanExtensionAccessURL(
40 const extensions::InfoMap* extension_info_map,
41 const std::string& extension_id,
42 const GURL& url,
43 bool crosses_incognito,
44 HostPermissionsCheck host_permissions_check);
45
46 private:
47 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions);
48 };
49
50 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698