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_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/gfx/geometry/vector2d_f.h" | 18 #include "ui/gfx/geometry/vector2d_f.h" |
19 | 19 |
20 namespace gfx { | |
21 class DeviceDisplayInfo; | |
22 } | |
23 | |
20 namespace ui { | 24 namespace ui { |
21 | 25 |
22 class WindowAndroidCompositor; | 26 class WindowAndroidCompositor; |
23 class WindowAndroidObserver; | 27 class WindowAndroidObserver; |
24 | 28 |
25 // Android implementation of the activity window. | 29 // Android implementation of the activity window. |
26 class UI_ANDROID_EXPORT WindowAndroid { | 30 class UI_ANDROID_EXPORT WindowAndroid { |
27 public: | 31 public: |
28 WindowAndroid(JNIEnv* env, jobject obj); | 32 WindowAndroid(JNIEnv* env, jobject obj); |
29 | 33 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 void OnActivityStarted(JNIEnv* env, | 73 void OnActivityStarted(JNIEnv* env, |
70 const base::android::JavaParamRef<jobject>& obj); | 74 const base::android::JavaParamRef<jobject>& obj); |
71 | 75 |
72 // Return whether the specified Android permission is granted. | 76 // Return whether the specified Android permission is granted. |
73 bool HasPermission(const std::string& permission); | 77 bool HasPermission(const std::string& permission); |
74 // Return whether the specified Android permission can be requested by Chrome. | 78 // Return whether the specified Android permission can be requested by Chrome. |
75 bool CanRequestPermission(const std::string& permission); | 79 bool CanRequestPermission(const std::string& permission); |
76 | 80 |
77 static WindowAndroid* createForTesting(); | 81 static WindowAndroid* createForTesting(); |
78 | 82 |
83 const gfx::DeviceDisplayInfo& GetDeviceDisplayInfo() const; | |
84 | |
79 private: | 85 private: |
80 ~WindowAndroid(); | 86 ~WindowAndroid(); |
81 | 87 |
82 base::android::ScopedJavaGlobalRef<jobject> java_window_; | 88 base::android::ScopedJavaGlobalRef<jobject> java_window_; |
83 gfx::Vector2dF content_offset_; | 89 gfx::Vector2dF content_offset_; |
84 WindowAndroidCompositor* compositor_; | 90 WindowAndroidCompositor* compositor_; |
85 | 91 |
86 base::ObserverList<WindowAndroidObserver> observer_list_; | 92 base::ObserverList<WindowAndroidObserver> observer_list_; |
93 // TODO(gsennton) Update display info on screen orientation updates. | |
boliu
2016/02/25 05:33:36
nit: TODO(gsennton): ...
And other places
gsennton
2016/02/25 17:08:04
Done.
| |
94 const scoped_ptr<gfx::DeviceDisplayInfo> device_display_info_; | |
87 | 95 |
88 DISALLOW_COPY_AND_ASSIGN(WindowAndroid); | 96 DISALLOW_COPY_AND_ASSIGN(WindowAndroid); |
89 }; | 97 }; |
90 | 98 |
91 } // namespace ui | 99 } // namespace ui |
92 | 100 |
93 #endif // UI_ANDROID_WINDOW_ANDROID_H_ | 101 #endif // UI_ANDROID_WINDOW_ANDROID_H_ |
OLD | NEW |