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

Side by Side Diff: mash/wm/window_manager_application.h

Issue 1835403002: Support additional mash shelf alignments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. 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 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 MASH_WM_WINDOW_MANAGER_APPLICATION_H_ 5 #ifndef MASH_WM_WINDOW_MANAGER_APPLICATION_H_
6 #define MASH_WM_WINDOW_MANAGER_APPLICATION_H_ 6 #define MASH_WM_WINDOW_MANAGER_APPLICATION_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <set> 11 #include <set>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "components/mus/common/types.h" 15 #include "components/mus/common/types.h"
16 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h" 16 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h"
17 #include "components/mus/public/interfaces/window_manager.mojom.h" 17 #include "components/mus/public/interfaces/window_manager.mojom.h"
18 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" 18 #include "components/mus/public/interfaces/window_manager_factory.mojom.h"
19 #include "components/mus/public/interfaces/window_tree_host.mojom.h" 19 #include "components/mus/public/interfaces/window_tree_host.mojom.h"
20 #include "mash/session/public/interfaces/session.mojom.h" 20 #include "mash/session/public/interfaces/session.mojom.h"
21 #include "mash/wm/public/interfaces/shelf_layout.mojom.h"
21 #include "mash/wm/public/interfaces/user_window_controller.mojom.h" 22 #include "mash/wm/public/interfaces/user_window_controller.mojom.h"
22 #include "mojo/public/cpp/bindings/binding.h" 23 #include "mojo/public/cpp/bindings/binding.h"
23 #include "mojo/public/cpp/bindings/binding_set.h" 24 #include "mojo/public/cpp/bindings/binding_set.h"
24 #include "mojo/services/tracing/public/cpp/tracing_impl.h" 25 #include "mojo/services/tracing/public/cpp/tracing_impl.h"
25 #include "mojo/shell/public/cpp/shell_client.h" 26 #include "mojo/shell/public/cpp/shell_client.h"
26 27
27 namespace ui { 28 namespace ui {
28 namespace mojo { 29 namespace mojo {
29 class UIInit; 30 class UIInit;
30 } 31 }
(...skipping 11 matching lines...) Expand all
42 namespace wm { 43 namespace wm {
43 44
44 class AcceleratorRegistrarImpl; 45 class AcceleratorRegistrarImpl;
45 class RootWindowController; 46 class RootWindowController;
46 class RootWindowsObserver; 47 class RootWindowsObserver;
47 class UserWindowControllerImpl; 48 class UserWindowControllerImpl;
48 49
49 class WindowManagerApplication 50 class WindowManagerApplication
50 : public mojo::ShellClient, 51 : public mojo::ShellClient,
51 public mus::mojom::WindowManagerFactory, 52 public mus::mojom::WindowManagerFactory,
53 public mojo::InterfaceFactory<mash::wm::mojom::ShelfLayout>,
52 public mojo::InterfaceFactory<mash::wm::mojom::UserWindowController>, 54 public mojo::InterfaceFactory<mash::wm::mojom::UserWindowController>,
53 public mojo::InterfaceFactory<mus::mojom::AcceleratorRegistrar> { 55 public mojo::InterfaceFactory<mus::mojom::AcceleratorRegistrar> {
54 public: 56 public:
55 WindowManagerApplication(); 57 WindowManagerApplication();
56 ~WindowManagerApplication() override; 58 ~WindowManagerApplication() override;
57 59
58 mojo::Connector* connector() { return connector_; } 60 mojo::Connector* connector() { return connector_; }
59 61
60 // Returns the RootWindowControllers that have valid roots. 62 // Returns the RootWindowControllers that have valid roots.
61 // 63 //
(...skipping 22 matching lines...) Expand all
84 } 86 }
85 87
86 private: 88 private:
87 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); 89 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar);
88 90
89 // mojo::ShellClient: 91 // mojo::ShellClient:
90 void Initialize(mojo::Connector* connector, const mojo::Identity& identity, 92 void Initialize(mojo::Connector* connector, const mojo::Identity& identity,
91 uint32_t id) override; 93 uint32_t id) override;
92 bool AcceptConnection(mojo::Connection* connection) override; 94 bool AcceptConnection(mojo::Connection* connection) override;
93 95
96 // InterfaceFactory<mash::wm::mojom::ShelfLayout>:
97 void Create(
98 mojo::Connection* connection,
99 mojo::InterfaceRequest<mash::wm::mojom::ShelfLayout> request) override;
100
94 // InterfaceFactory<mash::wm::mojom::UserWindowController>: 101 // InterfaceFactory<mash::wm::mojom::UserWindowController>:
95 void Create(mojo::Connection* connection, 102 void Create(mojo::Connection* connection,
96 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> 103 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>
97 request) override; 104 request) override;
98 105
99 // InterfaceFactory<mus::mojom::AcceleratorRegistrar>: 106 // InterfaceFactory<mus::mojom::AcceleratorRegistrar>:
100 void Create(mojo::Connection* connection, 107 void Create(mojo::Connection* connection,
101 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) 108 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request)
102 override; 109 override;
103 110
104 // mus::mojom::WindowManagerFactory: 111 // mus::mojom::WindowManagerFactory:
105 void CreateWindowManager(mus::mojom::DisplayPtr display, 112 void CreateWindowManager(mus::mojom::DisplayPtr display,
106 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> 113 mojo::InterfaceRequest<mus::mojom::WindowTreeClient>
107 client_request) override; 114 client_request) override;
108 115
109 mojo::Connector* connector_; 116 mojo::Connector* connector_;
110 117
111 mojo::TracingImpl tracing_; 118 mojo::TracingImpl tracing_;
112 119
113 std::unique_ptr<ui::mojo::UIInit> ui_init_; 120 std::unique_ptr<ui::mojo::UIInit> ui_init_;
114 std::unique_ptr<views::AuraInit> aura_init_; 121 std::unique_ptr<views::AuraInit> aura_init_;
115 122
123 // The ShelfLayout object is created once OnEmbed() is called. Until that
msw 2016/04/12 00:33:17 Also, it's unclear that we actually encounter this
sky 2016/04/13 23:44:11 What guarantees that? By that I mean how do you kn
msw 2016/04/15 17:25:06 I guess nothing guarantees that, it just seems odd
sky 2016/04/15 19:33:23 It shouldn't be hard to get this scenario in a tes
124 // time |shelf_layout_requests_| stores pending interface requests.
125 mojo::BindingSet<mash::wm::mojom::ShelfLayout> shelf_layout_bindings_;
126 std::vector<
127 std::unique_ptr<mojo::InterfaceRequest<mash::wm::mojom::ShelfLayout>>>
128 shelf_layout_requests_;
129
116 // |user_window_controller_| is created once OnEmbed() is called. Until that 130 // |user_window_controller_| is created once OnEmbed() is called. Until that
117 // time |user_window_controller_requests_| stores pending interface requests. 131 // time |user_window_controller_requests_| stores pending interface requests.
118 std::unique_ptr<UserWindowControllerImpl> user_window_controller_; 132 std::unique_ptr<UserWindowControllerImpl> user_window_controller_;
119 mojo::BindingSet<mash::wm::mojom::UserWindowController> 133 mojo::BindingSet<mash::wm::mojom::UserWindowController>
120 user_window_controller_binding_; 134 user_window_controller_bindings_;
121 std::vector<std::unique_ptr< 135 std::vector<std::unique_ptr<
122 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>>> 136 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>>>
123 user_window_controller_requests_; 137 user_window_controller_requests_;
124 138
125 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; 139 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_;
126 std::set<RootWindowController*> root_controllers_; 140 std::set<RootWindowController*> root_controllers_;
127 141
128 mojo::Binding<mus::mojom::WindowManagerFactory> 142 mojo::Binding<mus::mojom::WindowManagerFactory>
129 window_manager_factory_binding_; 143 window_manager_factory_binding_;
130 144
131 mash::session::mojom::SessionPtr session_; 145 mash::session::mojom::SessionPtr session_;
132 146
133 base::ObserverList<RootWindowsObserver> root_windows_observers_; 147 base::ObserverList<RootWindowsObserver> root_windows_observers_;
134 148
135 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); 149 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication);
136 }; 150 };
137 151
138 } // namespace wm 152 } // namespace wm
139 } // namespace mash 153 } // namespace mash
140 154
141 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_ 155 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698