| 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_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 void RenderWidgetHostImpl::SetNeedsFlush() { | 395 void RenderWidgetHostImpl::SetNeedsFlush() { |
| 396 if (view_) | 396 if (view_) |
| 397 view_->OnSetNeedsFlushInput(); | 397 view_->OnSetNeedsFlushInput(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 void RenderWidgetHostImpl::Init() { | 400 void RenderWidgetHostImpl::Init() { |
| 401 DCHECK(process_->HasConnection()); | 401 DCHECK(process_->HasConnection()); |
| 402 | 402 |
| 403 renderer_initialized_ = true; | 403 renderer_initialized_ = true; |
| 404 | 404 |
| 405 // Send the ack along with the information on placement. | |
| 406 Send(new ViewMsg_CreatingNew_ACK(routing_id_)); | |
| 407 GetProcess()->ResumeRequestsForView(routing_id_); | 405 GetProcess()->ResumeRequestsForView(routing_id_); |
| 408 | 406 |
| 409 // If the RWHV has not yet been set, the surface ID namespace will get | 407 // If the RWHV has not yet been set, the surface ID namespace will get |
| 410 // passed down by the call to SetView(). | 408 // passed down by the call to SetView(). |
| 411 if (view_) { | 409 if (view_) { |
| 412 Send(new ViewMsg_SetSurfaceIdNamespace(routing_id_, | 410 Send(new ViewMsg_SetSurfaceIdNamespace(routing_id_, |
| 413 view_->GetSurfaceIdNamespace())); | 411 view_->GetSurfaceIdNamespace())); |
| 414 } | 412 } |
| 415 | 413 |
| 414 SendScreenRects(); |
| 416 WasResized(); | 415 WasResized(); |
| 417 } | 416 } |
| 418 | 417 |
| 419 void RenderWidgetHostImpl::InitForFrame() { | 418 void RenderWidgetHostImpl::InitForFrame() { |
| 420 DCHECK(process_->HasConnection()); | 419 DCHECK(process_->HasConnection()); |
| 421 renderer_initialized_ = true; | 420 renderer_initialized_ = true; |
| 422 } | 421 } |
| 423 | 422 |
| 424 void RenderWidgetHostImpl::Shutdown() { | 423 void RenderWidgetHostImpl::Shutdown() { |
| 425 RejectMouseLockOrUnlockIfNecessary(); | 424 RejectMouseLockOrUnlockIfNecessary(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 442 } | 441 } |
| 443 | 442 |
| 444 bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) { | 443 bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) { |
| 445 bool handled = true; | 444 bool handled = true; |
| 446 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostImpl, msg) | 445 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostImpl, msg) |
| 447 IPC_MESSAGE_HANDLER(FrameHostMsg_RenderProcessGone, OnRenderProcessGone) | 446 IPC_MESSAGE_HANDLER(FrameHostMsg_RenderProcessGone, OnRenderProcessGone) |
| 448 IPC_MESSAGE_HANDLER(InputHostMsg_QueueSyntheticGesture, | 447 IPC_MESSAGE_HANDLER(InputHostMsg_QueueSyntheticGesture, |
| 449 OnQueueSyntheticGesture) | 448 OnQueueSyntheticGesture) |
| 450 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, | 449 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, |
| 451 OnImeCancelComposition) | 450 OnImeCancelComposition) |
| 452 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) | |
| 453 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) | 451 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) |
| 454 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, | 452 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, |
| 455 OnUpdateScreenRectsAck) | 453 OnUpdateScreenRectsAck) |
| 456 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) | 454 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) |
| 457 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) | 455 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) |
| 458 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, | 456 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, |
| 459 OnSwapCompositorFrame(msg)) | 457 OnSwapCompositorFrame(msg)) |
| 460 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) | 458 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) |
| 461 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) | 459 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) |
| 462 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) | 460 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) |
| (...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 NotifyRendererResponsive(); | 1433 NotifyRendererResponsive(); |
| 1436 } | 1434 } |
| 1437 } | 1435 } |
| 1438 | 1436 |
| 1439 void RenderWidgetHostImpl::ClearDisplayedGraphics() { | 1437 void RenderWidgetHostImpl::ClearDisplayedGraphics() { |
| 1440 NotifyNewContentRenderingTimeoutForTesting(); | 1438 NotifyNewContentRenderingTimeoutForTesting(); |
| 1441 if (view_) | 1439 if (view_) |
| 1442 view_->ClearCompositorFrame(); | 1440 view_->ClearCompositorFrame(); |
| 1443 } | 1441 } |
| 1444 | 1442 |
| 1445 void RenderWidgetHostImpl::OnRenderViewReady() { | |
| 1446 SendScreenRects(); | |
| 1447 WasResized(); | |
| 1448 } | |
| 1449 | |
| 1450 void RenderWidgetHostImpl::OnRenderProcessGone(int status, int exit_code) { | 1443 void RenderWidgetHostImpl::OnRenderProcessGone(int status, int exit_code) { |
| 1451 // RenderFrameHost owns a RenderWidgetHost when it needs one, in which case | 1444 // RenderFrameHost owns a RenderWidgetHost when it needs one, in which case |
| 1452 // it handles destruction. | 1445 // it handles destruction. |
| 1453 if (!owned_by_render_frame_host_) { | 1446 if (!owned_by_render_frame_host_) { |
| 1454 // TODO(evanm): This synchronously ends up calling "delete this". | 1447 // TODO(evanm): This synchronously ends up calling "delete this". |
| 1455 // Is that really what we want in response to this message? I'm matching | 1448 // Is that really what we want in response to this message? I'm matching |
| 1456 // previous behavior of the code here. | 1449 // previous behavior of the code here. |
| 1457 Destroy(); | 1450 Destroy(); |
| 1458 } else { | 1451 } else { |
| 1459 RendererExited(static_cast<base::TerminationStatus>(status), exit_code); | 1452 RendererExited(static_cast<base::TerminationStatus>(status), exit_code); |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2189 } | 2182 } |
| 2190 | 2183 |
| 2191 #if defined(OS_WIN) | 2184 #if defined(OS_WIN) |
| 2192 gfx::NativeViewAccessible | 2185 gfx::NativeViewAccessible |
| 2193 RenderWidgetHostImpl::GetParentNativeViewAccessible() { | 2186 RenderWidgetHostImpl::GetParentNativeViewAccessible() { |
| 2194 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; | 2187 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; |
| 2195 } | 2188 } |
| 2196 #endif | 2189 #endif |
| 2197 | 2190 |
| 2198 } // namespace content | 2191 } // namespace content |
| OLD | NEW |