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

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

Issue 2536223003: Refactor ContentViewClient (3/6) (Closed)
Patch Set: fix tests Created 4 years 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
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"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "ui/android/ui_android_export.h" 12 #include "ui/android/ui_android_export.h"
13 #include "ui/gfx/geometry/rect_f.h" 13 #include "ui/gfx/geometry/rect_f.h"
14 14
15 typedef unsigned int SkColor;
boliu 2016/11/30 23:22:35 include instead
Jinsuk Kim 2016/12/01 07:59:38 I was a bit puzzled because #include "third_party/
boliu 2016/12/01 23:57:52 Yeah that's really odd. should figure out why incl
Jinsuk Kim 2016/12/02 03:52:07 Turns out the error happened because device/power_
16
15 namespace cc { 17 namespace cc {
16 class Layer; 18 class Layer;
17 } 19 }
18 20
19 namespace ui { 21 namespace ui {
20 22
21 class WindowAndroid; 23 class WindowAndroid;
22 24
23 // A simple container for a UI layer. 25 // A simple container for a UI layer.
24 // At the root of the hierarchy is a WindowAndroid, when attached. 26 // At the root of the hierarchy is a WindowAndroid, when attached.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 void SetDelegate(const base::android::JavaRef<jobject>& delegate); 74 void SetDelegate(const base::android::JavaRef<jobject>& delegate);
73 75
74 // Adds this view as a child of another view. 76 // Adds this view as a child of another view.
75 void AddChild(ViewAndroid* child); 77 void AddChild(ViewAndroid* child);
76 78
77 // Detaches this view from its parent. 79 // Detaches this view from its parent.
78 void RemoveFromParent(); 80 void RemoveFromParent();
79 81
80 bool StartDragAndDrop(const base::android::JavaRef<jstring>& jtext, 82 bool StartDragAndDrop(const base::android::JavaRef<jstring>& jtext,
81 const base::android::JavaRef<jobject>& jimage); 83 const base::android::JavaRef<jobject>& jimage);
84 void OnBackgroundColorChanged(SkColor color);
82 85
83 ScopedAnchorView AcquireAnchorView(); 86 ScopedAnchorView AcquireAnchorView();
84 void SetAnchorRect(const base::android::JavaRef<jobject>& anchor, 87 void SetAnchorRect(const base::android::JavaRef<jobject>& anchor,
85 const gfx::RectF& bounds); 88 const gfx::RectF& bounds);
86 89
87 protected: 90 protected:
88 ViewAndroid* parent_; 91 ViewAndroid* parent_;
89 92
90 private: 93 private:
91 void RemoveChild(ViewAndroid* child); 94 void RemoveChild(ViewAndroid* child);
92 95
93 // Returns the Java delegate for this view. This is used to delegate work 96 // Returns the Java delegate for this view. This is used to delegate work
94 // up to the embedding view (or the embedder that can deal with the 97 // up to the embedding view (or the embedder that can deal with the
95 // implementation details). 98 // implementation details).
96 const base::android::ScopedJavaLocalRef<jobject> 99 const base::android::ScopedJavaLocalRef<jobject>
97 GetViewAndroidDelegate() const; 100 GetViewAndroidDelegate() const;
98 101
99 std::list<ViewAndroid*> children_; 102 std::list<ViewAndroid*> children_;
100 scoped_refptr<cc::Layer> layer_; 103 scoped_refptr<cc::Layer> layer_;
101 JavaObjectWeakGlobalRef delegate_; 104 JavaObjectWeakGlobalRef delegate_;
102 105
103 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); 106 DISALLOW_COPY_AND_ASSIGN(ViewAndroid);
104 }; 107 };
105 108
106 } // namespace ui 109 } // namespace ui
107 110
108 #endif // UI_ANDROID_VIEW_ANDROID_H_ 111 #endif // UI_ANDROID_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698