| 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" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "third_party/skia/include/core/SkColor.h" |
| 12 #include "ui/android/ui_android_export.h" | 13 #include "ui/android/ui_android_export.h" |
| 13 #include "ui/gfx/geometry/rect_f.h" | 14 #include "ui/gfx/geometry/rect_f.h" |
| 14 | 15 |
| 15 namespace cc { | 16 namespace cc { |
| 16 class Layer; | 17 class Layer; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace ui { | 20 namespace ui { |
| 20 | 21 |
| 21 class WindowAndroid; | 22 class WindowAndroid; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void SetDelegate(const base::android::JavaRef<jobject>& delegate); | 73 void SetDelegate(const base::android::JavaRef<jobject>& delegate); |
| 73 | 74 |
| 74 // Adds this view as a child of another view. | 75 // Adds this view as a child of another view. |
| 75 void AddChild(ViewAndroid* child); | 76 void AddChild(ViewAndroid* child); |
| 76 | 77 |
| 77 // Detaches this view from its parent. | 78 // Detaches this view from its parent. |
| 78 void RemoveFromParent(); | 79 void RemoveFromParent(); |
| 79 | 80 |
| 80 bool StartDragAndDrop(const base::android::JavaRef<jstring>& jtext, | 81 bool StartDragAndDrop(const base::android::JavaRef<jstring>& jtext, |
| 81 const base::android::JavaRef<jobject>& jimage); | 82 const base::android::JavaRef<jobject>& jimage); |
| 83 void OnBackgroundColorChanged(SkColor color); |
| 82 | 84 |
| 83 ScopedAnchorView AcquireAnchorView(); | 85 ScopedAnchorView AcquireAnchorView(); |
| 84 void SetAnchorRect(const base::android::JavaRef<jobject>& anchor, | 86 void SetAnchorRect(const base::android::JavaRef<jobject>& anchor, |
| 85 const gfx::RectF& bounds); | 87 const gfx::RectF& bounds); |
| 86 | 88 |
| 87 protected: | 89 protected: |
| 88 ViewAndroid* parent_; | 90 ViewAndroid* parent_; |
| 89 | 91 |
| 90 private: | 92 private: |
| 91 void RemoveChild(ViewAndroid* child); | 93 void RemoveChild(ViewAndroid* child); |
| 92 | 94 |
| 93 // Returns the Java delegate for this view. This is used to delegate work | 95 // 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 | 96 // up to the embedding view (or the embedder that can deal with the |
| 95 // implementation details). | 97 // implementation details). |
| 96 const base::android::ScopedJavaLocalRef<jobject> | 98 const base::android::ScopedJavaLocalRef<jobject> |
| 97 GetViewAndroidDelegate() const; | 99 GetViewAndroidDelegate() const; |
| 98 | 100 |
| 99 std::list<ViewAndroid*> children_; | 101 std::list<ViewAndroid*> children_; |
| 100 scoped_refptr<cc::Layer> layer_; | 102 scoped_refptr<cc::Layer> layer_; |
| 101 JavaObjectWeakGlobalRef delegate_; | 103 JavaObjectWeakGlobalRef delegate_; |
| 102 | 104 |
| 103 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); | 105 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); |
| 104 }; | 106 }; |
| 105 | 107 |
| 106 } // namespace ui | 108 } // namespace ui |
| 107 | 109 |
| 108 #endif // UI_ANDROID_VIEW_ANDROID_H_ | 110 #endif // UI_ANDROID_VIEW_ANDROID_H_ |
| OLD | NEW |