| 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 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1590 if (host_->delegate()) | 1590 if (host_->delegate()) |
| 1591 target_host = host_->delegate()->GetFocusedRenderWidgetHost(host_); | 1591 target_host = host_->delegate()->GetFocusedRenderWidgetHost(host_); |
| 1592 if (!target_host) | 1592 if (!target_host) |
| 1593 return; | 1593 return; |
| 1594 | 1594 |
| 1595 target_host->ForwardKeyboardEvent(event); | 1595 target_host->ForwardKeyboardEvent(event); |
| 1596 } | 1596 } |
| 1597 | 1597 |
| 1598 void RenderWidgetHostViewAndroid::SendMouseEvent( | 1598 void RenderWidgetHostViewAndroid::SendMouseEvent( |
| 1599 const ui::MotionEventAndroid& motion_event, | 1599 const ui::MotionEventAndroid& motion_event, |
| 1600 int changed_button) { | 1600 int action_button) { |
| 1601 blink::WebInputEvent::Type webMouseEventType = | 1601 blink::WebInputEvent::Type webMouseEventType = |
| 1602 ui::ToWebMouseEventType(motion_event.GetAction()); | 1602 ui::ToWebMouseEventType(motion_event.GetAction()); |
| 1603 | 1603 |
| 1604 blink::WebMouseEvent mouse_event = WebMouseEventBuilder::Build( | 1604 blink::WebMouseEvent mouse_event = WebMouseEventBuilder::Build( |
| 1605 webMouseEventType, | 1605 webMouseEventType, |
| 1606 ui::EventTimeStampToSeconds(motion_event.GetEventTime()), | 1606 ui::EventTimeStampToSeconds(motion_event.GetEventTime()), |
| 1607 motion_event.GetX(0), | 1607 motion_event.GetX(0), |
| 1608 motion_event.GetY(0), | 1608 motion_event.GetY(0), |
| 1609 motion_event.GetFlags(), | 1609 motion_event.GetFlags(), |
| 1610 motion_event.GetButtonState() ? 1 : 0 /* click count */, | 1610 motion_event.GetButtonState() ? 1 : 0 /* click count */, |
| 1611 motion_event.GetPointerId(0), | 1611 motion_event.GetPointerId(0), |
| 1612 motion_event.GetPressure(0), | 1612 motion_event.GetPressure(0), |
| 1613 motion_event.GetOrientation(0), | 1613 motion_event.GetOrientation(0), |
| 1614 motion_event.GetTilt(0), | 1614 motion_event.GetTilt(0), |
| 1615 changed_button, | 1615 action_button, |
| 1616 motion_event.GetToolType(0)); | 1616 motion_event.GetToolType(0)); |
| 1617 | 1617 |
| 1618 if (host_) | 1618 if (host_) |
| 1619 host_->ForwardMouseEvent(mouse_event); | 1619 host_->ForwardMouseEvent(mouse_event); |
| 1620 } | 1620 } |
| 1621 | 1621 |
| 1622 void RenderWidgetHostViewAndroid::SendMouseWheelEvent( | 1622 void RenderWidgetHostViewAndroid::SendMouseWheelEvent( |
| 1623 const blink::WebMouseWheelEvent& event) { | 1623 const blink::WebMouseWheelEvent& event) { |
| 1624 if (host_) { | 1624 if (host_) { |
| 1625 ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL); | 1625 ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL); |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1974 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 1974 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
| 1975 if (!compositor) | 1975 if (!compositor) |
| 1976 return; | 1976 return; |
| 1977 | 1977 |
| 1978 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 1978 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
| 1979 overscroll_refresh_handler, compositor, | 1979 overscroll_refresh_handler, compositor, |
| 1980 ui::GetScaleFactorForNativeView(GetNativeView())); | 1980 ui::GetScaleFactorForNativeView(GetNativeView())); |
| 1981 } | 1981 } |
| 1982 | 1982 |
| 1983 } // namespace content | 1983 } // namespace content |
| OLD | NEW |