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

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

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

Powered by Google App Engine
This is Rietveld 408576698