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

Unified Diff: ui/display/ios/screen_ios.mm

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 | « ui/display/android/screen_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/ios/screen_ios.mm
diff --git a/ui/display/ios/screen_ios.mm b/ui/display/ios/screen_ios.mm
index 08d0d921b171106439039de2e348b1aadea7c064..23efa97dfd30513b11ed28e1d98c1dd97c0b1458 100644
--- a/ui/display/ios/screen_ios.mm
+++ b/ui/display/ios/screen_ios.mm
@@ -2,17 +2,25 @@
// 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"
-
#import <UIKit/UIKit.h>
#include "base/logging.h"
#include "ui/display/display.h"
+#include "ui/display/screen_base.h"
namespace display {
namespace {
-class ScreenIos : public Screen {
+class ScreenIos : public ScreenBase {
+ public:
+ ScreenIos() {
+ UIScreen* mainScreen = [UIScreen mainScreen];
+ CHECK(mainScreen);
+ Display display(0, gfx::Rect(mainScreen.bounds));
+ display.set_device_scale_factor([mainScreen scale]);
+ ProcessDisplayChanged(display, true /* is_primary */);
+ }
+
gfx::Point GetCursorScreenPoint() override {
NOTIMPLEMENTED();
return gfx::Point(0, 0);
@@ -37,45 +45,8 @@ class ScreenIos : public Screen {
#endif
}
- std::vector<Display> GetAllDisplays() const override {
- NOTIMPLEMENTED();
- return std::vector<Display>(1, GetPrimaryDisplay());
- }
-
- // Returns the display nearest the specified window.
- Display GetDisplayNearestWindow(gfx::NativeView view) const override {
- NOTIMPLEMENTED();
- return Display();
- }
-
- // Returns the the display nearest the specified point.
- Display GetDisplayNearestPoint(const gfx::Point& point) const override {
- NOTIMPLEMENTED();
- return Display();
- }
-
- // Returns the display that most closely intersects the provided bounds.
- Display GetDisplayMatching(const gfx::Rect& match_rect) const override {
- NOTIMPLEMENTED();
- return Display();
- }
-
- // Returns the primary display.
- Display GetPrimaryDisplay() const override {
- UIScreen* mainScreen = [UIScreen mainScreen];
- CHECK(mainScreen);
- Display display(0, gfx::Rect(mainScreen.bounds));
- display.set_device_scale_factor([mainScreen scale]);
- return display;
- }
-
- void AddObserver(DisplayObserver* observer) override {
- // no display change on iOS.
- }
-
- void RemoveObserver(DisplayObserver* observer) override {
- // no display change on iOS.
- }
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScreenIos);
};
} // namespace
« no previous file with comments | « ui/display/android/screen_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698