| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef UI_ANDROID_VIEW_ANDROID_H_ | 5 #ifndef UI_ANDROID_VIEW_ANDROID_H_ |
| 6 #define UI_ANDROID_VIEW_ANDROID_H_ | 6 #define UI_ANDROID_VIEW_ANDROID_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 private: | 157 private: |
| 158 friend class EventForwarder; | 158 friend class EventForwarder; |
| 159 friend class ViewAndroidBoundsTest; | 159 friend class ViewAndroidBoundsTest; |
| 160 | 160 |
| 161 using ViewClientCallback = | 161 using ViewClientCallback = |
| 162 const base::Callback<bool(ViewClient*, const MotionEventAndroid&)>; | 162 const base::Callback<bool(ViewClient*, const MotionEventAndroid&)>; |
| 163 | 163 |
| 164 bool OnTouchEvent(const MotionEventAndroid& event, bool for_touch_handle); | 164 bool OnTouchEvent(const MotionEventAndroid& event, bool for_touch_handle); |
| 165 bool OnMouseEvent(const MotionEventAndroid& event); | 165 bool OnMouseEvent(const MotionEventAndroid& event); |
| 166 bool OnMouseWheelEvent(const MotionEventAndroid& event); |
| 166 | 167 |
| 167 void RemoveChild(ViewAndroid* child); | 168 void RemoveChild(ViewAndroid* child); |
| 168 | 169 |
| 169 bool HitTest(ViewClientCallback send_to_client, | 170 bool HitTest(ViewClientCallback send_to_client, |
| 170 const MotionEventAndroid& event); | 171 const MotionEventAndroid& event); |
| 171 | 172 |
| 172 static bool SendTouchEventToClient(bool for_touch_handle, | 173 static bool SendTouchEventToClient(bool for_touch_handle, |
| 173 ViewClient* client, | 174 ViewClient* client, |
| 174 const MotionEventAndroid& event); | 175 const MotionEventAndroid& event); |
| 175 static bool SendMouseEventToClient(ViewClient* client, | 176 static bool SendMouseEventToClient(ViewClient* client, |
| 176 const MotionEventAndroid& event); | 177 const MotionEventAndroid& event); |
| 178 static bool SendMouseWheelEventToClient(ViewClient* client, |
| 179 const MotionEventAndroid& event); |
| 177 | 180 |
| 178 bool has_event_forwarder() const { return !!event_forwarder_; } | 181 bool has_event_forwarder() const { return !!event_forwarder_; } |
| 179 | 182 |
| 180 // Returns true if any node of the tree along the hierarchy (view's children | 183 // Returns true if any node of the tree along the hierarchy (view's children |
| 181 // and parents) already has |EventForwarder| attached to it. | 184 // and parents) already has |EventForwarder| attached to it. |
| 182 static bool ViewTreeHasEventForwarder(ViewAndroid* view); | 185 static bool ViewTreeHasEventForwarder(ViewAndroid* view); |
| 183 | 186 |
| 184 // Returns true if any children node (or self) has |EventForwarder|. | 187 // Returns true if any children node (or self) has |EventForwarder|. |
| 185 static bool SubtreeHasEventForwarder(ViewAndroid* view); | 188 static bool SubtreeHasEventForwarder(ViewAndroid* view); |
| 186 | 189 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 202 | 205 |
| 203 gfx::Vector2dF content_offset_; // in CSS pixel. | 206 gfx::Vector2dF content_offset_; // in CSS pixel. |
| 204 std::unique_ptr<EventForwarder> event_forwarder_; | 207 std::unique_ptr<EventForwarder> event_forwarder_; |
| 205 | 208 |
| 206 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); | 209 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); |
| 207 }; | 210 }; |
| 208 | 211 |
| 209 } // namespace ui | 212 } // namespace ui |
| 210 | 213 |
| 211 #endif // UI_ANDROID_VIEW_ANDROID_H_ | 214 #endif // UI_ANDROID_VIEW_ANDROID_H_ |
| OLD | NEW |