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

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: Hide requests from WebUI 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
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, bool is_request_from_renderer);
27 27
28 // This class is used to test whether extensions may modify web requests. 28 // This class is used to test whether extensions may modify web requests.
29 class WebRequestPermissions { 29 class WebRequestPermissions {
30 public: 30 public:
31 // Different host permission checking modes for CanExtensionAccessURL. 31 // Different host permission checking modes for CanExtensionAccessURL.
32 enum HostPermissionsCheck { 32 enum HostPermissionsCheck {
33 DO_NOT_CHECK_HOST = 0, // No check. 33 DO_NOT_CHECK_HOST = 0, // No check.
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 };
(...skipping 16 matching lines...) Expand all
53 const GURL& url, 53 const GURL& url,
54 int tab_id, 54 int tab_id,
55 bool crosses_incognito, 55 bool crosses_incognito,
56 HostPermissionsCheck host_permissions_check); 56 HostPermissionsCheck host_permissions_check);
57 57
58 private: 58 private:
59 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); 59 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions);
60 }; 60 };
61 61
62 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ 62 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698