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

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: pass right bounds to snapshot api Created 3 years, 12 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 <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 21 matching lines...) Expand all
32 class UI_ANDROID_EXPORT WindowAndroid : public ViewAndroid { 32 class UI_ANDROID_EXPORT WindowAndroid : public ViewAndroid {
33 public: 33 public:
34 WindowAndroid(JNIEnv* env, jobject obj, int display_id); 34 WindowAndroid(JNIEnv* env, jobject obj, int display_id);
35 35
36 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 36 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
37 37
38 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); 38 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
39 39
40 static bool RegisterWindowAndroid(JNIEnv* env); 40 static bool RegisterWindowAndroid(JNIEnv* env);
41 41
42 // The content offset in CSS pixels. It is used together with device scale
43 // factor to translate snapshots to the correct part of the window.
44 void set_content_offset(const gfx::Vector2dF& content_offset) {
45 content_offset_ = content_offset;
46 }
47
48 gfx::Vector2dF content_offset() const {
49 return content_offset_;
50 }
51
52 // Compositor callback relay. 42 // Compositor callback relay.
53 void OnCompositingDidCommit(); 43 void OnCompositingDidCommit();
54 44
55 void AttachCompositor(WindowAndroidCompositor* compositor); 45 void AttachCompositor(WindowAndroidCompositor* compositor);
56 void DetachCompositor(); 46 void DetachCompositor();
57 47
58 void AddObserver(WindowAndroidObserver* observer); 48 void AddObserver(WindowAndroidObserver* observer);
59 void RemoveObserver(WindowAndroidObserver* observer); 49 void RemoveObserver(WindowAndroidObserver* observer);
60 50
61 WindowAndroidCompositor* GetCompositor() { return compositor_; } 51 WindowAndroidCompositor* GetCompositor() { return compositor_; }
(...skipping 29 matching lines...) Expand all
91 ~WindowAndroid() override; 81 ~WindowAndroid() override;
92 82
93 // ViewAndroid overrides. 83 // ViewAndroid overrides.
94 WindowAndroid* GetWindowAndroid() const override; 84 WindowAndroid* GetWindowAndroid() const override;
95 85
96 // The ID of the display that this window belongs to. 86 // The ID of the display that this window belongs to.
97 int display_id() const { return display_id_; } 87 int display_id() const { return display_id_; }
98 88
99 base::android::ScopedJavaGlobalRef<jobject> java_window_; 89 base::android::ScopedJavaGlobalRef<jobject> java_window_;
100 const int display_id_; 90 const int display_id_;
101 gfx::Vector2dF content_offset_;
102 WindowAndroidCompositor* compositor_; 91 WindowAndroidCompositor* compositor_;
103 92
104 base::ObserverList<WindowAndroidObserver> observer_list_; 93 base::ObserverList<WindowAndroidObserver> observer_list_;
105 94
106 DISALLOW_COPY_AND_ASSIGN(WindowAndroid); 95 DISALLOW_COPY_AND_ASSIGN(WindowAndroid);
107 }; 96 };
108 97
109 } // namespace ui 98 } // namespace ui
110 99
111 #endif // UI_ANDROID_WINDOW_ANDROID_H_ 100 #endif // UI_ANDROID_WINDOW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698