OLD | NEW |
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 MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ | 5 #ifndef MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ |
6 #define MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ | 6 #define MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "mojo/aura/window_tree_host_mojo_delegate.h" | 11 #include "mojo/aura/window_tree_host_mojo_delegate.h" |
12 #include "mojo/public/cpp/application/application_delegate.h" | 12 #include "mojo/public/cpp/application/application_delegate.h" |
| 13 #include "mojo/public/cpp/application/interface_factory_with_context.h" |
13 #include "mojo/public/cpp/bindings/string.h" | 14 #include "mojo/public/cpp/bindings/string.h" |
14 #include "mojo/services/public/cpp/view_manager/node_observer.h" | 15 #include "mojo/services/public/cpp/view_manager/node_observer.h" |
15 #include "mojo/services/public/cpp/view_manager/types.h" | 16 #include "mojo/services/public/cpp/view_manager/types.h" |
| 17 #include "mojo/services/public/cpp/view_manager/view_manager_client_factory.h" |
16 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" | 18 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" |
| 19 #include "mojo/services/window_manager/window_manager_service_impl.h" |
17 #include "ui/aura/client/focus_change_observer.h" | 20 #include "ui/aura/client/focus_change_observer.h" |
18 #include "ui/wm/public/activation_change_observer.h" | 21 #include "ui/wm/public/activation_change_observer.h" |
19 | 22 |
20 namespace aura { | 23 namespace aura { |
21 namespace client { | 24 namespace client { |
22 class ActivationClient; | 25 class ActivationClient; |
23 class FocusClient; | 26 class FocusClient; |
24 } | 27 } |
25 class Window; | 28 class Window; |
26 } | 29 } |
27 | 30 |
28 namespace wm { | 31 namespace wm { |
29 class ScopedCaptureClient; | 32 class ScopedCaptureClient; |
30 } | 33 } |
31 | 34 |
32 namespace mojo { | 35 namespace mojo { |
33 | 36 |
34 class AuraInit; | 37 class AuraInit; |
35 class WindowManagerServiceImpl; | 38 class WindowManagerServiceImpl; |
36 class WindowTreeHostMojo; | 39 class WindowTreeHostMojo; |
37 | 40 |
38 class WindowManagerApp : public ApplicationDelegate, | 41 class WindowManagerApp |
39 public view_manager::ViewManagerDelegate, | 42 : public ApplicationDelegate, |
40 public view_manager::NodeObserver, | 43 public view_manager::ViewManagerDelegate, |
41 public WindowTreeHostMojoDelegate, | 44 public view_manager::NodeObserver, |
42 public aura::client::FocusChangeObserver, | 45 public WindowTreeHostMojoDelegate, |
43 public aura::client::ActivationChangeObserver { | 46 public aura::client::FocusChangeObserver, |
| 47 public aura::client::ActivationChangeObserver, |
| 48 public InterfaceFactoryWithContext<WindowManagerServiceImpl, |
| 49 WindowManagerApp> { |
44 public: | 50 public: |
45 WindowManagerApp(); | 51 WindowManagerApp(); |
46 virtual ~WindowManagerApp(); | 52 virtual ~WindowManagerApp(); |
47 | 53 |
48 void AddConnection(WindowManagerServiceImpl* connection); | 54 void AddConnection(WindowManagerServiceImpl* connection); |
49 void RemoveConnection(WindowManagerServiceImpl* connection); | 55 void RemoveConnection(WindowManagerServiceImpl* connection); |
50 | 56 |
51 view_manager::Id OpenWindow(); | 57 view_manager::Id OpenWindow(); |
52 view_manager::Id OpenWindowWithURL(const String& url); | 58 view_manager::Id OpenWindowWithURL(const String& url); |
53 void SetCapture(view_manager::Id node); | 59 void SetCapture(view_manager::Id node); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // Creates an aura::Window for every node in the hierarchy beneath |id|, | 97 // Creates an aura::Window for every node in the hierarchy beneath |id|, |
92 // and adds to the registry so that it can be retrieved later via | 98 // and adds to the registry so that it can be retrieved later via |
93 // GetWindowForNodeId(). | 99 // GetWindowForNodeId(). |
94 // TODO(beng): perhaps Node should have a property bag. | 100 // TODO(beng): perhaps Node should have a property bag. |
95 void RegisterSubtree(view_manager::Id id, aura::Window* parent); | 101 void RegisterSubtree(view_manager::Id id, aura::Window* parent); |
96 // Deletes the aura::Windows associated with the hierarchy beneath |id|, | 102 // Deletes the aura::Windows associated with the hierarchy beneath |id|, |
97 // and removes from the registry. | 103 // and removes from the registry. |
98 void UnregisterSubtree(view_manager::Id id); | 104 void UnregisterSubtree(view_manager::Id id); |
99 | 105 |
100 view_manager::ViewManager* view_manager_; | 106 view_manager::ViewManager* view_manager_; |
| 107 view_manager::ViewManagerClientFactory view_manager_client_factory_; |
101 view_manager::Node* root_; | 108 view_manager::Node* root_; |
102 | 109 |
103 scoped_ptr<AuraInit> aura_init_; | 110 scoped_ptr<AuraInit> aura_init_; |
104 scoped_ptr<WindowTreeHostMojo> window_tree_host_; | 111 scoped_ptr<WindowTreeHostMojo> window_tree_host_; |
105 | 112 |
106 scoped_ptr<wm::ScopedCaptureClient> capture_client_; | 113 scoped_ptr<wm::ScopedCaptureClient> capture_client_; |
107 scoped_ptr<aura::client::FocusClient> focus_client_; | 114 scoped_ptr<aura::client::FocusClient> focus_client_; |
108 aura::client::ActivationClient* activation_client_; | 115 aura::client::ActivationClient* activation_client_; |
109 | 116 |
110 Connections connections_; | 117 Connections connections_; |
111 NodeIdToWindowMap node_id_to_window_map_; | 118 NodeIdToWindowMap node_id_to_window_map_; |
112 | 119 |
113 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); | 120 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); |
114 }; | 121 }; |
115 | 122 |
116 } // namespace mojo | 123 } // namespace mojo |
117 | 124 |
118 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ | 125 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ |
OLD | NEW |