| 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 "chrome/browser/extensions/url_request_util.h" | 5 #include "chrome/browser/extensions/url_request_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 std::string resource_path = request->url().path(); | 159 std::string resource_path = request->url().path(); |
| 160 if (is_guest && WebviewInfo::IsResourceWebviewAccessible( | 160 if (is_guest && WebviewInfo::IsResourceWebviewAccessible( |
| 161 extension, partition_id, resource_path)) { | 161 extension, partition_id, resource_path)) { |
| 162 return true; | 162 return true; |
| 163 } | 163 } |
| 164 #endif | 164 #endif |
| 165 | 165 |
| 166 // If the request is for navigations outside of webviews, then it should be | 166 // If the request is for navigations outside of webviews, then it should be |
| 167 // allowed. The navigation logic in CrossSiteResourceHandler will properly | 167 // allowed. The navigation logic in CrossSiteResourceHandler will properly |
| 168 // transfer the navigation to a privileged process before it commits. | 168 // transfer the navigation to a privileged process before it commits. |
| 169 if (ResourceType::IsFrame(info->GetResourceType()) && !is_guest) | 169 if (content::IsResourceTypeFrame(info->GetResourceType()) && !is_guest) |
| 170 return true; | 170 return true; |
| 171 | 171 |
| 172 if (!content::PageTransitionIsWebTriggerable(info->GetPageTransition())) | 172 if (!content::PageTransitionIsWebTriggerable(info->GetPageTransition())) |
| 173 return false; | 173 return false; |
| 174 | 174 |
| 175 // The following checks require that we have an actual extension object. If we | 175 // The following checks require that we have an actual extension object. If we |
| 176 // don't have it, allow the request handling to continue with the rest of the | 176 // don't have it, allow the request handling to continue with the rest of the |
| 177 // checks. | 177 // checks. |
| 178 if (!extension) | 178 if (!extension) |
| 179 return true; | 179 return true; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 return false; | 255 return false; |
| 256 #if defined(ENABLE_EXTENSIONS) | 256 #if defined(ENABLE_EXTENSIONS) |
| 257 return WebViewRendererState::GetInstance()->IsGuest(info->GetChildID()); | 257 return WebViewRendererState::GetInstance()->IsGuest(info->GetChildID()); |
| 258 #else | 258 #else |
| 259 return false; | 259 return false; |
| 260 #endif | 260 #endif |
| 261 } | 261 } |
| 262 | 262 |
| 263 } // namespace url_request_util | 263 } // namespace url_request_util |
| 264 } // namespace extensions | 264 } // namespace extensions |
| OLD | NEW |