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

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

Issue 2361283002: Add GetDisplayWithDisplayId to display::Screen. (Closed)
Patch Set: id Created 4 years, 2 months 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 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 gfx::NativeWindow ScreenBase::GetWindowAtScreenPoint(const gfx::Point& point) { 48 gfx::NativeWindow ScreenBase::GetWindowAtScreenPoint(const gfx::Point& point) {
49 NOTIMPLEMENTED(); 49 NOTIMPLEMENTED();
50 return nullptr; 50 return nullptr;
51 } 51 }
52 52
53 display::Display ScreenBase::GetPrimaryDisplay() const { 53 display::Display ScreenBase::GetPrimaryDisplay() const {
54 return *display_list_.GetPrimaryDisplayIterator(); 54 return *display_list_.GetPrimaryDisplayIterator();
55 } 55 }
56 56
57 bool ScreenBase::GetDisplayWithDisplayId(int64_t display_id,
58 display::Display* display) const {
59 for (const display::Display& display_in_list : display_list_.displays()) {
sadrul 2016/10/06 15:23:18 Use DisplayList::FindDisplayById() here instead, s
riajiang 2016/10/06 18:26:31 Done. Sorry, forgot this change about DisplayList
60 if (display_in_list.id() == display_id) {
61 *display = display_in_list;
62 return true;
63 }
64 }
65 return false;
66 }
67
57 display::Display ScreenBase::GetDisplayNearestWindow( 68 display::Display ScreenBase::GetDisplayNearestWindow(
58 gfx::NativeView view) const { 69 gfx::NativeView view) const {
59 NOTIMPLEMENTED(); 70 NOTIMPLEMENTED();
60 return *display_list_.GetPrimaryDisplayIterator(); 71 return *display_list_.GetPrimaryDisplayIterator();
61 } 72 }
62 73
63 display::Display ScreenBase::GetDisplayNearestPoint( 74 display::Display ScreenBase::GetDisplayNearestPoint(
64 const gfx::Point& point) const { 75 const gfx::Point& point) const {
65 return *display::FindDisplayNearestPoint(display_list_.displays(), point); 76 return *display::FindDisplayNearestPoint(display_list_.displays(), point);
66 } 77 }
(...skipping 15 matching lines...) Expand all
82 93
83 void ScreenBase::AddObserver(display::DisplayObserver* observer) { 94 void ScreenBase::AddObserver(display::DisplayObserver* observer) {
84 display_list_.AddObserver(observer); 95 display_list_.AddObserver(observer);
85 } 96 }
86 97
87 void ScreenBase::RemoveObserver(display::DisplayObserver* observer) { 98 void ScreenBase::RemoveObserver(display::DisplayObserver* observer) {
88 display_list_.RemoveObserver(observer); 99 display_list_.RemoveObserver(observer);
89 } 100 }
90 101
91 } // namespace display 102 } // namespace display
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698