summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/extension_resource_request_policy.h
blob: adfc816cffc073fe3873f16c1a240cc0220817d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_RESOURCE_REQUEST_POLICY_H_
#define CHROME_RENDERER_EXTENSIONS_EXTENSION_RESOURCE_REQUEST_POLICY_H_
#pragma once

class ExtensionSet;
class GURL;

// Encapsulates the policy for when chrome-extension:// URLs can be requested.
class ExtensionResourceRequestPolicy {
 public:
  // Returns true if the |resource_url| can be requested from |frame_url|.
  static bool CanRequestResource(const GURL& resource_url,
                                 const GURL& frame_url,
                                 const ExtensionSet* loaded_extensions);

 private:
  ExtensionResourceRequestPolicy();
};

#endif  // CHROME_RENDERER_EXTENSIONS_EXTENSION_RESOURCE_REQUEST_POLICY_H_