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

Side by Side Diff: components/mus/example/wm/window_manager_application.h

Issue 1423133003: Routes calls to WM through WS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no braces Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 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 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_EXAMPLE_WM_WINDOW_MANAGER_APPLICATION_H_ 5 #ifndef COMPONENTS_MUS_EXAMPLE_WM_WINDOW_MANAGER_APPLICATION_H_
6 #define COMPONENTS_MUS_EXAMPLE_WM_WINDOW_MANAGER_APPLICATION_H_ 6 #define COMPONENTS_MUS_EXAMPLE_WM_WINDOW_MANAGER_APPLICATION_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
11 #include "components/mus/public/cpp/types.h" 11 #include "components/mus/public/cpp/types.h"
12 #include "components/mus/public/cpp/window_tree_delegate.h" 12 #include "components/mus/public/cpp/window_tree_delegate.h"
13 #include "components/mus/public/interfaces/window_manager.mojom.h" 13 #include "components/mus/public/interfaces/window_manager.mojom.h"
14 #include "components/mus/public/interfaces/window_tree_host.mojom.h" 14 #include "components/mus/public/interfaces/window_tree_host.mojom.h"
15 #include "mojo/application/public/cpp/application_delegate.h" 15 #include "mojo/application/public/cpp/application_delegate.h"
16 #include "mojo/application/public/cpp/interface_factory_impl.h" 16 #include "mojo/application/public/cpp/interface_factory_impl.h"
17 #include "mojo/common/weak_binding_set.h"
17 18
18 enum class Container; 19 enum class Container;
19 class WindowLayout; 20 class WindowLayout;
20 21
22 class WindowManagerImpl;
23
21 class WindowManagerApplication 24 class WindowManagerApplication
22 : public mojo::ApplicationDelegate, 25 : public mojo::ApplicationDelegate,
23 public mus::WindowTreeDelegate, 26 public mus::WindowTreeDelegate,
24 public mojo::InterfaceFactory<mus::mojom::WindowManager> { 27 public mojo::InterfaceFactory<mus::mojom::WindowManager> {
25 public: 28 public:
26 WindowManagerApplication(); 29 WindowManagerApplication();
27 ~WindowManagerApplication() override; 30 ~WindowManagerApplication() override;
28 31
29 mus::Window* root() { return root_; } 32 mus::Window* root() { return root_; }
30 33
(...skipping 19 matching lines...) Expand all
50 mojo::InterfaceRequest<mus::mojom::WindowManager> request) override; 53 mojo::InterfaceRequest<mus::mojom::WindowManager> request) override;
51 54
52 // Sets up the window containers used for z-space management. 55 // Sets up the window containers used for z-space management.
53 void CreateContainers(); 56 void CreateContainers();
54 57
55 // nullptr until the Mus connection is established via OnEmbed(). 58 // nullptr until the Mus connection is established via OnEmbed().
56 mus::Window* root_; 59 mus::Window* root_;
57 int window_count_; 60 int window_count_;
58 61
59 mus::mojom::WindowTreeHostPtr host_; 62 mus::mojom::WindowTreeHostPtr host_;
63
64 // |window_manager_| is created once OnEmbed() is called. Until that time
65 // |requests_| stores any pending WindowManager interface requests.
66 scoped_ptr<WindowManagerImpl> window_manager_;
67 mojo::WeakBindingSet<mus::mojom::WindowManager> window_manager_binding_;
60 ScopedVector<mojo::InterfaceRequest<mus::mojom::WindowManager>> requests_; 68 ScopedVector<mojo::InterfaceRequest<mus::mojom::WindowManager>> requests_;
61 69
62 scoped_ptr<WindowLayout> layout_; 70 scoped_ptr<WindowLayout> layout_;
63 71
64 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); 72 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication);
65 }; 73 };
66 74
67 #endif // COMPONENTS_MUS_EXAMPLE_WM_WINDOW_MANAGER_APPLICATION_H_ 75 #endif // COMPONENTS_MUS_EXAMPLE_WM_WINDOW_MANAGER_APPLICATION_H_
OLDNEW
« no previous file with comments | « components/mus/example/wm/BUILD.gn ('k') | components/mus/example/wm/window_manager_application.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698