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

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

Issue 2219823002: Move content offset to ViewAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comments Created 3 years, 11 months 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
« no previous file with comments | « ui/android/view_android.cc ('k') | ui/snapshot/snapshot_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_WINDOW_ANDROID_H_ 5 #ifndef UI_ANDROID_WINDOW_ANDROID_H_
6 #define UI_ANDROID_WINDOW_ANDROID_H_ 6 #define UI_ANDROID_WINDOW_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <list> 9 #include <list>
10 #include <memory> 10 #include <memory>
(...skipping 28 matching lines...) Expand all
39 class UI_ANDROID_EXPORT WindowAndroid : public ViewAndroid { 39 class UI_ANDROID_EXPORT WindowAndroid : public ViewAndroid {
40 public: 40 public:
41 WindowAndroid(JNIEnv* env, jobject obj, int display_id); 41 WindowAndroid(JNIEnv* env, jobject obj, int display_id);
42 42
43 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 43 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
44 44
45 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); 45 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
46 46
47 static bool RegisterWindowAndroid(JNIEnv* env); 47 static bool RegisterWindowAndroid(JNIEnv* env);
48 48
49 // The content offset in CSS pixels. It is used together with device scale
50 // factor to translate snapshots to the correct part of the window.
51 void set_content_offset(const gfx::Vector2dF& content_offset) {
52 content_offset_ = content_offset;
53 }
54
55 gfx::Vector2dF content_offset() const {
56 return content_offset_;
57 }
58
59 // Compositor callback relay. 49 // Compositor callback relay.
60 void OnCompositingDidCommit(); 50 void OnCompositingDidCommit();
61 51
62 void AttachCompositor(WindowAndroidCompositor* compositor); 52 void AttachCompositor(WindowAndroidCompositor* compositor);
63 void DetachCompositor(); 53 void DetachCompositor();
64 54
65 void AddObserver(WindowAndroidObserver* observer); 55 void AddObserver(WindowAndroidObserver* observer);
66 void RemoveObserver(WindowAndroidObserver* observer); 56 void RemoveObserver(WindowAndroidObserver* observer);
67 57
68 WindowAndroidCompositor* GetCompositor() { return compositor_; } 58 WindowAndroidCompositor* GetCompositor() { return compositor_; }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 void RequestVSyncUpdate(); 96 void RequestVSyncUpdate();
107 97
108 // ViewAndroid overrides. 98 // ViewAndroid overrides.
109 WindowAndroid* GetWindowAndroid() const override; 99 WindowAndroid* GetWindowAndroid() const override;
110 100
111 // The ID of the display that this window belongs to. 101 // The ID of the display that this window belongs to.
112 int display_id() const { return display_id_; } 102 int display_id() const { return display_id_; }
113 103
114 base::android::ScopedJavaGlobalRef<jobject> java_window_; 104 base::android::ScopedJavaGlobalRef<jobject> java_window_;
115 const int display_id_; 105 const int display_id_;
116 gfx::Vector2dF content_offset_;
117 WindowAndroidCompositor* compositor_; 106 WindowAndroidCompositor* compositor_;
118 107
119 base::ObserverList<WindowAndroidObserver> observer_list_; 108 base::ObserverList<WindowAndroidObserver> observer_list_;
120 109
121 std::unique_ptr<WindowBeginFrameSource> begin_frame_source_; 110 std::unique_ptr<WindowBeginFrameSource> begin_frame_source_;
122 bool needs_begin_frames_; 111 bool needs_begin_frames_;
123 std::list<base::Closure> vsync_complete_callbacks_; 112 std::list<base::Closure> vsync_complete_callbacks_;
124 113
125 DISALLOW_COPY_AND_ASSIGN(WindowAndroid); 114 DISALLOW_COPY_AND_ASSIGN(WindowAndroid);
126 }; 115 };
127 116
128 } // namespace ui 117 } // namespace ui
129 118
130 #endif // UI_ANDROID_WINDOW_ANDROID_H_ 119 #endif // UI_ANDROID_WINDOW_ANDROID_H_
OLDNEW
« no previous file with comments | « ui/android/view_android.cc ('k') | ui/snapshot/snapshot_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698