| 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_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1765 | 1765 |
| 1766 void RenderWidgetHostViewAndroid::SendMouseEvent( | 1766 void RenderWidgetHostViewAndroid::SendMouseEvent( |
| 1767 const ui::MotionEventAndroid& motion_event, | 1767 const ui::MotionEventAndroid& motion_event, |
| 1768 int action_button) { | 1768 int action_button) { |
| 1769 blink::WebInputEvent::Type webMouseEventType = | 1769 blink::WebInputEvent::Type webMouseEventType = |
| 1770 ui::ToWebMouseEventType(motion_event.GetAction()); | 1770 ui::ToWebMouseEventType(motion_event.GetAction()); |
| 1771 | 1771 |
| 1772 blink::WebMouseEvent mouse_event = WebMouseEventBuilder::Build( | 1772 blink::WebMouseEvent mouse_event = WebMouseEventBuilder::Build( |
| 1773 webMouseEventType, | 1773 webMouseEventType, |
| 1774 ui::EventTimeStampToSeconds(motion_event.GetEventTime()), | 1774 ui::EventTimeStampToSeconds(motion_event.GetEventTime()), |
| 1775 motion_event.GetX(0), | 1775 motion_event.GetX(0), motion_event.GetY(0), motion_event.GetFlags(), |
| 1776 motion_event.GetY(0), | |
| 1777 motion_event.GetFlags(), | |
| 1778 motion_event.GetButtonState() ? 1 : 0 /* click count */, | 1776 motion_event.GetButtonState() ? 1 : 0 /* click count */, |
| 1779 motion_event.GetPointerId(0), | 1777 motion_event.GetPointerId(0), motion_event.GetPressure(0), |
| 1780 motion_event.GetPressure(0), | 1778 motion_event.GetOrientation(0), motion_event.GetTiltX(0), |
| 1781 motion_event.GetOrientation(0), | 1779 motion_event.GetTiltY(0), action_button, motion_event.GetToolType(0)); |
| 1782 motion_event.GetTilt(0), | |
| 1783 action_button, | |
| 1784 motion_event.GetToolType(0)); | |
| 1785 | 1780 |
| 1786 if (!host_ || !host_->delegate()) | 1781 if (!host_ || !host_->delegate()) |
| 1787 return; | 1782 return; |
| 1788 | 1783 |
| 1789 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() && | 1784 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() && |
| 1790 host_->delegate()->GetInputEventRouter()) { | 1785 host_->delegate()->GetInputEventRouter()) { |
| 1791 host_->delegate()->GetInputEventRouter()->RouteMouseEvent( | 1786 host_->delegate()->GetInputEventRouter()->RouteMouseEvent( |
| 1792 this, &mouse_event, ui::LatencyInfo()); | 1787 this, &mouse_event, ui::LatencyInfo()); |
| 1793 } else { | 1788 } else { |
| 1794 host_->ForwardMouseEvent(mouse_event); | 1789 host_->ForwardMouseEvent(mouse_event); |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2223 | 2218 |
| 2224 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2219 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
| 2225 if (!compositor) | 2220 if (!compositor) |
| 2226 return; | 2221 return; |
| 2227 | 2222 |
| 2228 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2223 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
| 2229 overscroll_refresh_handler, compositor, view_.GetDipScale()); | 2224 overscroll_refresh_handler, compositor, view_.GetDipScale()); |
| 2230 } | 2225 } |
| 2231 | 2226 |
| 2232 } // namespace content | 2227 } // namespace content |
| OLD | NEW |