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

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

Issue 2489873002: Change GetAllDisplays() in all screens to return a const vector&. (Closed)
Patch Set: 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
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return false; 134 return false;
135 } 135 }
136 136
137 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override { 137 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override {
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 const 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(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)
(...skipping 143 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

Powered by Google App Engine
This is Rietveld 408576698