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

Side by Side Diff: components/mus/public/cpp/window_tree_connection.h

Issue 1882423004: Move shell service to toplevel shell namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_
6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ 6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "components/mus/common/types.h" 14 #include "components/mus/common/types.h"
15 #include "components/mus/public/interfaces/window_tree.mojom.h" 15 #include "components/mus/public/interfaces/window_tree.mojom.h"
16 #include "mojo/public/cpp/bindings/interface_request.h" 16 #include "mojo/public/cpp/bindings/interface_request.h"
17 17
18 namespace mojo { 18 namespace shell {
19 class Connector; 19 class Connector;
20 } 20 }
21 21
22 namespace mus { 22 namespace mus {
23 23
24 class Window; 24 class Window;
25 class WindowManagerDelegate; 25 class WindowManagerDelegate;
26 class WindowTreeConnectionObserver; 26 class WindowTreeConnectionObserver;
27 class WindowTreeDelegate; 27 class WindowTreeDelegate;
28 28
29 // Encapsulates a connection to a window tree. A unique connection is made 29 // Encapsulates a connection to a window tree. A unique connection is made
30 // every time an app is embedded. 30 // every time an app is embedded.
31 class WindowTreeConnection { 31 class WindowTreeConnection {
32 public: 32 public:
33 enum class CreateType { 33 enum class CreateType {
34 // Indicates Create() should wait for OnEmbed(). If true, the 34 // Indicates Create() should wait for OnEmbed(). If true, the
35 // WindowTreeConnection returned from Create() will have its root, otherwise 35 // WindowTreeConnection returned from Create() will have its root, otherwise
36 // the WindowTreeConnection will get the root at a later time. 36 // the WindowTreeConnection will get the root at a later time.
37 WAIT_FOR_EMBED, 37 WAIT_FOR_EMBED,
38 DONT_WAIT_FOR_EMBED 38 DONT_WAIT_FOR_EMBED
39 }; 39 };
40 40
41 virtual ~WindowTreeConnection() {} 41 virtual ~WindowTreeConnection() {}
42 42
43 // Creates a WindowTreeConnection with no roots. Use this to establish a 43 // Creates a WindowTreeConnection with no roots. Use this to establish a
44 // connection directly to mus and create top level windows. 44 // connection directly to mus and create top level windows.
45 static WindowTreeConnection* Create(WindowTreeDelegate* delegate, 45 static WindowTreeConnection* Create(WindowTreeDelegate* delegate,
46 mojo::Connector* connector); 46 shell::Connector* connector);
47 47
48 // Creates a WindowTreeConnection to service the specified request for 48 // Creates a WindowTreeConnection to service the specified request for
49 // a WindowTreeClient. Use this to be embedded in another app. 49 // a WindowTreeClient. Use this to be embedded in another app.
50 static WindowTreeConnection* Create( 50 static WindowTreeConnection* Create(
51 WindowTreeDelegate* delegate, 51 WindowTreeDelegate* delegate,
52 mojo::InterfaceRequest<mojom::WindowTreeClient> request, 52 mojo::InterfaceRequest<mojom::WindowTreeClient> request,
53 CreateType create_type); 53 CreateType create_type);
54 54
55 // Create a WindowTreeConnection that is going to serve as the WindowManager. 55 // Create a WindowTreeConnection that is going to serve as the WindowManager.
56 static WindowTreeConnection* CreateForWindowManager( 56 static WindowTreeConnection* CreateForWindowManager(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // TODO(sky): remove this. It is not necessarily correct anymore. 89 // TODO(sky): remove this. It is not necessarily correct anymore.
90 virtual ConnectionSpecificId GetConnectionId() = 0; 90 virtual ConnectionSpecificId GetConnectionId() = 0;
91 91
92 virtual void AddObserver(WindowTreeConnectionObserver* observer) = 0; 92 virtual void AddObserver(WindowTreeConnectionObserver* observer) = 0;
93 virtual void RemoveObserver(WindowTreeConnectionObserver* observer) = 0; 93 virtual void RemoveObserver(WindowTreeConnectionObserver* observer) = 0;
94 }; 94 };
95 95
96 } // namespace mus 96 } // namespace mus
97 97
98 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ 98 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_
OLDNEW
« no previous file with comments | « components/mus/public/cpp/tests/window_server_test_base.cc ('k') | components/mus/public/cpp/window_tree_host_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698