| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |