| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 if (owner_extension != extension) { |
| 159 *allowed = false; | 159 bool is_signin_extension = |
| 160 return true; | 160 extension && extension->id() == "mfffpogegjflfpflabcdkioaeobkgjik"; |
| 161 if (!is_signin_extension) { |
| 162 LOG(ERROR) << "NOT Allowed "; |
| 163 *allowed = false; |
| 164 return true; |
| 165 } else { |
| 166 LOG(ERROR) |
| 167 << "Sign-in extension is allowed to load cross renderrer resouces"; |
| 168 } |
| 161 } | 169 } |
| 162 | 170 |
| 163 *allowed = WebviewInfo::IsResourceWebviewAccessible(extension, partition_id, | 171 *allowed = WebviewInfo::IsResourceWebviewAccessible(extension, partition_id, |
| 164 resource_path); | 172 resource_path); |
| 173 LOG(ERROR) << "Allowed? " << extension->id() << " to load " << resource_path |
| 174 << ":" << *allowed; |
| 165 return true; | 175 return true; |
| 166 } | 176 } |
| 167 | 177 |
| 168 return false; | 178 return false; |
| 169 } | 179 } |
| 170 | 180 |
| 171 } // namespace url_request_util | 181 } // namespace url_request_util |
| 172 } // namespace extensions | 182 } // namespace extensions |
| OLD | NEW |