| Index: ui/android/display_android_manager.h
|
| diff --git a/ui/android/display_android_manager.h b/ui/android/display_android_manager.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4fa7de11dbf94adc3a1e8e96b6e887e5b23964cb
|
| --- /dev/null
|
| +++ b/ui/android/display_android_manager.h
|
| @@ -0,0 +1,68 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef UI_ANDROID_DISPLAY_ANDROID_MANAGER_H_
|
| +#define UI_ANDROID_DISPLAY_ANDROID_MANAGER_H_
|
| +
|
| +#include <jni.h>
|
| +#include <map>
|
| +
|
| +#include "base/android/jni_android.h"
|
| +#include "base/macros.h"
|
| +#include "ui/display/screen.h"
|
| +
|
| +namespace ui {
|
| +
|
| +class DisplayAndroidManager : public display::Screen {
|
| + public:
|
| + DisplayAndroidManager();
|
| + ~DisplayAndroidManager() override;
|
| +
|
| + // Screen interface.
|
| +
|
| + gfx::Point GetCursorScreenPoint() override;
|
| + bool IsWindowUnderCursor(gfx::NativeWindow window) override;
|
| + gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
|
| + int GetNumDisplays() const override;
|
| + std::vector<display::Display> GetAllDisplays() const override;
|
| + display::Display GetDisplayNearestWindow(gfx::NativeView view) const override;
|
| + display::Display GetDisplayNearestPoint(
|
| + const gfx::Point& point) const override;
|
| + display::Display GetDisplayMatching(
|
| + const gfx::Rect& match_rect) const override;
|
| + display::Display GetPrimaryDisplay() const override;
|
| + void AddObserver(display::DisplayObserver* observer) override;
|
| + void RemoveObserver(display::DisplayObserver* observer) override;
|
| +
|
| + // Methods called from Java.
|
| +
|
| + void UpdateDisplay(JNIEnv* env,
|
| + const base::android::JavaParamRef<jobject>& jobject,
|
| + jint sdkDisplayId,
|
| + jint physicalWidth,
|
| + jint physicalHeight,
|
| + jint width,
|
| + jint height,
|
| + jfloat dipScale,
|
| + jint rotationDegrees,
|
| + jint bitsPerPixel,
|
| + jint bitsPerComponent);
|
| + void RemoveDisplay(JNIEnv* env,
|
| + const base::android::JavaParamRef<jobject>& jobject,
|
| + jint sdkDisplayId);
|
| + void SetPrimaryDisplayId(JNIEnv* env,
|
| + const base::android::JavaParamRef<jobject>& jobject,
|
| + jint sdkDisplayId);
|
| +
|
| + private:
|
| + using DisplayMap = std::map<int, display::Display>;
|
| + DisplayMap displays_;
|
| + int primary_display_id_ = 0;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(DisplayAndroidManager);
|
| +};
|
| +
|
| +} // namespace ui
|
| +
|
| +#endif // UI_ANDROID_DISPLAY_ANDROID_MANAGER_H_
|
|
|