| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 3248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3259 // handled by the browser so that ordinary renderer processes don't get | 3259 // handled by the browser so that ordinary renderer processes don't get |
| 3260 // blessed with file permissions. | 3260 // blessed with file permissions. |
| 3261 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); | 3261 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); |
| 3262 bool is_initial_navigation = page_id_ == -1; | 3262 bool is_initial_navigation = page_id_ == -1; |
| 3263 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || | 3263 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || |
| 3264 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || | 3264 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || |
| 3265 url.SchemeIs(kViewSourceScheme) || | 3265 url.SchemeIs(kViewSourceScheme) || |
| 3266 (frame->isViewSourceModeEnabled() && | 3266 (frame->isViewSourceModeEnabled() && |
| 3267 type != blink::WebNavigationTypeReload); | 3267 type != blink::WebNavigationTypeReload); |
| 3268 | 3268 |
| 3269 if (!should_fork && url.SchemeIs(chrome::kFileScheme)) { | 3269 if (!should_fork && url.SchemeIs(kFileScheme)) { |
| 3270 // Fork non-file to file opens. Check the opener URL if this is the | 3270 // Fork non-file to file opens. Check the opener URL if this is the |
| 3271 // initial navigation in a newly opened window. | 3271 // initial navigation in a newly opened window. |
| 3272 GURL source_url(old_url); | 3272 GURL source_url(old_url); |
| 3273 if (is_initial_navigation && source_url.is_empty() && frame->opener()) | 3273 if (is_initial_navigation && source_url.is_empty() && frame->opener()) |
| 3274 source_url = frame->opener()->top()->document().url(); | 3274 source_url = frame->opener()->top()->document().url(); |
| 3275 DCHECK(!source_url.is_empty()); | 3275 DCHECK(!source_url.is_empty()); |
| 3276 should_fork = !source_url.SchemeIs(chrome::kFileScheme); | 3276 should_fork = !source_url.SchemeIs(kFileScheme); |
| 3277 } | 3277 } |
| 3278 | 3278 |
| 3279 if (!should_fork) { | 3279 if (!should_fork) { |
| 3280 // Give the embedder a chance. | 3280 // Give the embedder a chance. |
| 3281 should_fork = GetContentClient()->renderer()->ShouldFork( | 3281 should_fork = GetContentClient()->renderer()->ShouldFork( |
| 3282 frame, url, request.httpMethod().utf8(), is_initial_navigation, | 3282 frame, url, request.httpMethod().utf8(), is_initial_navigation, |
| 3283 is_redirect, &send_referrer); | 3283 is_redirect, &send_referrer); |
| 3284 } | 3284 } |
| 3285 | 3285 |
| 3286 if (should_fork) { | 3286 if (should_fork) { |
| (...skipping 3161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6448 for (size_t i = 0; i < icon_urls.size(); i++) { | 6448 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6449 WebURL url = icon_urls[i].iconURL(); | 6449 WebURL url = icon_urls[i].iconURL(); |
| 6450 if (!url.isEmpty()) | 6450 if (!url.isEmpty()) |
| 6451 urls.push_back(FaviconURL(url, | 6451 urls.push_back(FaviconURL(url, |
| 6452 ToFaviconType(icon_urls[i].iconType()))); | 6452 ToFaviconType(icon_urls[i].iconType()))); |
| 6453 } | 6453 } |
| 6454 SendUpdateFaviconURL(urls); | 6454 SendUpdateFaviconURL(urls); |
| 6455 } | 6455 } |
| 6456 | 6456 |
| 6457 } // namespace content | 6457 } // namespace content |
| OLD | NEW |