Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 class ExtensionInfoMap; | |
| 12 class GURL; | |
| 13 | |
| 14 namespace net { | |
| 15 class URLRequest; | |
| 16 } | |
| 17 | |
| 18 // This class is used to test whether extensions may modify web requests. | |
| 19 class WebRequestPermissions { | |
| 20 public: | |
| 21 WebRequestPermissions(); | |
| 22 ~WebRequestPermissions(); | |
| 23 | |
| 24 // Returns true if the request shall not be reported to extensions. | |
| 25 static bool HideRequest(const net::URLRequest* request); | |
| 26 | |
| 27 // Called when an incognito profile is created or destroyed. | |
| 28 void OnOTRProfileCreated(void* original_profile, | |
| 29 void* otr_profile); | |
| 30 void OnOTRProfileDestroyed(void* original_profile, | |
| 31 void* otr_profile); | |
| 32 | |
| 33 void* GetCrossProfile(void* profile) const; | |
| 34 | |
| 35 bool CanExtensionAccessURL(const ExtensionInfoMap* extension_info_map, | |
| 36 const std::string& extension_id, | |
| 37 const GURL& url, | |
| 38 bool crosses_incognito, | |
| 39 bool enforce_host_permissions) const; | |
| 40 private: | |
| 41 typedef std::map<void*, void*> CrossProfileMap; | |
| 42 | |
| 43 // A map of original profile -> corresponding incognito profile (and vice | |
| 44 // versa). | |
| 45 CrossProfileMap cross_profile_map_; | |
|
Matt Perry
2012/07/25 21:27:56
If you move this back to the event router, then th
battre
2012/07/26 16:38:43
Done.
I have left this class rather than moving e
Matt Perry
2012/07/26 18:42:41
Agreed - I only meant to move cross_profile_map_.
| |
| 46 }; | |
| 47 | |
| 48 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_ | |
| OLD | NEW |