OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |