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

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

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix other os's Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
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 "ui/gfx/display.h" 9 #include "ui/gfx/display.h"
10 10
11 namespace gfx { 11 namespace gfx {
12 12
13 // static 13 // static
14 gfx::Display Screen::GetPrimaryDisplay() { 14 gfx::Display Screen::GetPrimaryDisplay(gfx::NativeView context) {
15 UIScreen* mainScreen = [[UIScreen screens] objectAtIndex:0]; 15 UIScreen* mainScreen = [[UIScreen screens] objectAtIndex:0];
16 gfx::Display display(0, gfx::Rect(mainScreen.bounds)); 16 gfx::Display display(0, gfx::Rect(mainScreen.bounds));
17 return display; 17 return display;
18 } 18 }
19 19
20 // static 20 // static
21 int Screen::GetNumDisplays() { 21 int Screen::GetNumDisplays(gfx::NativeView context) {
22 #if TARGET_IPHONE_SIMULATOR 22 #if TARGET_IPHONE_SIMULATOR
23 // UIScreen does not reliably return correct results on the simulator. 23 // UIScreen does not reliably return correct results on the simulator.
24 return 1; 24 return 1;
25 #else 25 #else
26 return [[UIScreen screens] count]; 26 return [[UIScreen screens] count];
27 #endif 27 #endif
28 } 28 }
29 29
30 } // namespace gfx 30 } // namespace gfx
OLDNEW
« ui/gfx/screen_aura.cc ('K') | « ui/gfx/screen_gtk.cc ('k') | ui/gfx/screen_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698