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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } else { | 209 } else { |
210 rvh_state_ = STATE_DEFAULT; | 210 rvh_state_ = STATE_DEFAULT; |
211 instance_->increment_active_view_count(); | 211 instance_->increment_active_view_count(); |
212 } | 212 } |
213 | 213 |
214 if (ResourceDispatcherHostImpl::Get()) { | 214 if (ResourceDispatcherHostImpl::Get()) { |
215 BrowserThread::PostTask( | 215 BrowserThread::PostTask( |
216 BrowserThread::IO, FROM_HERE, | 216 BrowserThread::IO, FROM_HERE, |
217 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostCreated, | 217 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostCreated, |
218 base::Unretained(ResourceDispatcherHostImpl::Get()), | 218 base::Unretained(ResourceDispatcherHostImpl::Get()), |
219 GetProcess()->GetID(), GetRoutingID())); | 219 GetProcess()->GetID(), GetRoutingID(), !is_hidden())); |
220 } | 220 } |
221 | 221 |
222 #if defined(ENABLE_BROWSER_CDMS) | 222 #if defined(ENABLE_BROWSER_CDMS) |
223 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); | 223 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); |
224 #endif | 224 #endif |
225 | 225 |
226 unload_event_monitor_timeout_.reset(new TimeoutMonitor(base::Bind( | 226 unload_event_monitor_timeout_.reset(new TimeoutMonitor(base::Bind( |
227 &RenderViewHostImpl::OnSwappedOut, weak_factory_.GetWeakPtr(), true))); | 227 &RenderViewHostImpl::OnSwappedOut, weak_factory_.GetWeakPtr(), true))); |
228 } | 228 } |
229 | 229 |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 if (GetProcess()->HasConnection()) { | 973 if (GetProcess()->HasConnection()) { |
974 RenderProcessHostImpl::ReleaseOnCloseACK( | 974 RenderProcessHostImpl::ReleaseOnCloseACK( |
975 GetProcess(), | 975 GetProcess(), |
976 delegate_->GetSessionStorageNamespaceMap(), | 976 delegate_->GetSessionStorageNamespaceMap(), |
977 GetRoutingID()); | 977 GetRoutingID()); |
978 } | 978 } |
979 | 979 |
980 RenderWidgetHostImpl::Shutdown(); | 980 RenderWidgetHostImpl::Shutdown(); |
981 } | 981 } |
982 | 982 |
| 983 void RenderViewHostImpl::WasHidden() { |
| 984 if (ResourceDispatcherHostImpl::Get()) { |
| 985 BrowserThread::PostTask( |
| 986 BrowserThread::IO, FROM_HERE, |
| 987 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostWasHidden, |
| 988 base::Unretained(ResourceDispatcherHostImpl::Get()), |
| 989 GetProcess()->GetID(), GetRoutingID())); |
| 990 } |
| 991 |
| 992 RenderWidgetHostImpl::WasHidden(); |
| 993 } |
| 994 |
| 995 void RenderViewHostImpl::WasShown(const ui::LatencyInfo& latency_info) { |
| 996 if (ResourceDispatcherHostImpl::Get()) { |
| 997 BrowserThread::PostTask( |
| 998 BrowserThread::IO, FROM_HERE, |
| 999 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostWasShown, |
| 1000 base::Unretained(ResourceDispatcherHostImpl::Get()), |
| 1001 GetProcess()->GetID(), GetRoutingID())); |
| 1002 } |
| 1003 |
| 1004 RenderWidgetHostImpl::WasShown(latency_info); |
| 1005 } |
| 1006 |
983 bool RenderViewHostImpl::IsRenderView() const { | 1007 bool RenderViewHostImpl::IsRenderView() const { |
984 return true; | 1008 return true; |
985 } | 1009 } |
986 | 1010 |
987 void RenderViewHostImpl::CreateNewWindow( | 1011 void RenderViewHostImpl::CreateNewWindow( |
988 int route_id, | 1012 int route_id, |
989 int main_frame_route_id, | 1013 int main_frame_route_id, |
990 const ViewHostMsg_CreateWindow_Params& params, | 1014 const ViewHostMsg_CreateWindow_Params& params, |
991 SessionStorageNamespace* session_storage_namespace) { | 1015 SessionStorageNamespace* session_storage_namespace) { |
992 ViewHostMsg_CreateWindow_Params validated_params(params); | 1016 ViewHostMsg_CreateWindow_Params validated_params(params); |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1589 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1566 | 1590 |
1567 frame_tree->ResetForMainFrameSwap(); | 1591 frame_tree->ResetForMainFrameSwap(); |
1568 } | 1592 } |
1569 | 1593 |
1570 void RenderViewHostImpl::SelectWordAroundCaret() { | 1594 void RenderViewHostImpl::SelectWordAroundCaret() { |
1571 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1595 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1572 } | 1596 } |
1573 | 1597 |
1574 } // namespace content | 1598 } // namespace content |
OLD | NEW |