OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 return gfx::Display(); | 56 return gfx::Display(); |
57 } | 57 } |
58 | 58 |
59 // Returns the primary display. | 59 // Returns the primary display. |
60 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE { | 60 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE { |
61 UIScreen* mainScreen = [[UIScreen screens] objectAtIndex:0]; | 61 UIScreen* mainScreen = [[UIScreen screens] objectAtIndex:0]; |
62 gfx::Display display(0, gfx::Rect(mainScreen.bounds)); | 62 gfx::Display display(0, gfx::Rect(mainScreen.bounds)); |
63 display.set_device_scale_factor([mainScreen scale]); | 63 display.set_device_scale_factor([mainScreen scale]); |
64 return display; | 64 return display; |
65 } | 65 } |
| 66 |
| 67 virtual void AddObserver(gfx::DisplayObserver* observer) OVERRIDE { |
| 68 // no display change on iOS. |
| 69 } |
| 70 |
| 71 virtual void RemoveObserver(gfx::DisplayObserver* observer) OVERRIDE { |
| 72 // no display change on iOS. |
| 73 } |
66 }; | 74 }; |
67 | 75 |
68 } // namespace | 76 } // namespace |
69 | 77 |
70 namespace gfx { | 78 namespace gfx { |
71 | 79 |
72 Screen* CreateNativeScreen() { | 80 Screen* CreateNativeScreen() { |
73 return new ScreenIos; | 81 return new ScreenIos; |
74 } | 82 } |
75 | 83 |
76 } // namespace gfx | 84 } // namespace gfx |
OLD | NEW |