Suppression for crbug/241044.
[chromium-blink-merge.git] / chrome / renderer / extensions / resource_request_policy.h
blobc5f95f729643982c67284005cc8229fd01c8049c
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.
5 #ifndef CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_
6 #define CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_
8 #include "content/public/common/page_transition_types.h"
10 class ExtensionSet;
11 class GURL;
13 namespace WebKit {
14 class WebFrame;
17 namespace extensions {
19 // Encapsulates the policy for when chrome-extension:// and
20 // chrome-extension-resource:// URLs can be requested.
21 class ResourceRequestPolicy {
22 public:
23 // Returns true if the chrome-extension:// |resource_url| can be requested
24 // from |frame_url|. In some cases this decision is made based upon how
25 // this request was generated. Web triggered transitions are more restrictive
26 // than those triggered through UI.
27 static bool CanRequestResource(const GURL& resource_url,
28 WebKit::WebFrame* frame,
29 content::PageTransition transition_type,
30 const ExtensionSet* loaded_extensions);
31 // Returns true if the chrome-extension-resource:// |resource_url| can be
32 // requested from |frame_url|.
33 static bool CanRequestExtensionResourceScheme(const GURL& resource_url,
34 WebKit::WebFrame* frame);
36 private:
37 ResourceRequestPolicy();
40 } // namespace extensions
42 #endif // CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_