| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 static bool SendTouchEventToClient(bool for_touch_handle, | 171 static bool SendTouchEventToClient(bool for_touch_handle, |
| 172 ViewClient* client, | 172 ViewClient* client, |
| 173 const MotionEventAndroid& event); | 173 const MotionEventAndroid& event); |
| 174 static bool SendMouseEventToClient(ViewClient* client, | 174 static bool SendMouseEventToClient(ViewClient* client, |
| 175 const MotionEventAndroid& event); | 175 const MotionEventAndroid& event); |
| 176 static bool SendMouseWheelEventToClient(ViewClient* client, | 176 static bool SendMouseWheelEventToClient(ViewClient* client, |
| 177 const MotionEventAndroid& event); | 177 const MotionEventAndroid& event); |
| 178 | 178 |
| 179 bool has_event_forwarder() const { return !!event_forwarder_; } | 179 bool has_event_forwarder() const { return !!event_forwarder_; } |
| 180 | 180 |
| 181 // Returns true if any node of the tree along the hierarchy (view's children | 181 // Checks if there is any event forwarder in any parents node, |
| 182 // and parents) already has |EventForwarder| attached to it. | 182 // or in the node paths down to each leaf of |tree|. |
| 183 static bool ViewTreeHasEventForwarder(ViewAndroid* view); | 183 bool SubtreeOrParentsHaveEventForwarder(ViewAndroid* tree); |
| 184 | |
| 185 // Returns true if any children node (or self) has |EventForwarder|. | |
| 186 static bool SubtreeHasEventForwarder(ViewAndroid* view); | 184 static bool SubtreeHasEventForwarder(ViewAndroid* view); |
| 187 | 185 |
| 188 // Returns the Java delegate for this view. This is used to delegate work | 186 // Returns the Java delegate for this view. This is used to delegate work |
| 189 // up to the embedding view (or the embedder that can deal with the | 187 // up to the embedding view (or the embedder that can deal with the |
| 190 // implementation details). | 188 // implementation details). |
| 191 const base::android::ScopedJavaLocalRef<jobject> | 189 const base::android::ScopedJavaLocalRef<jobject> |
| 192 GetViewAndroidDelegate() const; | 190 GetViewAndroidDelegate() const; |
| 193 | 191 |
| 194 std::list<ViewAndroid*> children_; | 192 std::list<ViewAndroid*> children_; |
| 195 scoped_refptr<cc::Layer> layer_; | 193 scoped_refptr<cc::Layer> layer_; |
| 196 JavaObjectWeakGlobalRef delegate_; | 194 JavaObjectWeakGlobalRef delegate_; |
| 197 | 195 |
| 198 ViewClient* const client_; | 196 ViewClient* const client_; |
| 199 | 197 |
| 200 // Basic view layout information. Used to do hit testing deciding whether | 198 // Basic view layout information. Used to do hit testing deciding whether |
| 201 // the passed events should be processed by the view. | 199 // the passed events should be processed by the view. |
| 202 LayoutParams layout_params_; | 200 LayoutParams layout_params_; |
| 203 | 201 |
| 204 gfx::Vector2dF content_offset_; // in CSS pixel. | 202 gfx::Vector2dF content_offset_; // in CSS pixel. |
| 205 std::unique_ptr<EventForwarder> event_forwarder_; | 203 std::unique_ptr<EventForwarder> event_forwarder_; |
| 206 | 204 |
| 207 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); | 205 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); |
| 208 }; | 206 }; |
| 209 | 207 |
| 210 } // namespace ui | 208 } // namespace ui |
| 211 | 209 |
| 212 #endif // UI_ANDROID_VIEW_ANDROID_H_ | 210 #endif // UI_ANDROID_VIEW_ANDROID_H_ |
| OLD | NEW |