OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/renderer_host/render_view_host.h" | 5 #include "content/browser/renderer_host/render_view_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 RenderViewHostObserver, observers_, Navigate(params)); | 250 RenderViewHostObserver, observers_, Navigate(params)); |
251 } | 251 } |
252 | 252 |
253 void RenderViewHost::NavigateToURL(const GURL& url) { | 253 void RenderViewHost::NavigateToURL(const GURL& url) { |
254 ViewMsg_Navigate_Params params; | 254 ViewMsg_Navigate_Params params; |
255 params.page_id = -1; | 255 params.page_id = -1; |
256 params.pending_history_list_offset = -1; | 256 params.pending_history_list_offset = -1; |
257 params.current_history_list_offset = -1; | 257 params.current_history_list_offset = -1; |
258 params.current_history_list_length = 0; | 258 params.current_history_list_length = 0; |
259 params.url = url; | 259 params.url = url; |
260 params.transition = PageTransition::LINK; | 260 params.transition = content::PAGE_TRANSITION_LINK; |
261 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; | 261 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; |
262 Navigate(params); | 262 Navigate(params); |
263 } | 263 } |
264 | 264 |
265 void RenderViewHost::SetNavigationsSuspended(bool suspend) { | 265 void RenderViewHost::SetNavigationsSuspended(bool suspend) { |
266 // This should only be called to toggle the state. | 266 // This should only be called to toggle the state. |
267 DCHECK(navigations_suspended_ != suspend); | 267 DCHECK(navigations_suspended_ != suspend); |
268 | 268 |
269 navigations_suspended_ = suspend; | 269 navigations_suspended_ = suspend; |
270 if (!suspend && suspended_nav_message_.get()) { | 270 if (!suspend && suspended_nav_message_.get()) { |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 return; | 808 return; |
809 | 809 |
810 // If we're waiting for a cross-site beforeunload ack from this renderer and | 810 // If we're waiting for a cross-site beforeunload ack from this renderer and |
811 // we receive a Navigate message from the main frame, then the renderer was | 811 // we receive a Navigate message from the main frame, then the renderer was |
812 // navigating already and sent it before hearing the ViewMsg_Stop message. | 812 // navigating already and sent it before hearing the ViewMsg_Stop message. |
813 // We do not want to cancel the pending navigation in this case, since the | 813 // We do not want to cancel the pending navigation in this case, since the |
814 // old page will soon be stopped. Instead, treat this as a beforeunload ack | 814 // old page will soon be stopped. Instead, treat this as a beforeunload ack |
815 // to allow the pending navigation to continue. | 815 // to allow the pending navigation to continue. |
816 if (is_waiting_for_beforeunload_ack_ && | 816 if (is_waiting_for_beforeunload_ack_ && |
817 unload_ack_is_for_cross_site_transition_ && | 817 unload_ack_is_for_cross_site_transition_ && |
818 PageTransition::IsMainFrame(validated_params.transition)) { | 818 content::PageTransitionIsMainFrame(validated_params.transition)) { |
819 OnMsgShouldCloseACK(true); | 819 OnMsgShouldCloseACK(true); |
820 return; | 820 return; |
821 } | 821 } |
822 | 822 |
823 // If we're waiting for an unload ack from this renderer and we receive a | 823 // If we're waiting for an unload ack from this renderer and we receive a |
824 // Navigate message, then the renderer was navigating before it received the | 824 // Navigate message, then the renderer was navigating before it received the |
825 // unload request. It will either respond to the unload request soon or our | 825 // unload request. It will either respond to the unload request soon or our |
826 // timer will expire. Either way, we should ignore this message, because we | 826 // timer will expire. Either way, we should ignore this message, because we |
827 // have already committed to closing this renderer. | 827 // have already committed to closing this renderer. |
828 if (is_waiting_for_unload_ack_) | 828 if (is_waiting_for_unload_ack_) |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 void RenderViewHost::OnRunFileChooser( | 1409 void RenderViewHost::OnRunFileChooser( |
1410 const ViewHostMsg_RunFileChooser_Params& params) { | 1410 const ViewHostMsg_RunFileChooser_Params& params) { |
1411 delegate_->RunFileChooser(this, params); | 1411 delegate_->RunFileChooser(this, params); |
1412 } | 1412 } |
1413 | 1413 |
1414 void RenderViewHost::OnWebUISend(const GURL& source_url, | 1414 void RenderViewHost::OnWebUISend(const GURL& source_url, |
1415 const std::string& name, | 1415 const std::string& name, |
1416 const base::ListValue& args) { | 1416 const base::ListValue& args) { |
1417 delegate_->WebUISend(this, source_url, name, args); | 1417 delegate_->WebUISend(this, source_url, name, args); |
1418 } | 1418 } |
OLD | NEW |