| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return nullptr; | 50 return nullptr; |
| 51 } | 51 } |
| 52 | 52 |
| 53 Display ScreenBase::GetPrimaryDisplay() const { | 53 Display ScreenBase::GetPrimaryDisplay() const { |
| 54 auto iter = display_list_.GetPrimaryDisplayIterator(); | 54 auto iter = display_list_.GetPrimaryDisplayIterator(); |
| 55 if (iter == display_list_.displays().end()) | 55 if (iter == display_list_.displays().end()) |
| 56 return Display(); // Invalid display since we have no primary display. | 56 return Display(); // Invalid display since we have no primary display. |
| 57 return *iter; | 57 return *iter; |
| 58 } | 58 } |
| 59 | 59 |
| 60 Display ScreenBase::GetDisplayNearestWindow(gfx::NativeView view) const { | 60 Display ScreenBase::GetDisplayNearestWindow(const gfx::NativeView view) const { |
| 61 NOTIMPLEMENTED(); | 61 NOTIMPLEMENTED(); |
| 62 return GetPrimaryDisplay(); | 62 return GetPrimaryDisplay(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 Display ScreenBase::GetDisplayNearestPoint(const gfx::Point& point) const { | 65 Display ScreenBase::GetDisplayNearestPoint(const gfx::Point& point) const { |
| 66 return *FindDisplayNearestPoint(display_list_.displays(), point); | 66 return *FindDisplayNearestPoint(display_list_.displays(), point); |
| 67 } | 67 } |
| 68 | 68 |
| 69 int ScreenBase::GetNumDisplays() const { | 69 int ScreenBase::GetNumDisplays() const { |
| 70 return static_cast<int>(display_list_.displays().size()); | 70 return static_cast<int>(display_list_.displays().size()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 82 | 82 |
| 83 void ScreenBase::AddObserver(DisplayObserver* observer) { | 83 void ScreenBase::AddObserver(DisplayObserver* observer) { |
| 84 display_list_.AddObserver(observer); | 84 display_list_.AddObserver(observer); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void ScreenBase::RemoveObserver(DisplayObserver* observer) { | 87 void ScreenBase::RemoveObserver(DisplayObserver* observer) { |
| 88 display_list_.RemoveObserver(observer); | 88 display_list_.RemoveObserver(observer); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace display | 91 } // namespace display |
| OLD | NEW |