blob: aecd5dc1d231228f1cbfe38f3005691c49626a4b [file] [log] [blame]
Avi Drissman3e1a26c2022-09-15 20:26:031// Copyright 2016 The Chromium Authors
timavfe53c2c62016-11-23 02:35:462// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef UI_ANDROID_DISPLAY_ANDROID_MANAGER_H_
6#define UI_ANDROID_DISPLAY_ANDROID_MANAGER_H_
7
8#include <jni.h>
9
10#include "base/android/jni_android.h"
timavfe53c2c62016-11-23 02:35:4611#include "ui/display/screen_base.h"
Bo Liu71ca79c2019-02-26 18:01:2412#include "ui/gfx/geometry/size.h"
timavfe53c2c62016-11-23 02:35:4613
14namespace ui {
15
Bo Liu71ca79c2019-02-26 18:01:2416class WindowAndroid;
17
timavfe53c2c62016-11-23 02:35:4618class DisplayAndroidManager : public display::ScreenBase {
19 public:
Peter Boströmc8c12352021-09-21 23:37:1520 DisplayAndroidManager(const DisplayAndroidManager&) = delete;
21 DisplayAndroidManager& operator=(const DisplayAndroidManager&) = delete;
22
timavfe53c2c62016-11-23 02:35:4623 ~DisplayAndroidManager() override;
24
25 // Screen interface.
26
jinsukkim2dd85f32017-03-17 01:54:2827 display::Display GetDisplayNearestWindow(
28 gfx::NativeWindow window) const override;
29 display::Display GetDisplayNearestView(gfx::NativeView view) const override;
timavfe53c2c62016-11-23 02:35:4630 display::Display GetDisplayNearestPoint(
31 const gfx::Point& point) const override;
32 display::Display GetDisplayMatching(
33 const gfx::Rect& match_rect) const override;
34
35 // Methods called from Java.
36
37 void UpdateDisplay(JNIEnv* env,
38 const base::android::JavaParamRef<jobject>& jobject,
39 jint sdkDisplayId,
timavfe53c2c62016-11-23 02:35:4640 jint width,
41 jint height,
42 jfloat dipScale,
43 jint rotationDegrees,
44 jint bitsPerPixel,
Christopher Cameronbc1ae6d2017-07-18 05:20:46