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

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

Issue 110283005: Make aura_demo work on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix resolve Created 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/view_prop.h ('k') | ui/resources/ui_resources.grd » ('j') | 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 (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 <map> 10 #include <map>
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 148
149 if (!displays.size()) 149 if (!displays.size())
150 return std::vector<gfx::Display>(1, GetPrimaryDisplay()); 150 return std::vector<gfx::Display>(1, GetPrimaryDisplay());
151 151
152 return displays; 152 return displays;
153 } 153 }
154 154
155 virtual gfx::Display GetDisplayNearestWindow( 155 virtual gfx::Display GetDisplayNearestWindow(
156 gfx::NativeView view) const OVERRIDE { 156 gfx::NativeView view) const OVERRIDE {
157 NSWindow* window = [view window]; 157 NSWindow* window = nil;
158 #if !defined(USE_AURA)
159 window = [view window];
160 #endif
158 if (!window) 161 if (!window)
159 return GetPrimaryDisplay(); 162 return GetPrimaryDisplay();
160 NSScreen* match_screen = [window screen]; 163 NSScreen* match_screen = [window screen];
161 if (!match_screen) 164 if (!match_screen)
162 return GetPrimaryDisplay(); 165 return GetPrimaryDisplay();
163 return GetDisplayForScreen(match_screen); 166 return GetDisplayForScreen(match_screen);
164 } 167 }
165 168
166 virtual gfx::Display GetDisplayNearestPoint( 169 virtual gfx::Display GetDisplayNearestPoint(
167 const gfx::Point& point) const OVERRIDE { 170 const gfx::Point& point) const OVERRIDE {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } 205 }
203 206
204 private: 207 private:
205 DISALLOW_COPY_AND_ASSIGN(ScreenMac); 208 DISALLOW_COPY_AND_ASSIGN(ScreenMac);
206 }; 209 };
207 210
208 } // namespace 211 } // namespace
209 212
210 namespace gfx { 213 namespace gfx {
211 214
215 #if !defined(USE_AURA)
212 Screen* CreateNativeScreen() { 216 Screen* CreateNativeScreen() {
213 return new ScreenMac; 217 return new ScreenMac;
214 } 218 }
219 #endif
215 220
216 } 221 }
OLDNEW
« no previous file with comments | « ui/base/view_prop.h ('k') | ui/resources/ui_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698