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

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

Issue 2845943003: Limit protection of clients[0-9]*.google.com to requests from browser. (Closed)
Patch Set: Fix unittests Created 3 years, 7 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
« no previous file with comments | « no previous file | extensions/browser/api/web_request/web_request_permissions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 "extensions/common/permissions/permissions_data.h" 12 #include "extensions/common/permissions/permissions_data.h"
13 13
14 class GURL; 14 class GURL;
15 15
16 namespace extensions { 16 namespace extensions {
17 class ExtensionNavigationUIData; 17 class ExtensionNavigationUIData;
18 class InfoMap; 18 class InfoMap;
19 } 19 }
20 20
21 namespace net { 21 namespace net {
22 class URLRequest; 22 class URLRequest;
23 } 23 }
24 24
25 // Exposed for unit testing. 25 // Exposed for unit testing.
26 bool IsSensitiveURL(const GURL& url); 26 bool IsSensitiveURL(const GURL& url,
27 bool is_request_from_browser_or_webui_renderer);
27 28
28 // This class is used to test whether extensions may modify web requests. 29 // This class is used to test whether extensions may modify web requests.
29 class WebRequestPermissions { 30 class WebRequestPermissions {
30 public: 31 public:
31 // Different host permission checking modes for CanExtensionAccessURL. 32 // Different host permission checking modes for CanExtensionAccessURL.
32 enum HostPermissionsCheck { 33 enum HostPermissionsCheck {
33 DO_NOT_CHECK_HOST = 0, // No check. 34 DO_NOT_CHECK_HOST = 0, // No check.
34 REQUIRE_HOST_PERMISSION, // Permission needed for given URL. 35 REQUIRE_HOST_PERMISSION, // Permission needed for given URL.
35 REQUIRE_ALL_URLS // Permission needed for <all_urls>. 36 REQUIRE_ALL_URLS // Permission needed for <all_urls>.
36 }; 37 };
(...skipping 16 matching lines...) Expand all
53 const GURL& url, 54 const GURL& url,
54 int tab_id, 55 int tab_id,
55 bool crosses_incognito, 56 bool crosses_incognito,
56 HostPermissionsCheck host_permissions_check); 57 HostPermissionsCheck host_permissions_check);
57 58
58 private: 59 private:
59 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); 60 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions);
60 }; 61 };
61 62
62 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ 63 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/api/web_request/web_request_permissions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698