| 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/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "content/browser/gpu/gpu_surface_tracker.h" | 34 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 35 #include "content/browser/host_zoom_map_impl.h" | 35 #include "content/browser/host_zoom_map_impl.h" |
| 36 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 36 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 37 #include "content/browser/renderer_host/dip_util.h" | 37 #include "content/browser/renderer_host/dip_util.h" |
| 38 #include "content/browser/renderer_host/input/timeout_monitor.h" | 38 #include "content/browser/renderer_host/input/timeout_monitor.h" |
| 39 #include "content/browser/renderer_host/media/audio_renderer_host.h" | 39 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
| 40 #include "content/browser/renderer_host/render_process_host_impl.h" | 40 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 41 #include "content/browser/renderer_host/render_view_host_delegate.h" | 41 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 42 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 42 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 43 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 43 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 44 #include "content/browser/transition_request_manager.h" |
| 44 #include "content/common/accessibility_messages.h" | 45 #include "content/common/accessibility_messages.h" |
| 45 #include "content/common/browser_plugin/browser_plugin_messages.h" | 46 #include "content/common/browser_plugin/browser_plugin_messages.h" |
| 46 #include "content/common/content_switches_internal.h" | 47 #include "content/common/content_switches_internal.h" |
| 47 #include "content/common/drag_messages.h" | 48 #include "content/common/drag_messages.h" |
| 48 #include "content/common/frame_messages.h" | 49 #include "content/common/frame_messages.h" |
| 49 #include "content/common/input_messages.h" | 50 #include "content/common/input_messages.h" |
| 50 #include "content/common/inter_process_time_ticks_converter.h" | 51 #include "content/common/inter_process_time_ticks_converter.h" |
| 51 #include "content/common/mojo/mojo_service_names.h" | 52 #include "content/common/mojo/mojo_service_names.h" |
| 52 #include "content/common/speech_recognition_messages.h" | 53 #include "content/common/speech_recognition_messages.h" |
| 53 #include "content/common/swapped_out_messages.h" | 54 #include "content/common/swapped_out_messages.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 base::Unretained(ResourceDispatcherHostImpl::Get()), | 240 base::Unretained(ResourceDispatcherHostImpl::Get()), |
| 240 GetProcess()->GetID(), GetRoutingID())); | 241 GetProcess()->GetID(), GetRoutingID())); |
| 241 } | 242 } |
| 242 | 243 |
| 243 delegate_->RenderViewDeleted(this); | 244 delegate_->RenderViewDeleted(this); |
| 244 | 245 |
| 245 // Be sure to clean up any leftover state from cross-site requests. | 246 // Be sure to clean up any leftover state from cross-site requests. |
| 246 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( | 247 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( |
| 247 GetProcess()->GetID(), GetRoutingID(), false); | 248 GetProcess()->GetID(), GetRoutingID(), false); |
| 248 | 249 |
| 250 SetHasPendingTransitionRequest(false); |
| 251 |
| 249 // If this was swapped out, it already decremented the active view | 252 // If this was swapped out, it already decremented the active view |
| 250 // count of the SiteInstance it belongs to. | 253 // count of the SiteInstance it belongs to. |
| 251 if (IsRVHStateActive(rvh_state_)) | 254 if (IsRVHStateActive(rvh_state_)) |
| 252 instance_->decrement_active_view_count(); | 255 instance_->decrement_active_view_count(); |
| 253 } | 256 } |
| 254 | 257 |
| 255 RenderViewHostDelegate* RenderViewHostImpl::GetDelegate() const { | 258 RenderViewHostDelegate* RenderViewHostImpl::GetDelegate() const { |
| 256 return delegate_; | 259 return delegate_; |
| 257 } | 260 } |
| 258 | 261 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 return CrossSiteRequestManager::GetInstance()->HasPendingCrossSiteRequest( | 655 return CrossSiteRequestManager::GetInstance()->HasPendingCrossSiteRequest( |
| 653 GetProcess()->GetID(), GetRoutingID()); | 656 GetProcess()->GetID(), GetRoutingID()); |
| 654 } | 657 } |
| 655 | 658 |
| 656 void RenderViewHostImpl::SetHasPendingCrossSiteRequest( | 659 void RenderViewHostImpl::SetHasPendingCrossSiteRequest( |
| 657 bool has_pending_request) { | 660 bool has_pending_request) { |
| 658 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( | 661 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( |
| 659 GetProcess()->GetID(), GetRoutingID(), has_pending_request); | 662 GetProcess()->GetID(), GetRoutingID(), has_pending_request); |
| 660 } | 663 } |
| 661 | 664 |
| 665 void RenderViewHostImpl::SetHasPendingTransitionRequest( |
| 666 bool has_pending_request) { |
| 667 TransitionRequestManager::GetInstance()->SetHasPendingTransitionRequest( |
| 668 GetProcess()->GetID(), GetRoutingID(), has_pending_request); |
| 669 } |
| 670 |
| 662 void RenderViewHostImpl::SetWebUIHandle(mojo::ScopedMessagePipeHandle handle) { | 671 void RenderViewHostImpl::SetWebUIHandle(mojo::ScopedMessagePipeHandle handle) { |
| 663 // Never grant any bindings to browser plugin guests. | 672 // Never grant any bindings to browser plugin guests. |
| 664 if (GetProcess()->IsGuest()) { | 673 if (GetProcess()->IsGuest()) { |
| 665 NOTREACHED() << "Never grant bindings to a guest process."; | 674 NOTREACHED() << "Never grant bindings to a guest process."; |
| 666 return; | 675 return; |
| 667 } | 676 } |
| 668 | 677 |
| 669 if ((enabled_bindings_ & BINDINGS_POLICY_WEB_UI) == 0) { | 678 if ((enabled_bindings_ & BINDINGS_POLICY_WEB_UI) == 0) { |
| 670 NOTREACHED() << "You must grant bindings before setting the handle"; | 679 NOTREACHED() << "You must grant bindings before setting the handle"; |
| 671 return; | 680 return; |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1683 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1692 FrameTree* frame_tree = delegate_->GetFrameTree(); |
| 1684 | 1693 |
| 1685 frame_tree->ResetForMainFrameSwap(); | 1694 frame_tree->ResetForMainFrameSwap(); |
| 1686 } | 1695 } |
| 1687 | 1696 |
| 1688 void RenderViewHostImpl::SelectWordAroundCaret() { | 1697 void RenderViewHostImpl::SelectWordAroundCaret() { |
| 1689 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1698 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
| 1690 } | 1699 } |
| 1691 | 1700 |
| 1692 } // namespace content | 1701 } // namespace content |
| OLD | NEW |