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 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2102 InputEventAckState ack_result) { | 2102 InputEventAckState ack_result) { |
2103 if (!wheel_event.latency.FindLatency( | 2103 if (!wheel_event.latency.FindLatency( |
2104 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) { | 2104 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) { |
2105 // MouseWheelEvent latency ends when it is acked but does not cause any | 2105 // MouseWheelEvent latency ends when it is acked but does not cause any |
2106 // rendering scheduled. | 2106 // rendering scheduled. |
2107 ui::LatencyInfo latency = wheel_event.latency; | 2107 ui::LatencyInfo latency = wheel_event.latency; |
2108 latency.AddLatencyNumber( | 2108 latency.AddLatencyNumber( |
2109 ui::INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT, 0, 0); | 2109 ui::INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT, 0, 0); |
2110 } | 2110 } |
2111 | 2111 |
2112 const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result); | 2112 bool consumed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result); |
2113 if (!processed && !is_hidden() && view_) { | 2113 if (!is_hidden() && view_) { |
2114 if (!delegate_->HandleWheelEvent(wheel_event.event)) | 2114 // If the renderer did not consume the event, give the delegate a chance |
2115 view_->UnhandledWheelEvent(wheel_event.event); | 2115 // to consume it. |
| 2116 if (!consumed) |
| 2117 consumed = delegate_->HandleWheelEvent(wheel_event.event); |
| 2118 view_->HandledWheelEvent(wheel_event.event, consumed); |
2116 } | 2119 } |
2117 } | 2120 } |
2118 | 2121 |
2119 void RenderWidgetHostImpl::OnGestureEventAck( | 2122 void RenderWidgetHostImpl::OnGestureEventAck( |
2120 const GestureEventWithLatencyInfo& event, | 2123 const GestureEventWithLatencyInfo& event, |
2121 InputEventAckState ack_result) { | 2124 InputEventAckState ack_result) { |
2122 if (!event.latency.FindLatency( | 2125 if (!event.latency.FindLatency( |
2123 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) { | 2126 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) { |
2124 // GestureEvent latency ends when it is acked but does not cause any | 2127 // GestureEvent latency ends when it is acked but does not cause any |
2125 // rendering scheduled. | 2128 // rendering scheduled. |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2545 } | 2548 } |
2546 } | 2549 } |
2547 | 2550 |
2548 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { | 2551 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { |
2549 if (view_) | 2552 if (view_) |
2550 return view_->PreferredReadbackFormat(); | 2553 return view_->PreferredReadbackFormat(); |
2551 return SkBitmap::kARGB_8888_Config; | 2554 return SkBitmap::kARGB_8888_Config; |
2552 } | 2555 } |
2553 | 2556 |
2554 } // namespace content | 2557 } // namespace content |
OLD | NEW |