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

Side by Side Diff: ui/display/test/test_screen.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include <vector> 5 #include <vector>
6 6
7 #include "ui/display/test/test_screen.h" 7 #include "ui/display/test/test_screen.h"
8 8
9 namespace display { 9 namespace display {
10 namespace test { 10 namespace test {
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 29
30 int TestScreen::GetNumDisplays() const { 30 int TestScreen::GetNumDisplays() const {
31 return 1; 31 return 1;
32 } 32 }
33 33
34 std::vector<Display> TestScreen::GetAllDisplays() const { 34 std::vector<Display> TestScreen::GetAllDisplays() const {
35 return std::vector<Display>(1, display_); 35 return std::vector<Display>(1, display_);
36 } 36 }
37 37
38 bool TestScreen::GetDisplayWithDisplayId(int64_t display_id,
39 display::Display* display) const {
40 if (display_.id() == display_id) {
41 *display = display_;
42 return true;
43 }
44 return false;
45 }
46
38 Display TestScreen::GetDisplayNearestWindow(gfx::NativeView view) const { 47 Display TestScreen::GetDisplayNearestWindow(gfx::NativeView view) const {
39 return display_; 48 return display_;
40 } 49 }
41 50
42 Display TestScreen::GetDisplayNearestPoint(const gfx::Point& point) const { 51 Display TestScreen::GetDisplayNearestPoint(const gfx::Point& point) const {
43 return display_; 52 return display_;
44 } 53 }
45 54
46 Display TestScreen::GetDisplayMatching(const gfx::Rect& match_rect) const { 55 Display TestScreen::GetDisplayMatching(const gfx::Rect& match_rect) const {
47 return display_; 56 return display_;
48 } 57 }
49 58
50 Display TestScreen::GetPrimaryDisplay() const { 59 Display TestScreen::GetPrimaryDisplay() const {
51 return display_; 60 return display_;
52 } 61 }
53 62
54 void TestScreen::AddObserver(DisplayObserver* observer) { 63 void TestScreen::AddObserver(DisplayObserver* observer) {
55 } 64 }
56 65
57 void TestScreen::RemoveObserver(DisplayObserver* observer) { 66 void TestScreen::RemoveObserver(DisplayObserver* observer) {
58 } 67 }
59 68
60 } // namespace test 69 } // namespace test
61 } // namespace display 70 } // namespace display
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698