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 #include "extensions/browser/url_request_util.h" | 5 #include "extensions/browser/url_request_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "content/public/browser/resource_request_info.h" | 9 #include "content/public/browser/resource_request_info.h" |
10 #include "content/public/common/browser_side_navigation_policy.h" | 10 #include "content/public/common/browser_side_navigation_policy.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 bool AllowCrossRendererResourceLoadHelper(bool is_guest, | 148 bool AllowCrossRendererResourceLoadHelper(bool is_guest, |
149 const Extension* extension, | 149 const Extension* extension, |
150 const Extension* owner_extension, | 150 const Extension* owner_extension, |
151 const std::string& partition_id, | 151 const std::string& partition_id, |
152 const std::string& resource_path, | 152 const std::string& resource_path, |
153 ui::PageTransition page_transition, | 153 ui::PageTransition page_transition, |
154 bool* allowed) { | 154 bool* allowed) { |
155 if (is_guest) { | 155 if (is_guest) { |
156 // An extension's resources should only be accessible to WebViews owned by | 156 // An extension's resources should only be accessible to WebViews owned by |
157 // that extension. | 157 // that extension. |
158 if (owner_extension != extension) { | 158 // The only exception is the sign-in extension loaded by |
lfg
2017/04/26 16:24:18
Please, add a TODO that this should be removed onc
msarda
2017/04/27 12:28:45
Done.
| |
159 // chrome://chrome-signin, which is allowed to load web-accessible resources | |
160 // even if the webview that is loading the resource does not belong to the | |
161 // extension. | |
162 bool is_signin_extension = | |
163 extension && extension->id() == "mfffpogegjflfpflabcdkioaeobkgjik"; | |
164 if (owner_extension != extension && !is_signin_extension) { | |
159 *allowed = false; | 165 *allowed = false; |
160 return true; | 166 return true; |
161 } | 167 } |
162 | 168 |
163 *allowed = WebviewInfo::IsResourceWebviewAccessible(extension, partition_id, | 169 *allowed = WebviewInfo::IsResourceWebviewAccessible(extension, partition_id, |
164 resource_path); | 170 resource_path); |
165 return true; | 171 return true; |
166 } | 172 } |
167 | 173 |
168 return false; | 174 return false; |
169 } | 175 } |
170 | 176 |
171 } // namespace url_request_util | 177 } // namespace url_request_util |
172 } // namespace extensions | 178 } // namespace extensions |
OLD | NEW |