Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / chrome / browser / extensions / chrome_url_request_util.h
blob4e7aa55a9aef2c0cba1ff4b2598e0ceee41cd67b
1 // Copyright 2014 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_BROWSER_EXTENSIONS_CHROME_URL_REQUEST_UTIL_H_
6 #define CHROME_BROWSER_EXTENSIONS_CHROME_URL_REQUEST_UTIL_H_
8 #include <string>
10 namespace base {
11 class FilePath;
14 namespace net {
15 class NetworkDelegate;
16 class URLRequest;
17 class URLRequestJob;
20 namespace extensions {
21 class Extension;
22 class InfoMap;
24 // Utilities related to URLRequest jobs for extension resources. See
25 // chrome/browser/extensions/extension_protocols_unittest.cc for related tests.
26 namespace chrome_url_request_util {
28 // Sets allowed=true to allow a chrome-extension:// resource request coming from
29 // renderer A to access a resource in an extension running in renderer B.
30 // Returns false when it couldn't determine if the resource is allowed or not
31 bool AllowCrossRendererResourceLoad(net::URLRequest* request,
32 bool is_incognito,
33 const Extension* extension,
34 InfoMap* extension_info_map,
35 bool* allowed);
37 // Creates a URLRequestJob for loading component extension resources out of
38 // a Chrome resource bundle. Returns NULL if the requested resource is not a
39 // component extension resource.
40 net::URLRequestJob* MaybeCreateURLRequestResourceBundleJob(
41 net::URLRequest* request,
42 net::NetworkDelegate* network_delegate,
43 const base::FilePath& directory_path,
44 const std::string& content_security_policy,
45 bool send_cors_header);
47 } // namespace chrome_url_request_util
48 } // namespace extensions
50 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_URL_REQUEST_UTIL_H_