| 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 27 matching lines...) Expand all Loading... |
| 38 return *iter; | 38 return *iter; |
| 39 } | 39 } |
| 40 | 40 |
| 41 Display ScreenBase::GetDisplayNearestWindow(gfx::NativeView view) const { | 41 Display ScreenBase::GetDisplayNearestWindow(gfx::NativeView view) const { |
| 42 // TODO(riajiang): Implement this for multi-displays either here or in | 42 // TODO(riajiang): Implement this for multi-displays either here or in |
| 43 // ScreenMus. | 43 // ScreenMus. |
| 44 NOTIMPLEMENTED(); | 44 NOTIMPLEMENTED(); |
| 45 return GetPrimaryDisplay(); | 45 return GetPrimaryDisplay(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 Display ScreenBase::GetDisplayNearestView(gfx::NativeView view) const { |
| 49 NOTIMPLEMENTED(); |
| 50 return GetDisplayNearestWindow(nullptr); |
| 51 } |
| 52 |
| 48 Display ScreenBase::GetDisplayNearestPoint(const gfx::Point& point) const { | 53 Display ScreenBase::GetDisplayNearestPoint(const gfx::Point& point) const { |
| 49 return *FindDisplayNearestPoint(display_list_.displays(), point); | 54 return *FindDisplayNearestPoint(display_list_.displays(), point); |
| 50 } | 55 } |
| 51 | 56 |
| 52 int ScreenBase::GetNumDisplays() const { | 57 int ScreenBase::GetNumDisplays() const { |
| 53 return static_cast<int>(display_list_.displays().size()); | 58 return static_cast<int>(display_list_.displays().size()); |
| 54 } | 59 } |
| 55 | 60 |
| 56 const std::vector<Display>& ScreenBase::GetAllDisplays() const { | 61 const std::vector<Display>& ScreenBase::GetAllDisplays() const { |
| 57 return display_list_.displays(); | 62 return display_list_.displays(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 79 is_primary ? DisplayList::Type::PRIMARY | 84 is_primary ? DisplayList::Type::PRIMARY |
| 80 : DisplayList::Type::NOT_PRIMARY); | 85 : DisplayList::Type::NOT_PRIMARY); |
| 81 return; | 86 return; |
| 82 } | 87 } |
| 83 display_list_.UpdateDisplay( | 88 display_list_.UpdateDisplay( |
| 84 changed_display, | 89 changed_display, |
| 85 is_primary ? DisplayList::Type::PRIMARY : DisplayList::Type::NOT_PRIMARY); | 90 is_primary ? DisplayList::Type::PRIMARY : DisplayList::Type::NOT_PRIMARY); |
| 86 } | 91 } |
| 87 | 92 |
| 88 } // namespace display | 93 } // namespace display |
| OLD | NEW |