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

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

Issue 2468093003: Makes Screen functions take a const gfx::NativeView (Closed)
Patch Set: merge 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/test/test_screen.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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « ui/display/screen_base.h ('k') | ui/display/test/test_screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698