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

Side by Side Diff: ash/mus/test/wm_test_screen.h

Issue 2314203002: Move DisplayList to display; add ScreenBase. (Closed)
Patch Set: Update unit test namespace. Created 4 years, 3 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 | « ash/mus/test/wm_test_helper.cc ('k') | ash/mus/test/wm_test_screen.cc » ('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 #ifndef ASH_MUS_TEST_WM_TEST_SCREEN_H_ 5 #ifndef ASH_MUS_TEST_WM_TEST_SCREEN_H_
6 #define ASH_MUS_TEST_WM_TEST_SCREEN_H_ 6 #define ASH_MUS_TEST_WM_TEST_SCREEN_H_
7 7
8 #include "ui/display/screen.h" 8 #include "ui/display/screen_base.h"
9 #include "ui/views/mus/display_list.h"
10 9
11 namespace ash { 10 namespace ash {
12 namespace mus { 11 namespace mus {
13 12
14 // Screen implementation used by tests for the windowmanager. Does not talk 13 // Screen implementation used by tests for the windowmanager. Does not talk
15 // to mus. Tests must keep the list of Displays in sync manually. 14 // to mus. Tests must keep the list of Displays in sync manually.
16 class WmTestScreen : public display::Screen { 15 class WmTestScreen : public display::ScreenBase {
17 public: 16 public:
18 WmTestScreen(); 17 WmTestScreen();
19 ~WmTestScreen() override; 18 ~WmTestScreen() override;
20 19
21 const views::DisplayList& display_list() const { return display_list_; }
22 views::DisplayList* display_list() { return &display_list_; }
23
24 private: 20 private:
25 // display::Screen: 21 // display::ScreenBase:
26 gfx::Point GetCursorScreenPoint() override; 22 gfx::Point GetCursorScreenPoint() override;
27 bool IsWindowUnderCursor(gfx::NativeWindow window) override; 23 bool IsWindowUnderCursor(gfx::NativeWindow window) override;
28 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
29 display::Display GetPrimaryDisplay() const override;
30 display::Display GetDisplayNearestWindow(gfx::NativeView view) const override;
31 display::Display GetDisplayNearestPoint(
32 const gfx::Point& point) const override;
33 int GetNumDisplays() const override;
34 std::vector<display::Display> GetAllDisplays() const override;
35 display::Display GetDisplayMatching(
36 const gfx::Rect& match_rect) const override;
37 void AddObserver(display::DisplayObserver* observer) override;
38 void RemoveObserver(display::DisplayObserver* observer) override;
39
40 views::DisplayList display_list_;
41 24
42 DISALLOW_COPY_AND_ASSIGN(WmTestScreen); 25 DISALLOW_COPY_AND_ASSIGN(WmTestScreen);
43 }; 26 };
44 27
45 } // namespace mus 28 } // namespace mus
46 } // namespace ash 29 } // namespace ash
47 30
48 #endif // ASH_MUS_TEST_WM_TEST_SCREEN_H_ 31 #endif // ASH_MUS_TEST_WM_TEST_SCREEN_H_
OLDNEW
« no previous file with comments | « ash/mus/test/wm_test_helper.cc ('k') | ash/mus/test/wm_test_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698