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

Side by Side Diff: ui/aura/test/test_screen.cc

Issue 2361283002: Add GetDisplayWithDisplayId to display::Screen. (Closed)
Patch Set: test 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/aura/test/test_screen.h" 5 #include "ui/aura/test/test_screen.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 int TestScreen::GetNumDisplays() const { 143 int TestScreen::GetNumDisplays() const {
144 return 1; 144 return 1;
145 } 145 }
146 146
147 std::vector<display::Display> TestScreen::GetAllDisplays() const { 147 std::vector<display::Display> TestScreen::GetAllDisplays() const {
148 return std::vector<display::Display>(1, display_); 148 return std::vector<display::Display>(1, display_);
149 } 149 }
150 150
151 bool TestScreen::GetDisplayWithDisplayId(int64_t display_id,
152 display::Display* display) const {
153 if (display_.id() == display_id) {
154 *display = display_;
155 return true;
156 }
157 return false;
158 }
159
151 display::Display TestScreen::GetDisplayNearestWindow( 160 display::Display TestScreen::GetDisplayNearestWindow(
152 gfx::NativeWindow window) const { 161 gfx::NativeWindow window) const {
153 return display_; 162 return display_;
154 } 163 }
155 164
156 display::Display TestScreen::GetDisplayNearestPoint( 165 display::Display TestScreen::GetDisplayNearestPoint(
157 const gfx::Point& point) const { 166 const gfx::Point& point) const {
158 return display_; 167 return display_;
159 } 168 }
160 169
161 display::Display TestScreen::GetDisplayMatching( 170 display::Display TestScreen::GetDisplayMatching(
162 const gfx::Rect& match_rect) const { 171 const gfx::Rect& match_rect) const {
163 return display_; 172 return display_;
164 } 173 }
165 174
166 void TestScreen::AddObserver(display::DisplayObserver* observer) {} 175 void TestScreen::AddObserver(display::DisplayObserver* observer) {}
167 176
168 void TestScreen::RemoveObserver(display::DisplayObserver* observer) {} 177 void TestScreen::RemoveObserver(display::DisplayObserver* observer) {}
169 178
170 TestScreen::TestScreen(const gfx::Rect& screen_bounds) 179 TestScreen::TestScreen(const gfx::Rect& screen_bounds)
171 : host_(NULL), 180 : host_(NULL),
172 ui_scale_(1.0f) { 181 ui_scale_(1.0f) {
173 static int64_t synthesized_display_id = 2000; 182 static int64_t synthesized_display_id = 2000;
174 display_.set_id(synthesized_display_id++); 183 display_.set_id(synthesized_display_id++);
175 display_.SetScaleAndBounds(1.0f, screen_bounds); 184 display_.SetScaleAndBounds(1.0f, screen_bounds);
176 } 185 }
177 186
178 } // namespace aura 187 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698