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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1583 // now, we can send the next mouse move event | 1583 // now, we can send the next mouse move event |
1584 if (next_mouse_move_.get()) { | 1584 if (next_mouse_move_.get()) { |
1585 DCHECK(next_mouse_move_->type == WebInputEvent::MouseMove); | 1585 DCHECK(next_mouse_move_->type == WebInputEvent::MouseMove); |
1586 ForwardMouseEvent(*next_mouse_move_); | 1586 ForwardMouseEvent(*next_mouse_move_); |
1587 } | 1587 } |
1588 } else if (WebInputEvent::isKeyboardEventType(type)) { | 1588 } else if (WebInputEvent::isKeyboardEventType(type)) { |
1589 ProcessKeyboardEventAck(type, processed); | 1589 ProcessKeyboardEventAck(type, processed); |
1590 } else if (type == WebInputEvent::MouseWheel) { | 1590 } else if (type == WebInputEvent::MouseWheel) { |
1591 ProcessWheelAck(processed); | 1591 ProcessWheelAck(processed); |
1592 } else if (WebInputEvent::isTouchEventType(type)) { | 1592 } else if (WebInputEvent::isTouchEventType(type)) { |
1593 ProcessTouchAck(event_type, processed); | 1593 ProcessTouchAck(processed); |
1594 } else if (WebInputEvent::isGestureEventType(type)) { | 1594 } else if (WebInputEvent::isGestureEventType(type)) { |
1595 ProcessGestureAck(processed, type); | 1595 ProcessGestureAck(processed, type); |
1596 } | 1596 } |
1597 | 1597 |
1598 // If an input ack is pending, then hold off ticking the gesture | 1598 // If an input ack is pending, then hold off ticking the gesture |
1599 // until we get an input ack. | 1599 // until we get an input ack. |
1600 if (in_process_event_types_.size() == 0 && | 1600 if (in_process_event_types_.size() == 0 && |
1601 !active_smooth_scroll_gestures_.empty()) | 1601 !active_smooth_scroll_gestures_.empty()) |
1602 TickActiveSmoothScrollGesture(); | 1602 TickActiveSmoothScrollGesture(); |
1603 | 1603 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 } | 1721 } |
1722 | 1722 |
1723 if (!processed && !is_hidden_ && view_) | 1723 if (!processed && !is_hidden_ && view_) |
1724 view_->UnhandledWheelEvent(current_wheel_event_); | 1724 view_->UnhandledWheelEvent(current_wheel_event_); |
1725 } | 1725 } |
1726 | 1726 |
1727 void RenderWidgetHostImpl::ProcessGestureAck(bool processed, int type) { | 1727 void RenderWidgetHostImpl::ProcessGestureAck(bool processed, int type) { |
1728 gesture_event_filter_->ProcessGestureAck(processed, type); | 1728 gesture_event_filter_->ProcessGestureAck(processed, type); |
1729 } | 1729 } |
1730 | 1730 |
1731 void RenderWidgetHostImpl::ProcessTouchAck( | 1731 void RenderWidgetHostImpl::ProcessTouchAck(bool processed) { |
1732 WebInputEvent::Type type, bool processed) { | |
1733 if (view_) | 1732 if (view_) |
1734 view_->ProcessTouchAck(type, processed); | 1733 view_->ProcessTouchAck(processed); |
1735 } | 1734 } |
1736 | 1735 |
1737 void RenderWidgetHostImpl::OnMsgFocus() { | 1736 void RenderWidgetHostImpl::OnMsgFocus() { |
1738 // Only RenderViewHost can deal with that message. | 1737 // Only RenderViewHost can deal with that message. |
1739 RecordAction(UserMetricsAction("BadMessageTerminate_RWH4")); | 1738 RecordAction(UserMetricsAction("BadMessageTerminate_RWH4")); |
1740 GetProcess()->ReceivedBadMessage(); | 1739 GetProcess()->ReceivedBadMessage(); |
1741 } | 1740 } |
1742 | 1741 |
1743 void RenderWidgetHostImpl::OnMsgBlur() { | 1742 void RenderWidgetHostImpl::OnMsgBlur() { |
1744 // Only RenderViewHost can deal with that message. | 1743 // Only RenderViewHost can deal with that message. |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 return; | 2120 return; |
2122 | 2121 |
2123 OnRenderAutoResized(new_size); | 2122 OnRenderAutoResized(new_size); |
2124 } | 2123 } |
2125 | 2124 |
2126 void RenderWidgetHostImpl::DetachDelegate() { | 2125 void RenderWidgetHostImpl::DetachDelegate() { |
2127 delegate_ = NULL; | 2126 delegate_ = NULL; |
2128 } | 2127 } |
2129 | 2128 |
2130 } // namespace content | 2129 } // namespace content |
OLD | NEW |