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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 return content_offset_; | 102 return content_offset_; |
103 } | 103 } |
104 | 104 |
105 // Returns the window at the root of this hierarchy, or |null| | 105 // Returns the window at the root of this hierarchy, or |null| |
106 // if disconnected. | 106 // if disconnected. |
107 virtual WindowAndroid* GetWindowAndroid() const; | 107 virtual WindowAndroid* GetWindowAndroid() const; |
108 | 108 |
109 // Used to return and set the layer for this view. May be |null|. | 109 // Used to return and set the layer for this view. May be |null|. |
110 cc::Layer* GetLayer() const; | 110 cc::Layer* GetLayer() const; |
111 void SetLayer(scoped_refptr<cc::Layer> layer); | 111 void SetLayer(scoped_refptr<cc::Layer> layer); |
112 void UpdateLayerBounds(); | |
112 | 113 |
113 void SetDelegate(const base::android::JavaRef<jobject>& delegate); | 114 void SetDelegate(const base::android::JavaRef<jobject>& delegate); |
114 | 115 |
115 // Gets (creates one if not present) Java object of the EventForwarder | 116 // Gets (creates one if not present) Java object of the EventForwarder |
116 // for a view tree in the view hierarchy including this node. | 117 // for a view tree in the view hierarchy including this node. |
117 // Only one instance per the view tree is allowed. | 118 // Only one instance per the view tree is allowed. |
118 base::android::ScopedJavaLocalRef<jobject> GetEventForwarder(); | 119 base::android::ScopedJavaLocalRef<jobject> GetEventForwarder(); |
119 | 120 |
120 // Adds a child to this view. | 121 // Adds a child to this view. |
121 void AddChild(ViewAndroid* child); | 122 void AddChild(ViewAndroid* child); |
122 | 123 |
123 // Moves the give child ViewAndroid to the front of the list so that it can be | 124 // Moves the give child ViewAndroid to the front of the list so that it can be |
124 // the first responder of events. | 125 // the first responder of events. |
125 void MoveToFront(ViewAndroid* child); | 126 void MoveToFront(ViewAndroid* child); |
126 | 127 |
127 // Detaches this view from its parent. | 128 // Detaches this view from its parent. |
128 void RemoveFromParent(); | 129 void RemoveFromParent(); |
129 | 130 |
130 // Sets the layout relative to parent. Used to do hit testing against events. | 131 // Sets the layout relative to parent. Used to do hit testing against events. |
131 void SetLayout(LayoutParams params); | 132 void SetLayout(LayoutParams params); |
132 | 133 |
133 bool StartDragAndDrop(const base::android::JavaRef<jstring>& jtext, | 134 bool StartDragAndDrop(const base::android::JavaRef<jstring>& jtext, |
134 const base::android::JavaRef<jobject>& jimage); | 135 const base::android::JavaRef<jobject>& jimage); |
135 | 136 |
137 gfx::Size GetPhysicalBackingSize(); | |
138 void OnPhysicalBackingSizeChanged(const gfx::Size& size); | |
boliu
2017/04/29 00:18:40
does this need to be public?
Jinsuk Kim
2017/04/30 00:23:50
Yes. The other OnXXX calls are from event forwarde
| |
136 void OnBackgroundColorChanged(unsigned int color); | 139 void OnBackgroundColorChanged(unsigned int color); |
137 void OnTopControlsChanged(float top_controls_offset, | 140 void OnTopControlsChanged(float top_controls_offset, |
138 float top_content_offset); | 141 float top_content_offset); |
139 void OnBottomControlsChanged(float bottom_controls_offset, | 142 void OnBottomControlsChanged(float bottom_controls_offset, |
140 float bottom_content_offset); | 143 float bottom_content_offset); |
141 int GetSystemWindowInsetBottom(); | 144 int GetSystemWindowInsetBottom(); |
142 | 145 |
143 ScopedAnchorView AcquireAnchorView(); | 146 ScopedAnchorView AcquireAnchorView(); |
144 void SetAnchorRect(const base::android::JavaRef<jobject>& anchor, | 147 void SetAnchorRect(const base::android::JavaRef<jobject>& anchor, |
145 const gfx::RectF& bounds); | 148 const gfx::RectF& bounds); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 std::list<ViewAndroid*> children_; | 197 std::list<ViewAndroid*> children_; |
195 scoped_refptr<cc::Layer> layer_; | 198 scoped_refptr<cc::Layer> layer_; |
196 JavaObjectWeakGlobalRef delegate_; | 199 JavaObjectWeakGlobalRef delegate_; |
197 | 200 |
198 ViewClient* const client_; | 201 ViewClient* const client_; |
199 | 202 |
200 // Basic view layout information. Used to do hit testing deciding whether | 203 // Basic view layout information. Used to do hit testing deciding whether |
201 // the passed events should be processed by the view. | 204 // the passed events should be processed by the view. |
202 LayoutParams layout_params_; | 205 LayoutParams layout_params_; |
203 | 206 |
207 gfx::Size physical_size_; | |
208 | |
204 gfx::Vector2dF content_offset_; // in CSS pixel. | 209 gfx::Vector2dF content_offset_; // in CSS pixel. |
205 std::unique_ptr<EventForwarder> event_forwarder_; | 210 std::unique_ptr<EventForwarder> event_forwarder_; |
206 | 211 |
207 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); | 212 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); |
208 }; | 213 }; |
209 | 214 |
210 } // namespace ui | 215 } // namespace ui |
211 | 216 |
212 #endif // UI_ANDROID_VIEW_ANDROID_H_ | 217 #endif // UI_ANDROID_VIEW_ANDROID_H_ |
OLD | NEW |