| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); |
| 60 | 60 |
| 61 ViewAndroid(); | 61 ViewAndroid(); |
| 62 virtual ~ViewAndroid(); | 62 virtual ~ViewAndroid(); |
| 63 | 63 |
| 64 // The content offset is used to translate snapshots to the correct part of |
| 65 // the window. |
| 66 void set_content_offset(const gfx::Vector2dF& content_offset) { |
| 67 content_offset_ = content_offset; |
| 68 } |
| 69 |
| 70 gfx::Vector2dF content_offset() const { |
| 71 return content_offset_; |
| 72 } |
| 73 |
| 64 // Returns the window at the root of this hierarchy, or |null| | 74 // Returns the window at the root of this hierarchy, or |null| |
| 65 // if disconnected. | 75 // if disconnected. |
| 66 virtual WindowAndroid* GetWindowAndroid() const; | 76 virtual WindowAndroid* GetWindowAndroid() const; |
| 67 | 77 |
| 68 // Set the root |WindowAndroid|. This is only valid for root | 78 // Set the root |WindowAndroid|. This is only valid for root |
| 69 // nodes and must not be called for children. | 79 // nodes and must not be called for children. |
| 70 void SetWindowAndroid(WindowAndroid* root_window); | 80 void SetWindowAndroid(WindowAndroid* root_window); |
| 71 | 81 |
| 72 // Used to return and set the layer for this view. May be |null|. | 82 // Used to return and set the layer for this view. May be |null|. |
| 73 cc::Layer* GetLayer() const; | 83 cc::Layer* GetLayer() const; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 94 | 104 |
| 95 // Returns the Java delegate for this view. This is used to delegate work | 105 // Returns the Java delegate for this view. This is used to delegate work |
| 96 // up to the embedding view (or the embedder that can deal with the | 106 // up to the embedding view (or the embedder that can deal with the |
| 97 // implementation details). | 107 // implementation details). |
| 98 const base::android::ScopedJavaLocalRef<jobject> | 108 const base::android::ScopedJavaLocalRef<jobject> |
| 99 GetViewAndroidDelegate() const; | 109 GetViewAndroidDelegate() const; |
| 100 | 110 |
| 101 std::list<ViewAndroid*> children_; | 111 std::list<ViewAndroid*> children_; |
| 102 scoped_refptr<cc::Layer> layer_; | 112 scoped_refptr<cc::Layer> layer_; |
| 103 JavaObjectWeakGlobalRef delegate_; | 113 JavaObjectWeakGlobalRef delegate_; |
| 114 gfx::Vector2dF content_offset_; |
| 104 | 115 |
| 105 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); | 116 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); |
| 106 }; | 117 }; |
| 107 | 118 |
| 108 } // namespace ui | 119 } // namespace ui |
| 109 | 120 |
| 110 #endif // UI_ANDROID_VIEW_ANDROID_H_ | 121 #endif // UI_ANDROID_VIEW_ANDROID_H_ |
| OLD | NEW |