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

Side by Side Diff: ui/display/screen_base.cc

Issue 2489873002: Change GetAllDisplays() in all screens to return a const vector&. (Closed)
Patch Set: roll back to rebase as dummy_screen_android is reverted 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/screen_base.h ('k') | ui/display/win/screen_win.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // This has to be before any other includes, else default is picked up. 5 // This has to be before any other includes, else default is picked up.
6 // See base/logging for details on this. 6 // See base/logging for details on this.
7 #define NOTIMPLEMENTED_POLICY 5 7 #define NOTIMPLEMENTED_POLICY 5
8 8
9 #include "ui/display/screen_base.h" 9 #include "ui/display/screen_base.h"
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 Display ScreenBase::GetDisplayNearestPoint(const gfx::Point& point) const { 46 Display ScreenBase::GetDisplayNearestPoint(const gfx::Point& point) const {
47 return *FindDisplayNearestPoint(display_list_.displays(), point); 47 return *FindDisplayNearestPoint(display_list_.displays(), point);
48 } 48 }
49 49
50 int ScreenBase::GetNumDisplays() const { 50 int ScreenBase::GetNumDisplays() const {
51 return static_cast<int>(display_list_.displays().size()); 51 return static_cast<int>(display_list_.displays().size());
52 } 52 }
53 53
54 std::vector<Display> ScreenBase::GetAllDisplays() const { 54 const std::vector<Display>& ScreenBase::GetAllDisplays() const {
55 return display_list_.displays(); 55 return display_list_.displays();
56 } 56 }
57 57
58 Display ScreenBase::GetDisplayMatching(const gfx::Rect& match_rect) const { 58 Display ScreenBase::GetDisplayMatching(const gfx::Rect& match_rect) const {
59 const Display* match = 59 const Display* match =
60 FindDisplayWithBiggestIntersection(display_list_.displays(), match_rect); 60 FindDisplayWithBiggestIntersection(display_list_.displays(), match_rect);
61 return match ? *match : GetPrimaryDisplay(); 61 return match ? *match : GetPrimaryDisplay();
62 } 62 }
63 63
64 void ScreenBase::AddObserver(DisplayObserver* observer) { 64 void ScreenBase::AddObserver(DisplayObserver* observer) {
(...skipping 12 matching lines...) Expand all
77 is_primary ? DisplayList::Type::PRIMARY 77 is_primary ? DisplayList::Type::PRIMARY
78 : DisplayList::Type::NOT_PRIMARY); 78 : DisplayList::Type::NOT_PRIMARY);
79 return; 79 return;
80 } 80 }
81 display_list_.UpdateDisplay( 81 display_list_.UpdateDisplay(
82 changed_display, 82 changed_display,
83 is_primary ? DisplayList::Type::PRIMARY : DisplayList::Type::NOT_PRIMARY); 83 is_primary ? DisplayList::Type::PRIMARY : DisplayList::Type::NOT_PRIMARY);
84 } 84 }
85 85
86 } // namespace display 86 } // namespace display
OLDNEW
« no previous file with comments | « ui/display/screen_base.h ('k') | ui/display/win/screen_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698