Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_DISPLAY_TEST_TEST_SCREEN_H_ | |
| 6 #define UI_DISPLAY_TEST_TEST_SCREEN_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "ui/display/display.h" | |
| 12 #include "ui/display/screen.h" | |
| 13 | |
| 14 namespace display { | |
| 15 namespace test { | |
| 16 | |
| 17 // A dummy implementation of displayScreen that contains a single | |
|
Daniel Erat
2016/05/06 17:40:07
nit: s/displayScreen/Screen/ or display::Screen
oshima
2016/05/06 18:21:47
Done.
| |
| 18 // display::Display only. The contained Display can be accessed and modified via | |
| 19 // TestScreen::display(). | |
| 20 // | |
| 21 // NOTE: Adding and removing display::DisplayOberver's are no-ops and observers | |
| 22 // will NOT be notified ever. | |
| 23 class TestScreen : public Screen { | |
| 24 public: | |
| 25 TestScreen(); | |
| 26 ~TestScreen() override; | |
| 27 | |
| 28 Display* display() { return &display_; } | |
| 29 | |
| 30 // Screen: | |
| 31 gfx::Point GetCursorScreenPoint() override; | |
| 32 bool IsWindowUnderCursor(gfx::NativeWindow window) override; | |
| 33 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; | |
| 34 int GetNumDisplays() const override; | |
| 35 std::vector<Display> GetAllDisplays() const override; | |
| 36 Display GetDisplayNearestWindow(gfx::NativeView view) const override; | |
| 37 Display GetDisplayNearestPoint(const gfx::Point& point) const override; | |
| 38 Display GetDisplayMatching(const gfx::Rect& match_rect) const override; | |
| 39 Display GetPrimaryDisplay() const override; | |
| 40 void AddObserver(DisplayObserver* observer) override; | |
| 41 void RemoveObserver(DisplayObserver* observer) override; | |
| 42 | |
| 43 private: | |
| 44 // The only display. | |
| 45 Display display_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(TestScreen); | |
| 48 }; | |
| 49 | |
| 50 } // namespace test | |
| 51 } // namespace display | |
| 52 | |
| 53 #endif // UI_DISPLAY_TEST_TEST_SCREEN_H_ | |
| OLD | NEW |