| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_BROWSER_URL_REQUEST_UTIL_H_ | 5 #ifndef EXTENSIONS_BROWSER_URL_REQUEST_UTIL_H_ |
| 6 #define EXTENSIONS_BROWSER_URL_REQUEST_UTIL_H_ | 6 #define EXTENSIONS_BROWSER_URL_REQUEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ui/base/page_transition_types.h" | 10 #include "ui/base/page_transition_types.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // renderer A to access a resource in an extension running in renderer B. | 25 // renderer A to access a resource in an extension running in renderer B. |
| 26 // Returns false when it couldn't determine if the resource is allowed or not | 26 // Returns false when it couldn't determine if the resource is allowed or not |
| 27 bool AllowCrossRendererResourceLoad(net::URLRequest* request, | 27 bool AllowCrossRendererResourceLoad(net::URLRequest* request, |
| 28 bool is_incognito, | 28 bool is_incognito, |
| 29 const Extension* extension, | 29 const Extension* extension, |
| 30 InfoMap* extension_info_map, | 30 InfoMap* extension_info_map, |
| 31 bool* allowed); | 31 bool* allowed); |
| 32 | 32 |
| 33 // Returns true if |request| corresponds to a resource request from a | 33 // Returns true if |request| corresponds to a resource request from a |
| 34 // <webview>. | 34 // <webview>. |
| 35 bool IsWebViewRequest(const net::URLRequest* request); | 35 bool IsWebViewRequest(net::URLRequest* request); |
| 36 | 36 |
| 37 // Helper method that is called by both AllowCrossRendererResourceLoad and | 37 // Helper method that is called by both AllowCrossRendererResourceLoad and |
| 38 // ExtensionNavigationThrottle to share logic. | 38 // ExtensionNavigationThrottle to share logic. |
| 39 // Sets allowed=true to allow a chrome-extension:// resource request coming from | 39 // Sets allowed=true to allow a chrome-extension:// resource request coming from |
| 40 // renderer A to access a resource in an extension running in renderer B. | 40 // renderer A to access a resource in an extension running in renderer B. |
| 41 // Returns false when it couldn't determine if the resource is allowed or not | 41 // Returns false when it couldn't determine if the resource is allowed or not |
| 42 bool AllowCrossRendererResourceLoadHelper(bool is_guest, | 42 bool AllowCrossRendererResourceLoadHelper(bool is_guest, |
| 43 const Extension* extension, | 43 const Extension* extension, |
| 44 const Extension* owner_extension, | 44 const Extension* owner_extension, |
| 45 const std::string& partition_id, | 45 const std::string& partition_id, |
| 46 const std::string& resource_path, | 46 const std::string& resource_path, |
| 47 ui::PageTransition page_transition, | 47 ui::PageTransition page_transition, |
| 48 bool* allowed); | 48 bool* allowed); |
| 49 | 49 |
| 50 } // namespace url_request_util | 50 } // namespace url_request_util |
| 51 } // namespace extensions | 51 } // namespace extensions |
| 52 | 52 |
| 53 #endif // EXTENSIONS_BROWSER_URL_REQUEST_UTIL_H_ | 53 #endif // EXTENSIONS_BROWSER_URL_REQUEST_UTIL_H_ |
| OLD | NEW |