| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_DISPLAY_ANDROID_MANAGER_H_ | 5 #ifndef UI_ANDROID_DISPLAY_ANDROID_MANAGER_H_ |
| 6 #define UI_ANDROID_DISPLAY_ANDROID_MANAGER_H_ | 6 #define UI_ANDROID_DISPLAY_ANDROID_MANAGER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/android/ui_android_export.h" |
| 12 #include "ui/display/screen_base.h" | 13 #include "ui/display/screen_base.h" |
| 13 | 14 |
| 14 namespace ui { | 15 namespace ui { |
| 15 | 16 |
| 16 class DisplayAndroidManager : public display::ScreenBase { | 17 class UI_ANDROID_EXPORT DisplayAndroidManager : public display::ScreenBase { |
| 17 public: | 18 public: |
| 18 ~DisplayAndroidManager() override; | 19 ~DisplayAndroidManager() override; |
| 19 | 20 |
| 21 // Prefer using |Screen::GetScreen()|. Only use this to avoid casting. |
| 22 static DisplayAndroidManager* GetInstance(); |
| 23 |
| 24 |
| 20 // Screen interface. | 25 // Screen interface. |
| 21 | 26 |
| 22 display::Display GetDisplayNearestWindow(gfx::NativeView view) const override; | 27 display::Display GetDisplayNearestWindow(gfx::NativeView view) const override; |
| 28 display::Display GetDisplayNearestWindowAndroid( |
| 29 gfx::NativeWindow window) const override; |
| 23 display::Display GetDisplayNearestPoint( | 30 display::Display GetDisplayNearestPoint( |
| 24 const gfx::Point& point) const override; | 31 const gfx::Point& point) const override; |
| 25 display::Display GetDisplayMatching( | 32 display::Display GetDisplayMatching( |
| 26 const gfx::Rect& match_rect) const override; | 33 const gfx::Rect& match_rect) const override; |
| 27 | 34 |
| 28 // Methods called from Java. | 35 // Methods called from Java. |
| 29 | 36 |
| 30 void UpdateDisplay(JNIEnv* env, | 37 void UpdateDisplay(JNIEnv* env, |
| 31 const base::android::JavaParamRef<jobject>& jobject, | 38 const base::android::JavaParamRef<jobject>& jobject, |
| 32 jint sdkDisplayId, | 39 jint sdkDisplayId, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 50 DisplayAndroidManager(); | 57 DisplayAndroidManager(); |
| 51 | 58 |
| 52 int primary_display_id_ = 0; | 59 int primary_display_id_ = 0; |
| 53 | 60 |
| 54 DISALLOW_COPY_AND_ASSIGN(DisplayAndroidManager); | 61 DISALLOW_COPY_AND_ASSIGN(DisplayAndroidManager); |
| 55 }; | 62 }; |
| 56 | 63 |
| 57 } // namespace ui | 64 } // namespace ui |
| 58 | 65 |
| 59 #endif // UI_ANDROID_DISPLAY_ANDROID_MANAGER_H_ | 66 #endif // UI_ANDROID_DISPLAY_ANDROID_MANAGER_H_ |
| OLD | NEW |