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

Unified Diff: ui/display/android/screen_android.cc

Issue 2491563002: Change ScreenAndroid and ScreenIos to use ScreenBase and DisplayList. (Closed)
Patch Set: public 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/display/ios/screen_ios.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/android/screen_android.cc
diff --git a/ui/display/android/screen_android.cc b/ui/display/android/screen_android.cc
index 015d68cd4848a310125d559df280bbfa8d32b9be..39c02d07af808c6bb296f00868839f686ff0c3fe 100644
--- a/ui/display/android/screen_android.cc
+++ b/ui/display/android/screen_android.cc
@@ -2,33 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/display/screen.h"
-
#include "base/logging.h"
#include "base/macros.h"
#include "ui/display/display.h"
+#include "ui/display/screen_base.h"
#include "ui/gfx/android/device_display_info.h"
#include "ui/gfx/geometry/size_conversions.h"
namespace display {
-class ScreenAndroid : public Screen {
+class ScreenAndroid : public ScreenBase {
public:
- ScreenAndroid() {}
-
- gfx::Point GetCursorScreenPoint() override { return gfx::Point(); }
-
- bool IsWindowUnderCursor(gfx::NativeWindow window) override {
- NOTIMPLEMENTED();
- return false;
- }
-
- gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override {
- NOTIMPLEMENTED();
- return NULL;
- }
-
- Display GetPrimaryDisplay() const override {
+ ScreenAndroid() {
gfx::DeviceDisplayInfo device_info;
const float device_scale_factor = device_info.GetDIPScale();
// Note: GetPhysicalDisplayWidth/Height() does not subtract window
@@ -50,35 +35,25 @@ class ScreenAndroid : public Screen {
display.set_color_depth(device_info.GetBitsPerPixel());
display.set_depth_per_component(device_info.GetBitsPerComponent());
display.set_is_monochrome(device_info.GetBitsPerComponent() == 0);
- return display;
+ ProcessDisplayChanged(display, true /* is_primary */);
}
- Display GetDisplayNearestWindow(gfx::NativeView view) const override {
- return GetPrimaryDisplay();
- }
+ gfx::Point GetCursorScreenPoint() override { return gfx::Point(); }
- Display GetDisplayNearestPoint(const gfx::Point& point) const override {
- return GetPrimaryDisplay();
+ bool IsWindowUnderCursor(gfx::NativeWindow window) override {
+ NOTIMPLEMENTED();
+ return false;
}
- int GetNumDisplays() const override { return 1; }
-
- std::vector<Display> GetAllDisplays() const override {
- return std::vector<Display>(1, GetPrimaryDisplay());
+ gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override {
+ NOTIMPLEMENTED();
+ return NULL;
}
- Display GetDisplayMatching(const gfx::Rect& match_rect) const override {
+ Display GetDisplayNearestWindow(gfx::NativeView view) const override {
return GetPrimaryDisplay();
}
- void AddObserver(DisplayObserver* observer) override {
- // no display change on Android.
- }
-
- void RemoveObserver(DisplayObserver* observer) override {
- // no display change on Android.
- }
-
private:
DISALLOW_COPY_AND_ASSIGN(ScreenAndroid);
};
« no previous file with comments | « no previous file | ui/display/ios/screen_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698