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

Side by Side Diff: ui/display/mac/screen_mac.mm

Issue 2468093003: Makes Screen functions take a const gfx::NativeView (Closed)
Patch Set: merge Created 4 years, 1 month 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 | « ui/display/ios/screen_ios.mm ('k') | ui/display/screen.h » ('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/display/screen.h" 5 #include "ui/display/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 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 NOTIMPLEMENTED(); 138 NOTIMPLEMENTED();
139 return gfx::NativeWindow(); 139 return gfx::NativeWindow();
140 } 140 }
141 141
142 int GetNumDisplays() const override { return GetAllDisplays().size(); } 142 int GetNumDisplays() const override { return GetAllDisplays().size(); }
143 143
144 std::vector<Display> GetAllDisplays() const override { 144 std::vector<Display> GetAllDisplays() const override {
145 return displays_; 145 return displays_;
146 } 146 }
147 147
148 Display GetDisplayNearestWindow(gfx::NativeView view) const override { 148 Display GetDisplayNearestWindow(const gfx::NativeView view) const override {
149 NSWindow* window = nil; 149 NSWindow* window = nil;
150 #if !defined(USE_AURA) 150 #if !defined(USE_AURA)
151 if (view) 151 if (view)
152 window = [view window]; 152 window = [view window];
153 #endif 153 #endif
154 if (!window) 154 if (!window)
155 return GetPrimaryDisplay(); 155 return GetPrimaryDisplay();
156 NSScreen* match_screen = [window screen]; 156 NSScreen* match_screen = [window screen];
157 if (!match_screen) 157 if (!match_screen)
158 return GetPrimaryDisplay(); 158 return GetPrimaryDisplay();
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 } // namespace 299 } // namespace
300 300
301 #if !defined(USE_AURA) 301 #if !defined(USE_AURA)
302 Screen* CreateNativeScreen() { 302 Screen* CreateNativeScreen() {
303 return new ScreenMac; 303 return new ScreenMac;
304 } 304 }
305 #endif 305 #endif
306 306
307 } // namespace display 307 } // namespace display
OLDNEW
« no previous file with comments | « ui/display/ios/screen_ios.mm ('k') | ui/display/screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698