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

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

Issue 2751833004: Reland "Add display::GetDisplayNearestView" (Closed)
Patch Set: Created 3 years, 9 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
« 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 20 matching lines...) Expand all
31 return nullptr; 31 return nullptr;
32 } 32 }
33 33
34 Display ScreenBase::GetPrimaryDisplay() const { 34 Display ScreenBase::GetPrimaryDisplay() const {
35 auto iter = display_list_.GetPrimaryDisplayIterator(); 35 auto iter = display_list_.GetPrimaryDisplayIterator();
36 if (iter == display_list_.displays().end()) 36 if (iter == display_list_.displays().end())
37 return Display(); // Invalid display since we have no primary display. 37 return Display(); // Invalid display since we have no primary display.
38 return *iter; 38 return *iter;
39 } 39 }
40 40
41 Display ScreenBase::GetDisplayNearestWindow(gfx::NativeView view) const { 41 Display ScreenBase::GetDisplayNearestWindow(gfx::NativeWindow window) 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::GetDisplayNearestPoint(const gfx::Point& point) const { 48 Display ScreenBase::GetDisplayNearestPoint(const gfx::Point& point) const {
49 return *FindDisplayNearestPoint(display_list_.displays(), point); 49 return *FindDisplayNearestPoint(display_list_.displays(), point);
50 } 50 }
51 51
(...skipping 30 matching lines...) Expand all
82 is_primary ? DisplayList::Type::PRIMARY 82 is_primary ? DisplayList::Type::PRIMARY
83 : DisplayList::Type::NOT_PRIMARY); 83 : DisplayList::Type::NOT_PRIMARY);
84 return; 84 return;
85 } 85 }
86 display_list_.UpdateDisplay( 86 display_list_.UpdateDisplay(
87 changed_display, 87 changed_display,
88 is_primary ? DisplayList::Type::PRIMARY : DisplayList::Type::NOT_PRIMARY); 88 is_primary ? DisplayList::Type::PRIMARY : DisplayList::Type::NOT_PRIMARY);
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