OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
boliu
2016/10/26 17:24:20
remove (c)
Tima Vaisburd
2016/10/27 07:55:58
Gone while moving/renaming
| |
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 #ifndef UI_DISPLAY_TEST_TEST_SCREEN_H_ | 5 #include <map> |
6 #define UI_DISPLAY_TEST_TEST_SCREEN_H_ | |
7 | 6 |
8 #include <vector> | |
9 | |
10 #include "base/macros.h" | |
11 #include "ui/display/display.h" | 7 #include "ui/display/display.h" |
8 #include "ui/display/display_export.h" | |
12 #include "ui/display/screen.h" | 9 #include "ui/display/screen.h" |
13 | 10 |
14 namespace display { | 11 namespace display { |
15 namespace test { | |
16 | 12 |
17 // A dummy implementation of display::Screen that contains a single | 13 class DISPLAY_EXPORT ScreenAndroid : public Screen { |
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: | 14 public: |
25 TestScreen(); | 15 ScreenAndroid(); |
26 ~TestScreen() override; | 16 ~ScreenAndroid(); |
27 | 17 |
28 Display* display() { return &display_; } | 18 // Disallow copy and assign. |
19 ScreenAndroid(const ScreenAndroid& rhs) = delete; | |
20 ScreenAndroid& operator=(const ScreenAndroid& rhs) = delete; | |
29 | 21 |
30 // display::Screen: | 22 // Screen interface. |
31 gfx::Point GetCursorScreenPoint() override; | 23 gfx::Point GetCursorScreenPoint() override; |
32 bool IsWindowUnderCursor(gfx::NativeWindow window) override; | 24 bool IsWindowUnderCursor(gfx::NativeWindow window) override; |
33 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; | 25 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; |
26 | |
34 int GetNumDisplays() const override; | 27 int GetNumDisplays() const override; |
35 std::vector<Display> GetAllDisplays() const override; | 28 std::vector<Display> GetAllDisplays() const override; |
36 Display GetDisplayNearestWindow(gfx::NativeView view) const override; | 29 Display GetDisplayNearestWindow(gfx::NativeView view) const override; |
37 Display GetDisplayNearestPoint(const gfx::Point& point) const override; | 30 Display GetDisplayNearestPoint(const gfx::Point& point) const override; |
38 Display GetDisplayMatching(const gfx::Rect& match_rect) const override; | 31 Display GetDisplayMatching(const gfx::Rect& match_rect) const override; |
39 Display GetPrimaryDisplay() const override; | 32 Display GetPrimaryDisplay() const override; |
33 | |
40 void AddObserver(DisplayObserver* observer) override; | 34 void AddObserver(DisplayObserver* observer) override; |
41 void RemoveObserver(DisplayObserver* observer) override; | 35 void RemoveObserver(DisplayObserver* observer) override; |
42 | 36 |
37 // Called from Java side. | |
38 void UpdateDisplay(int display_id, const Display& display); | |
39 void RemoveDisplay(int display_id); | |
40 | |
43 private: | 41 private: |
44 // The only display. | 42 std::map<int, Display> displays_; |
mthiesse
2016/10/26 14:49:49
It looks like other platforms (like ash) keep thei
boliu
2016/10/26 17:24:20
The point here is we don't want to expose ScreenAn
Tima Vaisburd
2016/10/27 07:55:58
Renamed screen_android.cc into display_android_man
| |
45 Display display_; | |
46 | |
47 DISALLOW_COPY_AND_ASSIGN(TestScreen); | |
48 }; | 43 }; |
49 | 44 |
50 } // namespace test | |
51 } // namespace display | 45 } // namespace display |
52 | |
53 #endif // UI_DISPLAY_TEST_TEST_SCREEN_H_ | |
OLD | NEW |