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

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

Issue 2861413002: Refined DCHECK preventing multiple event forwarders in VA tree path (Closed)
Patch Set: simpler 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 event forwarder in any node up to root.
182 // and parents) already has |EventForwarder| attached to it. 182 static bool RootPathHasEventForwarder(ViewAndroid* view);
183 static bool ViewTreeHasEventForwarder(ViewAndroid* view);
184 183
185 // Returns true if any children node (or self) has |EventForwarder|. 184 // Checks if there is any event forwarder in the node paths down to
185 // each leaf of subtree.
186 static bool SubtreeHasEventForwarder(ViewAndroid* view); 186 static bool SubtreeHasEventForwarder(ViewAndroid* view);
187 187
188 // Returns the Java delegate for this view. This is used to delegate work 188 // 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 189 // up to the embedding view (or the embedder that can deal with the
190 // implementation details). 190 // implementation details).
191 const base::android::ScopedJavaLocalRef<jobject> 191 const base::android::ScopedJavaLocalRef<jobject>
192 GetViewAndroidDelegate() const; 192 GetViewAndroidDelegate() const;
193 193
194 std::list<ViewAndroid*> children_; 194 std::list<ViewAndroid*> children_;
195 scoped_refptr<cc::Layer> layer_; 195 scoped_refptr<cc::Layer> layer_;
196 JavaObjectWeakGlobalRef delegate_; 196 JavaObjectWeakGlobalRef delegate_;
197 197
198 ViewClient* const client_; 198 ViewClient* const client_;
199 199
200 // Basic view layout information. Used to do hit testing deciding whether 200 // Basic view layout information. Used to do hit testing deciding whether
201 // the passed events should be processed by the view. 201 // the passed events should be processed by the view.
202 LayoutParams layout_params_; 202 LayoutParams layout_params_;
203 203
204 gfx::Vector2dF content_offset_; // in CSS pixel. 204 gfx::Vector2dF content_offset_; // in CSS pixel.
205 std::unique_ptr<EventForwarder> event_forwarder_; 205 std::unique_ptr<EventForwarder> event_forwarder_;
206 206
207 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); 207 DISALLOW_COPY_AND_ASSIGN(ViewAndroid);
208 }; 208 };
209 209
210 } // namespace ui 210 } // namespace ui
211 211
212 #endif // UI_ANDROID_VIEW_ANDROID_H_ 212 #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