| 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" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 class WindowManagerApp | 41 class WindowManagerApp |
| 42 : public ApplicationDelegate, | 42 : public ApplicationDelegate, |
| 43 public view_manager::ViewManagerDelegate, | 43 public view_manager::ViewManagerDelegate, |
| 44 public view_manager::NodeObserver, | 44 public view_manager::NodeObserver, |
| 45 public WindowTreeHostMojoDelegate, | 45 public WindowTreeHostMojoDelegate, |
| 46 public aura::client::FocusChangeObserver, | 46 public aura::client::FocusChangeObserver, |
| 47 public aura::client::ActivationChangeObserver, | 47 public aura::client::ActivationChangeObserver, |
| 48 public InterfaceFactoryWithContext<WindowManagerServiceImpl, | 48 public InterfaceFactoryWithContext<WindowManagerServiceImpl, |
| 49 WindowManagerApp> { | 49 WindowManagerApp> { |
| 50 public: | 50 public: |
| 51 WindowManagerApp(); | 51 explicit WindowManagerApp(view_manager::ViewManagerDelegate* delegate); |
| 52 virtual ~WindowManagerApp(); | 52 virtual ~WindowManagerApp(); |
| 53 | 53 |
| 54 void AddConnection(WindowManagerServiceImpl* connection); | 54 void AddConnection(WindowManagerServiceImpl* connection); |
| 55 void RemoveConnection(WindowManagerServiceImpl* connection); | 55 void RemoveConnection(WindowManagerServiceImpl* connection); |
| 56 | 56 |
| 57 view_manager::Id OpenWindow(); | 57 view_manager::Id OpenWindow(); |
| 58 view_manager::Id OpenWindowWithURL(const String& url); | 58 view_manager::Id OpenWindowWithURL(const String& url); |
| 59 void SetCapture(view_manager::Id node); | 59 void SetCapture(view_manager::Id node); |
| 60 void FocusWindow(view_manager::Id node); | 60 void FocusWindow(view_manager::Id node); |
| 61 void ActivateWindow(view_manager::Id node); | 61 void ActivateWindow(view_manager::Id node); |
| 62 | 62 |
| 63 bool IsReady() const; | 63 bool IsReady() const; |
| 64 | 64 |
| 65 private: | |
| 66 typedef std::set<WindowManagerServiceImpl*> Connections; | |
| 67 typedef std::map<view_manager::Id, aura::Window*> NodeIdToWindowMap; | |
| 68 | |
| 69 // Overridden from ApplicationDelegate: | 65 // Overridden from ApplicationDelegate: |
| 70 virtual void Initialize(ApplicationImpl* impl) MOJO_OVERRIDE; | 66 virtual void Initialize(ApplicationImpl* impl) MOJO_OVERRIDE; |
| 71 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 67 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) |
| 72 MOJO_OVERRIDE; | 68 MOJO_OVERRIDE; |
| 73 | 69 |
| 70 private: |
| 71 typedef std::set<WindowManagerServiceImpl*> Connections; |
| 72 typedef std::map<view_manager::Id, aura::Window*> NodeIdToWindowMap; |
| 73 |
| 74 // Overridden from view_manager::ViewManagerDelegate: | 74 // Overridden from view_manager::ViewManagerDelegate: |
| 75 virtual void OnRootAdded(view_manager::ViewManager* view_manager, | 75 virtual void OnRootAdded(view_manager::ViewManager* view_manager, |
| 76 view_manager::Node* root) MOJO_OVERRIDE; | 76 view_manager::Node* root) MOJO_OVERRIDE; |
| 77 virtual void OnViewManagerDisconnected( | 77 virtual void OnViewManagerDisconnected( |
| 78 view_manager::ViewManager* view_manager) MOJO_OVERRIDE; | 78 view_manager::ViewManager* view_manager) MOJO_OVERRIDE; |
| 79 | 79 |
| 80 // Overridden from view_manager::NodeObserver: | 80 // Overridden from view_manager::NodeObserver: |
| 81 virtual void OnTreeChanged( | 81 virtual void OnTreeChanged( |
| 82 const view_manager::NodeObserver::TreeChangeParams& params) MOJO_OVERRIDE; | 82 const view_manager::NodeObserver::TreeChangeParams& params) MOJO_OVERRIDE; |
| 83 | 83 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 96 | 96 |
| 97 // 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|, |
| 98 // 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 |
| 99 // GetWindowForNodeId(). | 99 // GetWindowForNodeId(). |
| 100 // TODO(beng): perhaps Node should have a property bag. | 100 // TODO(beng): perhaps Node should have a property bag. |
| 101 void RegisterSubtree(view_manager::Id id, aura::Window* parent); | 101 void RegisterSubtree(view_manager::Id id, aura::Window* parent); |
| 102 // Deletes the aura::Windows associated with the hierarchy beneath |id|, | 102 // Deletes the aura::Windows associated with the hierarchy beneath |id|, |
| 103 // and removes from the registry. | 103 // and removes from the registry. |
| 104 void UnregisterSubtree(view_manager::Id id); | 104 void UnregisterSubtree(view_manager::Id id); |
| 105 | 105 |
| 106 view_manager::ViewManagerDelegate* wrapped_delegate_; |
| 107 |
| 106 view_manager::ViewManager* view_manager_; | 108 view_manager::ViewManager* view_manager_; |
| 107 view_manager::ViewManagerClientFactory view_manager_client_factory_; | 109 view_manager::ViewManagerClientFactory view_manager_client_factory_; |
| 108 view_manager::Node* root_; | 110 view_manager::Node* root_; |
| 109 | 111 |
| 110 scoped_ptr<AuraInit> aura_init_; | 112 scoped_ptr<AuraInit> aura_init_; |
| 111 scoped_ptr<WindowTreeHostMojo> window_tree_host_; | 113 scoped_ptr<WindowTreeHostMojo> window_tree_host_; |
| 112 | 114 |
| 113 scoped_ptr<wm::ScopedCaptureClient> capture_client_; | 115 scoped_ptr<wm::ScopedCaptureClient> capture_client_; |
| 114 scoped_ptr<aura::client::FocusClient> focus_client_; | 116 scoped_ptr<aura::client::FocusClient> focus_client_; |
| 115 aura::client::ActivationClient* activation_client_; | 117 aura::client::ActivationClient* activation_client_; |
| 116 | 118 |
| 117 Connections connections_; | 119 Connections connections_; |
| 118 NodeIdToWindowMap node_id_to_window_map_; | 120 NodeIdToWindowMap node_id_to_window_map_; |
| 119 | 121 |
| 120 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); | 122 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); |
| 121 }; | 123 }; |
| 122 | 124 |
| 123 } // namespace mojo | 125 } // namespace mojo |
| 124 | 126 |
| 125 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ | 127 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ |
| OLD | NEW |