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

Side by Side Diff: components/mus/ws/window_tree_binding.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
« no previous file with comments | « components/mus/ws/window_tree.cc ('k') | components/mus/ws/window_tree_binding.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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_WS_WINDOW_TREE_BINDING_H_
6 #define COMPONENTS_MUS_WS_WINDOW_TREE_BINDING_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "components/mus/public/interfaces/window_tree.mojom.h"
12 #include "mojo/public/cpp/bindings/binding.h"
13
14 namespace mus {
15 namespace ws {
16
17 class WindowServer;
18 class WindowTree;
19
20 // WindowTreeBinding manages the binding between a WindowTree and its
21 // WindowTreeClient. WindowTreeBinding exists so that a mock implementation
22 // of WindowTreeClient can be injected for tests. WindowTree owns its
23 // associated WindowTreeBinding.
24 class WindowTreeBinding {
25 public:
26 explicit WindowTreeBinding(mojom::WindowTreeClient* client);
27 virtual ~WindowTreeBinding();
28
29 mojom::WindowTreeClient* client() { return client_; }
30
31 // Obtains a new WindowManager. This should only be called once.
32 virtual mojom::WindowManager* GetWindowManager() = 0;
33
34 virtual void SetIncomingMethodCallProcessingPaused(bool paused) = 0;
35
36 private:
37 mojom::WindowTreeClient* client_;
38
39 DISALLOW_COPY_AND_ASSIGN(WindowTreeBinding);
40 };
41
42 // Bindings implementation of WindowTreeBinding.
43 class DefaultWindowTreeBinding : public WindowTreeBinding {
44 public:
45 DefaultWindowTreeBinding(WindowTree* tree,
46 WindowServer* window_server,
47 mojom::WindowTreeRequest service_request,
48 mojom::WindowTreeClientPtr client);
49 DefaultWindowTreeBinding(WindowTree* tree,
50 mojom::WindowTreeClientPtr client);
51 ~DefaultWindowTreeBinding() override;
52
53 // Use when created with the constructor that does not take a
54 // WindowTreeRequest.
55 mojom::WindowTreePtr CreateInterfacePtrAndBind();
56
57 // WindowTreeBinding:
58 mojom::WindowManager* GetWindowManager() override;
59 void SetIncomingMethodCallProcessingPaused(bool paused) override;
60
61 private:
62 mojo::Binding<mojom::WindowTree> binding_;
63 mojom::WindowTreeClientPtr client_;
64 mojom::WindowManagerAssociatedPtr window_manager_internal_;
65
66 DISALLOW_COPY_AND_ASSIGN(DefaultWindowTreeBinding);
67 };
68
69 } // namespace ws
70 } // namespace mus
71
72 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_BINDING_H_
OLDNEW
« no previous file with comments | « components/mus/ws/window_tree.cc ('k') | components/mus/ws/window_tree_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698