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

Side by Side Diff: ui/gfx/screen_ios.mm

Issue 854713003: More old files deletion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix tryjobs? Created 5 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/screen_aura.cc ('k') | ui/gfx/screen_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/gfx/screen.h"
6
7 #import <UIKit/UIKit.h>
8
9 #include "base/logging.h"
10 #include "ui/gfx/display.h"
11
12 namespace {
13
14 class ScreenIos : public gfx::Screen {
15 virtual bool IsDIPEnabled() override {
16 return true;
17 }
18
19 virtual gfx::Point GetCursorScreenPoint() override {
20 NOTIMPLEMENTED();
21 return gfx::Point(0, 0);
22 }
23
24 virtual gfx::NativeWindow GetWindowUnderCursor() override {
25 NOTIMPLEMENTED();
26 return gfx::NativeWindow();
27 }
28
29 virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point)
30 override {
31 NOTIMPLEMENTED();
32 return gfx::NativeWindow();
33 }
34
35 virtual int GetNumDisplays() const override {
36 #if TARGET_IPHONE_SIMULATOR
37 // UIScreen does not reliably return correct results on the simulator.
38 return 1;
39 #else
40 return [[UIScreen screens] count];
41 #endif
42 }
43
44 virtual std::vector<gfx::Display> GetAllDisplays() const override {
45 NOTIMPLEMENTED();
46 return std::vector<gfx::Display>(1, GetPrimaryDisplay());
47 }
48
49 // Returns the display nearest the specified window.
50 virtual gfx::Display GetDisplayNearestWindow(
51 gfx::NativeView view) const override {
52 NOTIMPLEMENTED();
53 return gfx::Display();
54 }
55
56 // Returns the the display nearest the specified point.
57 virtual gfx::Display GetDisplayNearestPoint(
58 const gfx::Point& point) const override {
59 NOTIMPLEMENTED();
60 return gfx::Display();
61 }
62
63 // Returns the display that most closely intersects the provided bounds.
64 virtual gfx::Display GetDisplayMatching(
65 const gfx::Rect& match_rect) const override {
66 NOTIMPLEMENTED();
67 return gfx::Display();
68 }
69
70 // Returns the primary display.
71 virtual gfx::Display GetPrimaryDisplay() const override {
72 UIScreen* mainScreen = [UIScreen mainScreen];
73 CHECK(mainScreen);
74 gfx::Display display(0, gfx::Rect(mainScreen.bounds));
75 display.set_device_scale_factor([mainScreen scale]);
76 return display;
77 }
78
79 virtual void AddObserver(gfx::DisplayObserver* observer) override {
80 // no display change on iOS.
81 }
82
83 virtual void RemoveObserver(gfx::DisplayObserver* observer) override {
84 // no display change on iOS.
85 }
86 };
87
88 } // namespace
89
90 namespace gfx {
91
92 Screen* CreateNativeScreen() {
93 return new ScreenIos;
94 }
95
96 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/screen_aura.cc ('k') | ui/gfx/screen_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698