Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / renderer / extensions / resource_request_policy.h
blobd33fd5315df390c4cd6f5d48fdbabf5ffb24cad8
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 GURL;
12 namespace blink {
13 class WebFrame;
16 namespace extensions {
18 class ExtensionSet;
20 // Encapsulates the policy for when chrome-extension:// and
21 // chrome-extension-resource:// URLs can be requested.
22 class ResourceRequestPolicy {
23 public:
24 // Returns true if the chrome-extension:// |resource_url| can be requested
25 // from |frame_url|. In some cases this decision is made based upon how
26 // this request was generated. Web triggered transitions are more restrictive
27 // than those triggered through UI.
28 static bool CanRequestResource(const GURL& resource_url,
29 blink::WebFrame* frame,
30 content::PageTransition transition_type,
31 const ExtensionSet* loaded_extensions);
32 // Returns true if the chrome-extension-resource:// |resource_url| can be
33 // requested from |frame_url|.
34 static bool CanRequestExtensionResourceScheme(const GURL& resource_url,
35 blink::WebFrame* frame);
37 private:
38 ResourceRequestPolicy();
41 } // namespace extensions
43 #endif // CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_