OLD | NEW |
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_RENDERER_EXTENSIONS_EXTENSION_RESOURCE_REQUEST_POLICY_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_RESOURCE_REQUEST_POLICY_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_ |
7 | 7 |
8 class ExtensionSet; | 8 class ExtensionSet; |
9 class GURL; | 9 class GURL; |
| 10 |
10 namespace WebKit { | 11 namespace WebKit { |
11 class WebFrame; | 12 class WebFrame; |
12 } | 13 } |
13 | 14 |
| 15 namespace extensions { |
| 16 |
14 // Encapsulates the policy for when chrome-extension:// and | 17 // Encapsulates the policy for when chrome-extension:// and |
15 // chrome-extension-resource:// URLs can be requested. | 18 // chrome-extension-resource:// URLs can be requested. |
16 class ExtensionResourceRequestPolicy { | 19 class ResourceRequestPolicy { |
17 public: | 20 public: |
18 // Returns true if the chrome-extension:// |resource_url| can be requested | 21 // Returns true if the chrome-extension:// |resource_url| can be requested |
19 // from |frame_url|. | 22 // from |frame_url|. |
20 static bool CanRequestResource(const GURL& resource_url, | 23 static bool CanRequestResource(const GURL& resource_url, |
21 WebKit::WebFrame* frame, | 24 WebKit::WebFrame* frame, |
22 const ExtensionSet* loaded_extensions); | 25 const ExtensionSet* loaded_extensions); |
23 // Returns true if the chrome-extension-resource:// |resource_url| can be | 26 // Returns true if the chrome-extension-resource:// |resource_url| can be |
24 // requested from |frame_url|. | 27 // requested from |frame_url|. |
25 static bool CanRequestExtensionResourceScheme( | 28 static bool CanRequestExtensionResourceScheme(const GURL& resource_url, |
26 const GURL& resource_url, | 29 WebKit::WebFrame* frame); |
27 WebKit::WebFrame* frame); | |
28 | 30 |
29 private: | 31 private: |
30 ExtensionResourceRequestPolicy(); | 32 ResourceRequestPolicy(); |
31 }; | 33 }; |
32 | 34 |
33 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_RESOURCE_REQUEST_POLICY_H_ | 35 } // namespace extensions |
| 36 |
| 37 #endif // CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_ |
OLD | NEW |