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

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

Issue 2416403002: Reland of Android: support multiple displays on C++ side (Closed)
Patch Set: Rebased and fixed webkit_tests Created 4 years, 1 month 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/ui_android_jni_registrar.cc ('k') | ui/android/window_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 <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/android/jni_weak_ref.h" 12 #include "base/android/jni_weak_ref.h"
13 #include "base/android/scoped_java_ref.h" 13 #include "base/android/scoped_java_ref.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "ui/android/ui_android_export.h" 17 #include "ui/android/ui_android_export.h"
18 #include "ui/android/view_android.h" 18 #include "ui/android/view_android.h"
19 #include "ui/gfx/geometry/vector2d_f.h" 19 #include "ui/gfx/geometry/vector2d_f.h"
20 20
21 namespace display {
22 class DisplayAndroidManager;
23 }
24
21 namespace ui { 25 namespace ui {
22 26
23 class WindowAndroidCompositor; 27 class WindowAndroidCompositor;
24 class WindowAndroidObserver; 28 class WindowAndroidObserver;
25 29
26 // Android implementation of the activity window. 30 // Android implementation of the activity window.
27 // WindowAndroid is also the root of a ViewAndroid tree. 31 // WindowAndroid is also the root of a ViewAndroid tree.
28 class UI_ANDROID_EXPORT WindowAndroid : public ViewAndroid { 32 class UI_ANDROID_EXPORT WindowAndroid : public ViewAndroid {
29 public: 33 public:
30 WindowAndroid(JNIEnv* env, jobject obj); 34 WindowAndroid(JNIEnv* env, jobject obj, int display_id);
31 35
32 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 36 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
33 37
34 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); 38 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
35 39
36 static bool RegisterWindowAndroid(JNIEnv* env); 40 static bool RegisterWindowAndroid(JNIEnv* env);
37 41
38 // The content offset in CSS pixels. It is used together with device scale 42 // The content offset in CSS pixels. It is used together with device scale
39 // factor to translate snapshots to the correct part of the window. 43 // factor to translate snapshots to the correct part of the window.
40 void set_content_offset(const gfx::Vector2dF& content_offset) { 44 void set_content_offset(const gfx::Vector2dF& content_offset) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 77
74 // Return whether the specified Android permission is granted. 78 // Return whether the specified Android permission is granted.
75 bool HasPermission(const std::string& permission); 79 bool HasPermission(const std::string& permission);
76 // Return whether the specified Android permission can be requested by Chrome. 80 // Return whether the specified Android permission can be requested by Chrome.
77 bool CanRequestPermission(const std::string& permission); 81 bool CanRequestPermission(const std::string& permission);
78 82
79 static WindowAndroid* CreateForTesting(); 83 static WindowAndroid* CreateForTesting();
80 void DestroyForTesting(); 84 void DestroyForTesting();
81 85
82 private: 86 private:
87 friend class DisplayAndroidManager;
88
83 ~WindowAndroid() override; 89 ~WindowAndroid() override;
84 90
85 // ViewAndroid overrides. 91 // ViewAndroid overrides.
86 WindowAndroid* GetWindowAndroid() const override; 92 WindowAndroid* GetWindowAndroid() const override;
87 93
94 // The ID of the display that this window belongs to.
95 int display_id() const { return display_id_; }
96
88 base::android::ScopedJavaGlobalRef<jobject> java_window_; 97 base::android::ScopedJavaGlobalRef<jobject> java_window_;
98 const int display_id_;
89 gfx::Vector2dF content_offset_; 99 gfx::Vector2dF content_offset_;
90 WindowAndroidCompositor* compositor_; 100 WindowAndroidCompositor* compositor_;
91 101
92 base::ObserverList<WindowAndroidObserver> observer_list_; 102 base::ObserverList<WindowAndroidObserver> observer_list_;
93 103
94 DISALLOW_COPY_AND_ASSIGN(WindowAndroid); 104 DISALLOW_COPY_AND_ASSIGN(WindowAndroid);
95 }; 105 };
96 106
97 } // namespace ui 107 } // namespace ui
98 108
99 #endif // UI_ANDROID_WINDOW_ANDROID_H_ 109 #endif // UI_ANDROID_WINDOW_ANDROID_H_
OLDNEW
« no previous file with comments | « ui/android/ui_android_jni_registrar.cc ('k') | ui/android/window_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698