| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Detaches this view from its parent. | 87 // Detaches this view from its parent. |
| 88 void RemoveFromParent(); | 88 void RemoveFromParent(); |
| 89 | 89 |
| 90 bool StartDragAndDrop(const base::android::JavaRef<jstring>& jtext, | 90 bool StartDragAndDrop(const base::android::JavaRef<jstring>& jtext, |
| 91 const base::android::JavaRef<jobject>& jimage); | 91 const base::android::JavaRef<jobject>& jimage); |
| 92 | 92 |
| 93 ScopedAnchorView AcquireAnchorView(); | 93 ScopedAnchorView AcquireAnchorView(); |
| 94 void SetAnchorRect(const base::android::JavaRef<jobject>& anchor, | 94 void SetAnchorRect(const base::android::JavaRef<jobject>& anchor, |
| 95 const gfx::RectF& bounds); | 95 const gfx::RectF& bounds); |
| 96 | 96 |
| 97 // This may return null. |
| 98 base::android::ScopedJavaLocalRef<jobject> GetContainerView(); |
| 99 |
| 97 protected: | 100 protected: |
| 98 ViewAndroid* parent_; | 101 ViewAndroid* parent_; |
| 99 | 102 |
| 100 private: | 103 private: |
| 101 void RemoveChild(ViewAndroid* child); | 104 void RemoveChild(ViewAndroid* child); |
| 102 | 105 |
| 103 // Returns the Java delegate for this view. This is used to delegate work | 106 // Returns the Java delegate for this view. This is used to delegate work |
| 104 // up to the embedding view (or the embedder that can deal with the | 107 // up to the embedding view (or the embedder that can deal with the |
| 105 // implementation details). | 108 // implementation details). |
| 106 const base::android::ScopedJavaLocalRef<jobject> | 109 const base::android::ScopedJavaLocalRef<jobject> |
| 107 GetViewAndroidDelegate() const; | 110 GetViewAndroidDelegate() const; |
| 108 | 111 |
| 109 std::list<ViewAndroid*> children_; | 112 std::list<ViewAndroid*> children_; |
| 110 scoped_refptr<cc::Layer> layer_; | 113 scoped_refptr<cc::Layer> layer_; |
| 111 JavaObjectWeakGlobalRef delegate_; | 114 JavaObjectWeakGlobalRef delegate_; |
| 112 gfx::Vector2dF content_offset_; // in CSS pixel | 115 gfx::Vector2dF content_offset_; // in CSS pixel |
| 113 | 116 |
| 114 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); | 117 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); |
| 115 }; | 118 }; |
| 116 | 119 |
| 117 } // namespace ui | 120 } // namespace ui |
| 118 | 121 |
| 119 #endif // UI_ANDROID_VIEW_ANDROID_H_ | 122 #endif // UI_ANDROID_VIEW_ANDROID_H_ |
| OLD | NEW |