Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: ui/android/view_android.h

Issue 2861413002: Refined DCHECK preventing multiple event forwarders in VA tree path (Closed)
Patch Set: comment Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/android/view_android.cc » ('j') | ui/android/view_android.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 path from leaf to top that has more than one event
182 // and parents) already has |EventForwarder| attached to it. 182 // forwarder if |tree| is added to |node| as a child. |has_forwarder| is true
183 static bool ViewTreeHasEventForwarder(ViewAndroid* view); 183 // if |node| has (or will have) an event forwarder.
184 184 static bool HasMultipleEventForwarder(ViewAndroid* node,
185 // Returns true if any children node (or self) has |EventForwarder|. 185 bool has_forwarder,
186 static bool SubtreeHasEventForwarder(ViewAndroid* view); 186 ViewAndroid* tree);
187 static bool HasMultipleEventForwarderInAnyPath(ViewAndroid* node,
188 bool forwarder_found);
187 189
188 // Returns the Java delegate for this view. This is used to delegate work 190 // 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 191 // up to the embedding view (or the embedder that can deal with the
190 // implementation details). 192 // implementation details).
191 const base::android::ScopedJavaLocalRef<jobject> 193 const base::android::ScopedJavaLocalRef<jobject>
192 GetViewAndroidDelegate() const; 194 GetViewAndroidDelegate() const;
193 195
194 std::list<ViewAndroid*> children_; 196 std::list<ViewAndroid*> children_;
195 scoped_refptr<cc::Layer> layer_; 197 scoped_refptr<cc::Layer> layer_;
196 JavaObjectWeakGlobalRef delegate_; 198 JavaObjectWeakGlobalRef delegate_;
197 199
198 ViewClient* const client_; 200 ViewClient* const client_;
199 201
200 // Basic view layout information. Used to do hit testing deciding whether 202 // Basic view layout information. Used to do hit testing deciding whether
201 // the passed events should be processed by the view. 203 // the passed events should be processed by the view.
202 LayoutParams layout_params_; 204 LayoutParams layout_params_;
203 205
204 gfx::Vector2dF content_offset_; // in CSS pixel. 206 gfx::Vector2dF content_offset_; // in CSS pixel.
205 std::unique_ptr<EventForwarder> event_forwarder_; 207 std::unique_ptr<EventForwarder> event_forwarder_;
206 208
207 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); 209 DISALLOW_COPY_AND_ASSIGN(ViewAndroid);
208 }; 210 };
209 211
210 } // namespace ui 212 } // namespace ui
211 213
212 #endif // UI_ANDROID_VIEW_ANDROID_H_ 214 #endif // UI_ANDROID_VIEW_ANDROID_H_
OLDNEW
« no previous file with comments | « no previous file | ui/android/view_android.cc » ('j') | ui/android/view_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698