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