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

Side by Side Diff: components/mus/public/cpp/tests/test_window_tree.h

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
(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 COMPONENTS_MUS_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_H_
6 #define COMPONENTS_MUS_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_H_
7
8 #include <stdint.h>
9
10 #include <set>
11
12 #include "base/macros.h"
13 #include "components/mus/public/interfaces/window_tree.mojom.h"
14
15 namespace mus {
16
17 // Testing WindowTree implementation.
18 class TestWindowTree : public mojom::WindowTree {
19 public:
20 TestWindowTree();
21 ~TestWindowTree() override;
22
23 // Returns the most recent change_id supplied to one of the WindowTree
24 // functions. Returns false if one of the WindowTree functions has not been
25 // invoked since the last GetAndClearChangeId().
26 bool GetAndClearChangeId(uint32_t* change_id);
27
28 uint32_t window_id() const { return window_id_; }
29
30 bool WasEventAcked(uint32_t event_id) const;
31
32 private:
33 // mojom::WindowTree:
34 void NewWindow(
35 uint32_t change_id,
36 uint32_t window_id,
37 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) override;
38 void NewTopLevelWindow(
39 uint32_t change_id,
40 uint32_t window_id,
41 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) override;
42 void DeleteWindow(uint32_t change_id, uint32_t window_id) override;
43 void SetWindowBounds(uint32_t change_id,
44 uint32_t window_id,
45 const gfx::Rect& bounds) override;
46 void SetClientArea(uint32_t window_id,
47 const gfx::Insets& insets,
48 mojo::Array<gfx::Rect> additional_client_areas) override;
49 void SetHitTestMask(uint32_t window_id, const gfx::Rect& mask) override;
50 void SetWindowVisibility(uint32_t change_id,
51 uint32_t window_id,
52 bool visible) override;
53 void SetWindowProperty(uint32_t change_id,
54 uint32_t window_id,
55 const mojo::String& name,
56 mojo::Array<uint8_t> value) override;
57 void SetWindowOpacity(uint32_t change_id,
58 uint32_t window_id,
59 float opacity) override;
60 void AttachSurface(uint32_t window_id,
61 mojom::SurfaceType type,
62 mojo::InterfaceRequest<mojom::Surface> surface,
63 mojom::SurfaceClientPtr client) override;
64 void AddWindow(uint32_t change_id, uint32_t parent, uint32_t child) override;
65 void RemoveWindowFromParent(uint32_t change_id, uint32_t window_id) override;
66 void AddTransientWindow(uint32_t change_id,
67 uint32_t window_id,
68 uint32_t transient_window_id) override;
69 void RemoveTransientWindowFromParent(uint32_t change_id,
70 uint32_t window_id) override;
71 void SetModal(uint32_t change_id, uint32_t window_id) override;
72 void ReorderWindow(uint32_t change_id,
73 uint32_t window_id,
74 uint32_t relative_window_id,
75 mojom::OrderDirection direction) override;
76 void GetWindowTree(uint32_t window_id,
77 const GetWindowTreeCallback& callback) override;
78 void SetCapture(uint32_t change_id, uint32_t window_id) override;
79 void ReleaseCapture(uint32_t change_id, uint32_t window_id) override;
80 void SetEventObserver(mojom::EventMatcherPtr matcher,
81 uint32_t observer_id) override;
82 void Embed(uint32_t window_id,
83 mojom::WindowTreeClientPtr client,
84 uint32_t flags,
85 const EmbedCallback& callback) override;
86 void SetFocus(uint32_t change_id, uint32_t window_id) override;
87 void SetCanFocus(uint32_t window_id, bool can_focus) override;
88 void SetPredefinedCursor(uint32_t change_id,
89 uint32_t window_id,
90 mus::mojom::Cursor cursor_id) override;
91 void SetWindowTextInputState(uint32_t window_id,
92 mojo::TextInputStatePtr state) override;
93 void SetImeVisibility(uint32_t window_id,
94 bool visible,
95 mojo::TextInputStatePtr state) override;
96 void OnWindowInputEventAck(uint32_t event_id,
97 mus::mojom::EventResult result) override;
98 void GetWindowManagerClient(
99 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal)
100 override;
101 void GetCursorLocationMemory(const GetCursorLocationMemoryCallback& callback)
102 override;
103
104 bool got_change_;
105 uint32_t change_id_;
106 std::set<uint32_t> acked_events_;
107 uint32_t window_id_;
108
109 DISALLOW_COPY_AND_ASSIGN(TestWindowTree);
110 };
111
112 } // namespace mus
113
114 #endif // COMPONENTS_MUS_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_H_
OLDNEW
« no previous file with comments | « components/mus/public/cpp/tests/test_window.h ('k') | components/mus/public/cpp/tests/test_window_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698