| Index: ui/android/view_android.h
|
| diff --git a/ui/android/view_android.h b/ui/android/view_android.h
|
| index d05520d514b7ee525f1b85ec78f8fb7ceb1cd04b..c024fee6862609425cdfd962513c167011e090d0 100644
|
| --- a/ui/android/view_android.h
|
| +++ b/ui/android/view_android.h
|
| @@ -22,7 +22,7 @@ class ViewClient;
|
| class WindowAndroid;
|
|
|
| // A simple container for a UI layer.
|
| -// At the root of the hierarchy is a WindowAndroid, when attached.
|
| +// At the root of the hierarchy is a ViewRoot, a subclass of ViewAndroid.
|
| class UI_ANDROID_EXPORT ViewAndroid {
|
| public:
|
| // Stores an anchored view to delete itself at the end of its lifetime
|
| @@ -64,9 +64,9 @@ class UI_ANDROID_EXPORT ViewAndroid {
|
| // if disconnected.
|
| virtual WindowAndroid* GetWindowAndroid() const;
|
|
|
| - // Returns |ViewRoot| associated with the current ViewAndroid.
|
| - // Create one if not present.
|
| - base::android::ScopedJavaLocalRef<jobject> GetViewRoot();
|
| + // Returns |ViewRoot| of this hierarchy. |null| if the hierarchy isn't
|
| + // attached to a |ViewRoot|.
|
| + virtual ViewAndroid* GetViewRoot();
|
|
|
| // Used to return and set the layer for this view. May be |null|.
|
| cc::Layer* GetLayer() const;
|
| @@ -74,7 +74,7 @@ class UI_ANDROID_EXPORT ViewAndroid {
|
|
|
| void SetDelegate(const base::android::JavaRef<jobject>& delegate);
|
|
|
| - // Adds this view as a child of another view.
|
| + // Adds a child to this view.
|
| void AddChild(ViewAndroid* child);
|
|
|
| // Detaches this view from its parent.
|
| @@ -90,21 +90,15 @@ class UI_ANDROID_EXPORT ViewAndroid {
|
| gfx::Size GetPhysicalBackingSize();
|
| void UpdateLayerBounds();
|
|
|
| - // Internal implementation of ViewClient forwarding calls to the interface.
|
| - void OnPhysicalBackingSizeChanged(int width, int height);
|
| -
|
| protected:
|
| - ViewAndroid* parent_;
|
| + // Internal implementation of ViewClient forwarding calls to the interface.
|
| + void OnPhysicalBackingSizeChangedInternal(int width, int height);
|
|
|
| private:
|
| - void RemoveChild(ViewAndroid* child);
|
| + // Returns true only if this is of type |ViewRoot|.
|
| + bool IsViewRoot();
|
|
|
| - // Checks if any ViewAndroid instance in the tree hierarchy (including
|
| - // all the parents and the children) has |ViewRoot| already.
|
| - bool HasViewRootInTreeHierarchy();
|
| -
|
| - // Checks if any children (plus this ViewAndroid itself) has |ViewRoot|.
|
| - bool HasViewRootInSubtree();
|
| + void RemoveChild(ViewAndroid* child);
|
|
|
| // Returns the Java delegate for this view. This is used to delegate work
|
| // up to the embedding view (or the embedder that can deal with the
|
| @@ -116,12 +110,10 @@ class UI_ANDROID_EXPORT ViewAndroid {
|
| // should have |ViewRoot| for this ViewAndroid to have one.
|
| base::android::ScopedJavaLocalRef<jobject> CreateViewRoot();
|
|
|
| - bool HasViewRoot();
|
| -
|
| + ViewAndroid* parent_;
|
| std::list<ViewAndroid*> children_;
|
| scoped_refptr<cc::Layer> layer_;
|
| JavaObjectWeakGlobalRef delegate_;
|
| - JavaObjectWeakGlobalRef view_root_;
|
| ViewClient* const client_;
|
|
|
| int physical_width_pix_;
|
| @@ -130,8 +122,6 @@ class UI_ANDROID_EXPORT ViewAndroid {
|
| DISALLOW_COPY_AND_ASSIGN(ViewAndroid);
|
| };
|
|
|
| -bool RegisterViewRoot(JNIEnv* env);
|
| -
|
| } // namespace ui
|
|
|
| #endif // UI_ANDROID_VIEW_ANDROID_H_
|
|
|