OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 last_top_level_navigation_page_id_ != page_id_ && | 1840 last_top_level_navigation_page_id_ != page_id_ && |
1841 // Not interested in reloads. | 1841 // Not interested in reloads. |
1842 type != WebKit::WebNavigationTypeReload && | 1842 type != WebKit::WebNavigationTypeReload && |
1843 type != WebKit::WebNavigationTypeFormSubmitted && | 1843 type != WebKit::WebNavigationTypeFormSubmitted && |
1844 // Must be a top level frame. | 1844 // Must be a top level frame. |
1845 frame->parent() == NULL) { | 1845 frame->parent() == NULL) { |
1846 // Skip if navigation is on the same page (using '#'). | 1846 // Skip if navigation is on the same page (using '#'). |
1847 GURL frame_origin = GURL(frame->url()).GetOrigin(); | 1847 GURL frame_origin = GURL(frame->url()).GetOrigin(); |
1848 if (url.GetOrigin() != frame_origin || url.ref().empty()) { | 1848 if (url.GetOrigin() != frame_origin || url.ref().empty()) { |
1849 last_top_level_navigation_page_id_ = page_id_; | 1849 last_top_level_navigation_page_id_ = page_id_; |
1850 OpenURL(url, GURL(), default_policy); | 1850 GURL referrer(request.httpHeaderField(WebString::fromUTF8("Referer"))); |
| 1851 OpenURL(url, referrer, default_policy); |
1851 return WebKit::WebNavigationPolicyIgnore; // Suppress the load here. | 1852 return WebKit::WebNavigationPolicyIgnore; // Suppress the load here. |
1852 } | 1853 } |
1853 } | 1854 } |
1854 | 1855 |
1855 // A content initiated navigation may have originated from a link-click, | 1856 // A content initiated navigation may have originated from a link-click, |
1856 // script, drag-n-drop operation, etc. | 1857 // script, drag-n-drop operation, etc. |
1857 bool is_content_initiated = | 1858 bool is_content_initiated = |
1858 NavigationState::FromDataSource(frame->provisionalDataSource())-> | 1859 NavigationState::FromDataSource(frame->provisionalDataSource())-> |
1859 is_content_initiated(); | 1860 is_content_initiated(); |
1860 | 1861 |
(...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3659 new PluginMsg_SignalModalDialogEvent(host_window_)); | 3660 new PluginMsg_SignalModalDialogEvent(host_window_)); |
3660 | 3661 |
3661 message->EnableMessagePumping(); // Runs a nested message loop. | 3662 message->EnableMessagePumping(); // Runs a nested message loop. |
3662 bool rv = Send(message); | 3663 bool rv = Send(message); |
3663 | 3664 |
3664 PluginChannelHost::Broadcast( | 3665 PluginChannelHost::Broadcast( |
3665 new PluginMsg_ResetModalDialogEvent(host_window_)); | 3666 new PluginMsg_ResetModalDialogEvent(host_window_)); |
3666 | 3667 |
3667 return rv; | 3668 return rv; |
3668 } | 3669 } |
OLD | NEW |