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

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: offset in RWH 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
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 <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 26 matching lines...) Expand all
37 class UI_ANDROID_EXPORT WindowAndroid : public ViewAndroid { 37 class UI_ANDROID_EXPORT WindowAndroid : public ViewAndroid {
38 public: 38 public:
39 WindowAndroid(JNIEnv* env, jobject obj, int display_id); 39 WindowAndroid(JNIEnv* env, jobject obj, int display_id);
40 40
41 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 41 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
42 42
43 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); 43 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
44 44
45 static bool RegisterWindowAndroid(JNIEnv* env); 45 static bool RegisterWindowAndroid(JNIEnv* env);
46 46
47 // The content offset in CSS pixels. It is used together with device scale
48 // factor to translate snapshots to the correct part of the window.
49 void set_content_offset(const gfx::Vector2dF& content_offset) {
50 content_offset_ = content_offset;
51 }
52
53 gfx::Vector2dF content_offset() const {
54 return content_offset_;
55 }
56
57 // Compositor callback relay. 47 // Compositor callback relay.
58 void OnCompositingDidCommit(); 48 void OnCompositingDidCommit();
59 49
60 void AttachCompositor(WindowAndroidCompositor* compositor); 50 void AttachCompositor(WindowAndroidCompositor* compositor);
61 void DetachCompositor(); 51 void DetachCompositor();
62 52
63 void AddObserver(WindowAndroidObserver* observer); 53 void AddObserver(WindowAndroidObserver* observer);
64 void RemoveObserver(WindowAndroidObserver* observer); 54 void RemoveObserver(WindowAndroidObserver* observer);
65 55
66 WindowAndroidCompositor* GetCompositor() { return compositor_; } 56 WindowAndroidCompositor* GetCompositor() { return compositor_; }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void RequestVSyncUpdate(); 91 void RequestVSyncUpdate();
102 92
103 // ViewAndroid overrides. 93 // ViewAndroid overrides.
104 WindowAndroid* GetWindowAndroid() const override; 94 WindowAndroid* GetWindowAndroid() const override;
105 95
106 // The ID of the display that this window belongs to. 96 // The ID of the display that this window belongs to.
107 int display_id() const { return display_id_; } 97 int display_id() const { return display_id_; }
108 98
109 base::android::ScopedJavaGlobalRef<jobject> java_window_; 99 base::android::ScopedJavaGlobalRef<jobject> java_window_;
110 const int display_id_; 100 const int display_id_;
111 gfx::Vector2dF content_offset_;
112 WindowAndroidCompositor* compositor_; 101 WindowAndroidCompositor* compositor_;
113 102
114 base::ObserverList<WindowAndroidObserver> observer_list_; 103 base::ObserverList<WindowAndroidObserver> observer_list_;
115 104
116 std::unique_ptr<WindowBeginFrameSource> begin_frame_source_; 105 std::unique_ptr<WindowBeginFrameSource> begin_frame_source_;
117 bool needs_begin_frames_; 106 bool needs_begin_frames_;
118 107
119 DISALLOW_COPY_AND_ASSIGN(WindowAndroid); 108 DISALLOW_COPY_AND_ASSIGN(WindowAndroid);
120 }; 109 };
121 110
122 } // namespace ui 111 } // namespace ui
123 112
124 #endif // UI_ANDROID_WINDOW_ANDROID_H_ 113 #endif // UI_ANDROID_WINDOW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698