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 2991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3002 // Similarly, navigations to view-source URLs or within ViewSource mode | 3002 // Similarly, navigations to view-source URLs or within ViewSource mode |
3003 // must be handled by the browser process (except for reloads - those are | 3003 // must be handled by the browser process (except for reloads - those are |
3004 // safe to leave within the renderer). | 3004 // safe to leave within the renderer). |
3005 // Lastly, access to file:// URLs from non-file:// URL pages must be | 3005 // Lastly, access to file:// URLs from non-file:// URL pages must be |
3006 // handled by the browser so that ordinary renderer processes don't get | 3006 // handled by the browser so that ordinary renderer processes don't get |
3007 // blessed with file permissions. | 3007 // blessed with file permissions. |
3008 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); | 3008 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); |
3009 bool is_initial_navigation = page_id_ == -1; | 3009 bool is_initial_navigation = page_id_ == -1; |
3010 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || | 3010 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || |
3011 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || | 3011 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || |
3012 url.SchemeIs(chrome::kViewSourceScheme) || | 3012 url.SchemeIs(kViewSourceScheme) || |
3013 (frame->isViewSourceModeEnabled() && | 3013 (frame->isViewSourceModeEnabled() && |
3014 type != WebKit::WebNavigationTypeReload); | 3014 type != WebKit::WebNavigationTypeReload); |
3015 | 3015 |
3016 if (!should_fork && url.SchemeIs(chrome::kFileScheme)) { | 3016 if (!should_fork && url.SchemeIs(chrome::kFileScheme)) { |
3017 // Fork non-file to file opens. Check the opener URL if this is the | 3017 // Fork non-file to file opens. Check the opener URL if this is the |
3018 // initial navigation in a newly opened window. | 3018 // initial navigation in a newly opened window. |
3019 GURL source_url(old_url); | 3019 GURL source_url(old_url); |
3020 if (is_initial_navigation && source_url.is_empty() && frame->opener()) | 3020 if (is_initial_navigation && source_url.is_empty() && frame->opener()) |
3021 source_url = frame->opener()->top()->document().url(); | 3021 source_url = frame->opener()->top()->document().url(); |
3022 DCHECK(!source_url.is_empty()); | 3022 DCHECK(!source_url.is_empty()); |
(...skipping 3551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6574 WebURL url = icon_urls[i].iconURL(); | 6574 WebURL url = icon_urls[i].iconURL(); |
6575 if (!url.isEmpty()) | 6575 if (!url.isEmpty()) |
6576 urls.push_back(FaviconURL(url, | 6576 urls.push_back(FaviconURL(url, |
6577 ToFaviconType(icon_urls[i].iconType()))); | 6577 ToFaviconType(icon_urls[i].iconType()))); |
6578 } | 6578 } |
6579 SendUpdateFaviconURL(urls); | 6579 SendUpdateFaviconURL(urls); |
6580 } | 6580 } |
6581 | 6581 |
6582 | 6582 |
6583 } // namespace content | 6583 } // namespace content |
OLD | NEW |