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

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

Issue 2453213003: Have WebContentsViewAndroid own ViewAndroid (Closed)
Patch Set: fixed builds & rebased Created 4 years, 1 month 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 | « content/browser/web_contents/web_contents_view_android.cc ('k') | ui/android/view_android.cc » ('j') | no next file with comments »
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // cannot be garbage-collected and leak memory. Rewrite not to use them. 49 // cannot be garbage-collected and leak memory. Rewrite not to use them.
50 // see comments in crrev.com/2103243002. 50 // see comments in crrev.com/2103243002.
51 JavaObjectWeakGlobalRef view_; 51 JavaObjectWeakGlobalRef view_;
52 JavaObjectWeakGlobalRef delegate_; 52 JavaObjectWeakGlobalRef delegate_;
53 53
54 // Default copy/assign disabled by move constructor. 54 // Default copy/assign disabled by move constructor.
55 }; 55 };
56 56
57 // A ViewAndroid may have its own delegate or otherwise will 57 // A ViewAndroid may have its own delegate or otherwise will
58 // use the next available parent's delegate. 58 // use the next available parent's delegate.
59 ViewAndroid(const base::android::JavaRef<jobject>& delegate); 59 ViewAndroid(const base::android::JavaRef<jobject>& delegate);
boliu 2016/11/01 15:11:12 fix blimp rather than adding this back
60 60
61 ViewAndroid(); 61 ViewAndroid();
62 virtual ~ViewAndroid(); 62 virtual ~ViewAndroid();
63 63
64 // Returns the window at the root of this hierarchy, or |null| 64 // Returns the window at the root of this hierarchy, or |null|
65 // if disconnected. 65 // if disconnected.
66 virtual WindowAndroid* GetWindowAndroid() const; 66 virtual WindowAndroid* GetWindowAndroid() const;
67 67
68 // Used to return and set the layer for this view. May be |null|. 68 // Used to return and set the layer for this view. May be |null|.
69 cc::Layer* GetLayer() const; 69 cc::Layer* GetLayer() const;
70 void SetLayer(scoped_refptr<cc::Layer> layer); 70 void SetLayer(scoped_refptr<cc::Layer> layer);
71 71
72 void SetDelegate(const base::android::JavaRef<jobject>& delegate);
73
72 // Adds this view as a child of another view. 74 // Adds this view as a child of another view.
73 void AddChild(ViewAndroid* child); 75 void AddChild(ViewAndroid* child);
74 76
75 // Detaches this view from its parent. 77 // Detaches this view from its parent.
76 void RemoveFromParent(); 78 void RemoveFromParent();
77 79
78 bool StartDragAndDrop(const base::android::JavaRef<jstring>& jtext, 80 bool StartDragAndDrop(const base::android::JavaRef<jstring>& jtext,
79 const base::android::JavaRef<jobject>& jimage); 81 const base::android::JavaRef<jobject>& jimage);
80 82
81 ScopedAnchorView AcquireAnchorView(); 83 ScopedAnchorView AcquireAnchorView();
(...skipping 15 matching lines...) Expand all
97 std::list<ViewAndroid*> children_; 99 std::list<ViewAndroid*> children_;
98 scoped_refptr<cc::Layer> layer_; 100 scoped_refptr<cc::Layer> layer_;
99 JavaObjectWeakGlobalRef delegate_; 101 JavaObjectWeakGlobalRef delegate_;
100 102
101 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); 103 DISALLOW_COPY_AND_ASSIGN(ViewAndroid);
102 }; 104 };
103 105
104 } // namespace ui 106 } // namespace ui
105 107
106 #endif // UI_ANDROID_VIEW_ANDROID_H_ 108 #endif // UI_ANDROID_VIEW_ANDROID_H_
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_view_android.cc ('k') | ui/android/view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698