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

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

Issue 10872042: Provide iOS implementation of screen.h. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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 | « no previous file | ui/ui.gyp » ('j') | ui/ui.gyp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
stuartmorgan 2012/08/23 19:20:19 2012
blundell 2012/08/30 09:18:51 Done.
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 "ui/gfx/display.h"
10
11 namespace gfx {
12
13 // static
14 gfx::Display Screen::GetPrimaryDisplay() {
15 UIScreen* mainScreen = [UIScreen mainScreen];
Nico 2012/08/23 19:31:28 optional nit: since mainScreen means something dif
blundell 2012/08/30 09:18:51 Done.
16 gfx::Display display(0, gfx::Rect(mainScreen.bounds));
17 return display;
18 }
19
20 // static
21 int Screen::GetNumDisplays() {
22 #if TARGET_IPHONE_SIMULATOR
23 // Looks like UIScreens seems to lie on the simulator at times.
stuartmorgan 2012/08/23 19:20:19 // UIScreen does not reliably return correct resul
blundell 2012/08/30 09:18:51 Done.
24 return 1;
25 #else
26 return [[UIScreen screens] count];
27 #endif
28 }
29
30 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | ui/ui.gyp » ('j') | ui/ui.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698