| 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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection) | 614 IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection) |
| 615 IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck) | 615 IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck) |
| 616 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects) | 616 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects) |
| 617 #if defined(OS_ANDROID) | 617 #if defined(OS_ANDROID) |
| 618 IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded) | 618 IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded) |
| 619 IPC_MESSAGE_HANDLER(ViewMsg_ImeEventAck, OnImeEventAck) | 619 IPC_MESSAGE_HANDLER(ViewMsg_ImeEventAck, OnImeEventAck) |
| 620 #endif | 620 #endif |
| 621 IPC_MESSAGE_HANDLER(ViewMsg_Snapshot, OnSnapshot) | 621 IPC_MESSAGE_HANDLER(ViewMsg_Snapshot, OnSnapshot) |
| 622 IPC_MESSAGE_HANDLER(ViewMsg_SetBrowserRenderingStats, | 622 IPC_MESSAGE_HANDLER(ViewMsg_SetBrowserRenderingStats, |
| 623 OnSetBrowserRenderingStats) | 623 OnSetBrowserRenderingStats) |
| 624 IPC_MESSAGE_HANDLER(ViewMsg_ConfigureSyntheticDelayAck, |
| 625 OnConfigureSyntheticDelayAck) |
| 624 IPC_MESSAGE_UNHANDLED(handled = false) | 626 IPC_MESSAGE_UNHANDLED(handled = false) |
| 625 IPC_END_MESSAGE_MAP() | 627 IPC_END_MESSAGE_MAP() |
| 626 return handled; | 628 return handled; |
| 627 } | 629 } |
| 628 | 630 |
| 629 bool RenderWidget::Send(IPC::Message* message) { | 631 bool RenderWidget::Send(IPC::Message* message) { |
| 630 // Don't send any messages after the browser has told us to close, and filter | 632 // Don't send any messages after the browser has told us to close, and filter |
| 631 // most outgoing messages while swapped out. | 633 // most outgoing messages while swapped out. |
| 632 if ((is_swapped_out_ && | 634 if ((is_swapped_out_ && |
| 633 !SwappedOutMessages::CanSendWhileSwappedOut(message)) || | 635 !SwappedOutMessages::CanSendWhileSwappedOut(message)) || |
| (...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2723 | 2725 |
| 2724 void RenderWidget::OnSetBrowserRenderingStats( | 2726 void RenderWidget::OnSetBrowserRenderingStats( |
| 2725 const BrowserRenderingStats& stats) { | 2727 const BrowserRenderingStats& stats) { |
| 2726 browser_rendering_stats_ = stats; | 2728 browser_rendering_stats_ = stats; |
| 2727 } | 2729 } |
| 2728 | 2730 |
| 2729 void RenderWidget::GetBrowserRenderingStats(BrowserRenderingStats* stats) { | 2731 void RenderWidget::GetBrowserRenderingStats(BrowserRenderingStats* stats) { |
| 2730 *stats = browser_rendering_stats_; | 2732 *stats = browser_rendering_stats_; |
| 2731 } | 2733 } |
| 2732 | 2734 |
| 2735 void RenderWidget::ConfigureSyntheticDelay( |
| 2736 const std::string& name, |
| 2737 base::TimeDelta target_duration, |
| 2738 base::debug::TraceEventSyntheticDelay::Mode mode, |
| 2739 const SyntheticDelayConfigurationCallback& callback) { |
| 2740 DCHECK(!callback.is_null()); |
| 2741 |
| 2742 ViewHostMsg_ConfigureSyntheticDelay_Params params; |
| 2743 params.name = name; |
| 2744 params.target_duration = target_duration; |
| 2745 params.mode = mode; |
| 2746 |
| 2747 Send(new ViewHostMsg_ConfigureSyntheticDelay(routing_id_, params)); |
| 2748 pending_delay_configuration_ = callback; |
| 2749 } |
| 2750 |
| 2751 void RenderWidget::OnConfigureSyntheticDelayAck() { |
| 2752 pending_delay_configuration_.Run(); |
| 2753 } |
| 2754 |
| 2733 void RenderWidget::BeginSmoothScroll( | 2755 void RenderWidget::BeginSmoothScroll( |
| 2734 bool down, | 2756 bool down, |
| 2735 const SyntheticGestureCompletionCallback& callback, | 2757 const SyntheticGestureCompletionCallback& callback, |
| 2736 int pixels_to_scroll, | 2758 int pixels_to_scroll, |
| 2737 int mouse_event_x, | 2759 int mouse_event_x, |
| 2738 int mouse_event_y) { | 2760 int mouse_event_y) { |
| 2739 DCHECK(!callback.is_null()); | 2761 DCHECK(!callback.is_null()); |
| 2740 | 2762 |
| 2741 ViewHostMsg_BeginSmoothScroll_Params params; | 2763 ViewHostMsg_BeginSmoothScroll_Params params; |
| 2742 params.scroll_down = down; | 2764 params.scroll_down = down; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2842 GetURLForGraphicsContext3D(), | 2864 GetURLForGraphicsContext3D(), |
| 2843 gpu_channel_host.get(), | 2865 gpu_channel_host.get(), |
| 2844 use_echo_for_swap_ack, | 2866 use_echo_for_swap_ack, |
| 2845 attributes, | 2867 attributes, |
| 2846 false /* bind generates resources */, | 2868 false /* bind generates resources */, |
| 2847 limits)); | 2869 limits)); |
| 2848 return context.Pass(); | 2870 return context.Pass(); |
| 2849 } | 2871 } |
| 2850 | 2872 |
| 2851 } // namespace content | 2873 } // namespace content |
| OLD | NEW |