| 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 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 IPC_MESSAGE_HANDLER(FrameHostMsg_HittestData, OnHittestData) | 556 IPC_MESSAGE_HANDLER(FrameHostMsg_HittestData, OnHittestData) |
| 557 IPC_MESSAGE_HANDLER(InputHostMsg_QueueSyntheticGesture, | 557 IPC_MESSAGE_HANDLER(InputHostMsg_QueueSyntheticGesture, |
| 558 OnQueueSyntheticGesture) | 558 OnQueueSyntheticGesture) |
| 559 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, | 559 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, |
| 560 OnImeCancelComposition) | 560 OnImeCancelComposition) |
| 561 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) | 561 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) |
| 562 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, | 562 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, |
| 563 OnUpdateScreenRectsAck) | 563 OnUpdateScreenRectsAck) |
| 564 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) | 564 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) |
| 565 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) | 565 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) |
| 566 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginFrameDidNotSwap, BeginFrameDidNotSwap) | 566 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginFrameDidNotProduceFrame, |
| 567 BeginFrameDidNotProduceFrame) |
| 567 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) | 568 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) |
| 568 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) | 569 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) |
| 569 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, | 570 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, |
| 570 OnTextInputStateChanged) | 571 OnTextInputStateChanged) |
| 571 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) | 572 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) |
| 572 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse) | 573 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse) |
| 573 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup, | 574 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup, |
| 574 OnShowDisambiguationPopup) | 575 OnShowDisambiguationPopup) |
| 575 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, | 576 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, |
| 576 OnSelectionBoundsChanged) | 577 OnSelectionBoundsChanged) |
| (...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1936 SendScreenRects(); | 1937 SendScreenRects(); |
| 1937 } | 1938 } |
| 1938 | 1939 |
| 1939 void RenderWidgetHostImpl::OnRequestMove(const gfx::Rect& pos) { | 1940 void RenderWidgetHostImpl::OnRequestMove(const gfx::Rect& pos) { |
| 1940 if (view_) { | 1941 if (view_) { |
| 1941 view_->SetBounds(pos); | 1942 view_->SetBounds(pos); |
| 1942 Send(new ViewMsg_Move_ACK(routing_id_)); | 1943 Send(new ViewMsg_Move_ACK(routing_id_)); |
| 1943 } | 1944 } |
| 1944 } | 1945 } |
| 1945 | 1946 |
| 1946 void RenderWidgetHostImpl::BeginFrameDidNotSwap(const cc::BeginFrameAck& ack) { | 1947 void RenderWidgetHostImpl::BeginFrameDidNotProduceFrame( |
| 1948 const cc::BeginFrameAck& ack) { |
| 1947 // |has_damage| is not transmitted. | 1949 // |has_damage| is not transmitted. |
| 1948 cc::BeginFrameAck modified_ack = ack; | 1950 cc::BeginFrameAck modified_ack = ack; |
| 1949 modified_ack.has_damage = false; | 1951 modified_ack.has_damage = false; |
| 1950 | 1952 |
| 1951 if (view_) | 1953 if (view_) |
| 1952 view_->OnBeginFrameDidNotSwap(modified_ack); | 1954 view_->OnBeginFrameDidNotProduceFrame(modified_ack); |
| 1953 } | 1955 } |
| 1954 | 1956 |
| 1955 void RenderWidgetHostImpl::OnUpdateRect( | 1957 void RenderWidgetHostImpl::OnUpdateRect( |
| 1956 const ViewHostMsg_UpdateRect_Params& params) { | 1958 const ViewHostMsg_UpdateRect_Params& params) { |
| 1957 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); | 1959 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); |
| 1958 TimeTicks paint_start = TimeTicks::Now(); | 1960 TimeTicks paint_start = TimeTicks::Now(); |
| 1959 | 1961 |
| 1960 // Update our knowledge of the RenderWidget's size. | 1962 // Update our knowledge of the RenderWidget's size. |
| 1961 current_size_ = params.view_size; | 1963 current_size_ = params.view_size; |
| 1962 | 1964 |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2649 RenderProcessHost* rph = GetProcess(); | 2651 RenderProcessHost* rph = GetProcess(); |
| 2650 for (std::vector<IPC::Message>::const_iterator i = messages.begin(); | 2652 for (std::vector<IPC::Message>::const_iterator i = messages.begin(); |
| 2651 i != messages.end(); ++i) { | 2653 i != messages.end(); ++i) { |
| 2652 rph->OnMessageReceived(*i); | 2654 rph->OnMessageReceived(*i); |
| 2653 if (i->dispatch_error()) | 2655 if (i->dispatch_error()) |
| 2654 rph->OnBadMessageReceived(*i); | 2656 rph->OnBadMessageReceived(*i); |
| 2655 } | 2657 } |
| 2656 } | 2658 } |
| 2657 | 2659 |
| 2658 } // namespace content | 2660 } // namespace content |
| OLD | NEW |