| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 JavaObjectWeakGlobalRef delegate_; | 53 JavaObjectWeakGlobalRef delegate_; |
| 54 | 54 |
| 55 // Default copy/assign disabled by move constructor. | 55 // Default copy/assign disabled by move constructor. |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 explicit ViewAndroid(ViewClient* client); | 58 explicit ViewAndroid(ViewClient* client); |
| 59 | 59 |
| 60 ViewAndroid(); | 60 ViewAndroid(); |
| 61 virtual ~ViewAndroid(); | 61 virtual ~ViewAndroid(); |
| 62 | 62 |
| 63 // The content offset is in CSS pixels, and is used to translate |
| 64 // snapshots to the correct part of the view. |
| 65 void set_content_offset(const gfx::Vector2dF& content_offset) { |
| 66 content_offset_ = content_offset; |
| 67 } |
| 68 |
| 69 gfx::Vector2dF content_offset() const { |
| 70 return content_offset_; |
| 71 } |
| 72 |
| 63 // Returns the window at the root of this hierarchy, or |null| | 73 // Returns the window at the root of this hierarchy, or |null| |
| 64 // if disconnected. | 74 // if disconnected. |
| 65 virtual WindowAndroid* GetWindowAndroid() const; | 75 virtual WindowAndroid* GetWindowAndroid() const; |
| 66 | 76 |
| 67 // Returns |ViewRoot| associated with the current ViewAndroid. | 77 // Returns |ViewRoot| associated with the current ViewAndroid. |
| 68 // Create one if not present. | 78 // Create one if not present. |
| 69 base::android::ScopedJavaLocalRef<jobject> GetViewRoot(); | 79 base::android::ScopedJavaLocalRef<jobject> GetViewRoot(); |
| 70 | 80 |
| 71 // Used to return and set the layer for this view. May be |null|. | 81 // Used to return and set the layer for this view. May be |null|. |
| 72 cc::Layer* GetLayer() const; | 82 cc::Layer* GetLayer() const; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 bool HasViewRoot(); | 129 bool HasViewRoot(); |
| 120 | 130 |
| 121 std::list<ViewAndroid*> children_; | 131 std::list<ViewAndroid*> children_; |
| 122 scoped_refptr<cc::Layer> layer_; | 132 scoped_refptr<cc::Layer> layer_; |
| 123 JavaObjectWeakGlobalRef delegate_; | 133 JavaObjectWeakGlobalRef delegate_; |
| 124 JavaObjectWeakGlobalRef view_root_; | 134 JavaObjectWeakGlobalRef view_root_; |
| 125 ViewClient* const client_; | 135 ViewClient* const client_; |
| 126 | 136 |
| 127 int physical_width_pix_; | 137 int physical_width_pix_; |
| 128 int physical_height_pix_; | 138 int physical_height_pix_; |
| 139 gfx::Vector2dF content_offset_; // in CSS pixel |
| 129 | 140 |
| 130 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); | 141 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); |
| 131 }; | 142 }; |
| 132 | 143 |
| 133 bool RegisterViewRoot(JNIEnv* env); | 144 bool RegisterViewRoot(JNIEnv* env); |
| 134 | 145 |
| 135 } // namespace ui | 146 } // namespace ui |
| 136 | 147 |
| 137 #endif // UI_ANDROID_VIEW_ANDROID_H_ | 148 #endif // UI_ANDROID_VIEW_ANDROID_H_ |
| OLD | NEW |