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 <ApplicationServices/ApplicationServices.h> | 7 #import <ApplicationServices/ApplicationServices.h> |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 // Returns the primary display. | 162 // Returns the primary display. |
163 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE { | 163 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE { |
164 // Primary display is defined as the display with the menubar, | 164 // Primary display is defined as the display with the menubar, |
165 // which is always at index 0. | 165 // which is always at index 0. |
166 NSScreen* primary = [[NSScreen screens] objectAtIndex:0]; | 166 NSScreen* primary = [[NSScreen screens] objectAtIndex:0]; |
167 gfx::Display display = GetDisplayForScreen(primary, true /* primary */); | 167 gfx::Display display = GetDisplayForScreen(primary, true /* primary */); |
168 return display; | 168 return display; |
169 } | 169 } |
170 | 170 |
| 171 virtual void AddObserver(gfx::DisplayObserver* observer) OVERRIDE { |
| 172 // TODO(oshima): crbug.com/122863. |
| 173 } |
| 174 |
| 175 virtual void RemoveObserver(gfx::DisplayObserver* observer) OVERRIDE { |
| 176 // TODO(oshima): crbug.com/122863. |
| 177 } |
| 178 |
171 private: | 179 private: |
172 DISALLOW_COPY_AND_ASSIGN(ScreenMac); | 180 DISALLOW_COPY_AND_ASSIGN(ScreenMac); |
173 }; | 181 }; |
174 | 182 |
175 } // namespace | 183 } // namespace |
176 | 184 |
177 namespace gfx { | 185 namespace gfx { |
178 | 186 |
179 Screen* CreateNativeScreen() { | 187 Screen* CreateNativeScreen() { |
180 return new ScreenMac; | 188 return new ScreenMac; |
181 } | 189 } |
182 | 190 |
183 } | 191 } |
OLD | NEW |