| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include "base/containers/hash_tables.h" | 7 #include "base/containers/hash_tables.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/metrics/user_metrics_action.h" | 9 #include "base/metrics/user_metrics_action.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 void RenderFrameHostImpl::SwapOut() { | 498 void RenderFrameHostImpl::SwapOut() { |
| 499 if (render_view_host_->IsRenderViewLive()) { | 499 if (render_view_host_->IsRenderViewLive()) { |
| 500 Send(new FrameMsg_SwapOut(routing_id_)); | 500 Send(new FrameMsg_SwapOut(routing_id_)); |
| 501 } else { | 501 } else { |
| 502 // Our RenderViewHost doesn't have a live renderer, so just skip the unload | 502 // Our RenderViewHost doesn't have a live renderer, so just skip the unload |
| 503 // event. | 503 // event. |
| 504 OnSwappedOut(true); | 504 OnSwappedOut(true); |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 | 507 |
| 508 void RenderFrameHostImpl::OnDidStartLoading() { | 508 void RenderFrameHostImpl::OnDidStartLoading(bool to_different_document) { |
| 509 delegate_->DidStartLoading(this); | 509 delegate_->DidStartLoading(this, to_different_document); |
| 510 } | 510 } |
| 511 | 511 |
| 512 void RenderFrameHostImpl::OnDidStopLoading() { | 512 void RenderFrameHostImpl::OnDidStopLoading() { |
| 513 delegate_->DidStopLoading(this); | 513 delegate_->DidStopLoading(this); |
| 514 } | 514 } |
| 515 | 515 |
| 516 void RenderFrameHostImpl::OnBeforeUnloadACK( | 516 void RenderFrameHostImpl::OnBeforeUnloadACK( |
| 517 bool proceed, | 517 bool proceed, |
| 518 const base::TimeTicks& renderer_before_unload_start_time, | 518 const base::TimeTicks& renderer_before_unload_start_time, |
| 519 const base::TimeTicks& renderer_before_unload_end_time) { | 519 const base::TimeTicks& renderer_before_unload_end_time) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 // browser. But we want to keep the throbber in sync with what's happening | 657 // browser. But we want to keep the throbber in sync with what's happening |
| 658 // in the UI. For example, we want to start throbbing immediately when the | 658 // in the UI. For example, we want to start throbbing immediately when the |
| 659 // user naivgates even if the renderer is delayed. There is also an issue | 659 // user naivgates even if the renderer is delayed. There is also an issue |
| 660 // with the throbber starting because the WebUI (which controls whether the | 660 // with the throbber starting because the WebUI (which controls whether the |
| 661 // favicon is displayed) happens synchronously. If the start loading | 661 // favicon is displayed) happens synchronously. If the start loading |
| 662 // messages was asynchronous, then the default favicon would flash in. | 662 // messages was asynchronous, then the default favicon would flash in. |
| 663 // | 663 // |
| 664 // Blink doesn't send throb notifications for JavaScript URLs, so we | 664 // Blink doesn't send throb notifications for JavaScript URLs, so we |
| 665 // don't want to either. | 665 // don't want to either. |
| 666 if (!params.url.SchemeIs(kJavaScriptScheme)) | 666 if (!params.url.SchemeIs(kJavaScriptScheme)) |
| 667 delegate_->DidStartLoading(this); | 667 delegate_->DidStartLoading(this, true); |
| 668 } | 668 } |
| 669 | 669 |
| 670 void RenderFrameHostImpl::NavigateToURL(const GURL& url) { | 670 void RenderFrameHostImpl::NavigateToURL(const GURL& url) { |
| 671 FrameMsg_Navigate_Params params; | 671 FrameMsg_Navigate_Params params; |
| 672 params.page_id = -1; | 672 params.page_id = -1; |
| 673 params.pending_history_list_offset = -1; | 673 params.pending_history_list_offset = -1; |
| 674 params.current_history_list_offset = -1; | 674 params.current_history_list_offset = -1; |
| 675 params.current_history_list_length = 0; | 675 params.current_history_list_length = 0; |
| 676 params.url = url; | 676 params.url = url; |
| 677 params.transition = PAGE_TRANSITION_LINK; | 677 params.transition = PAGE_TRANSITION_LINK; |
| 678 params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 678 params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
| 679 Navigate(params); | 679 Navigate(params); |
| 680 } | 680 } |
| 681 | 681 |
| 682 void RenderFrameHostImpl::SelectRange(const gfx::Point& start, | 682 void RenderFrameHostImpl::SelectRange(const gfx::Point& start, |
| 683 const gfx::Point& end) { | 683 const gfx::Point& end) { |
| 684 Send(new InputMsg_SelectRange(routing_id_, start, end)); | 684 Send(new InputMsg_SelectRange(routing_id_, start, end)); |
| 685 } | 685 } |
| 686 | 686 |
| 687 } // namespace content | 687 } // namespace content |
| OLD | NEW |