| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 bool IsReady() const; | 83 bool IsReady() const; |
| 84 | 84 |
| 85 // A client of this object will use this accessor to gain access to the | 85 // A client of this object will use this accessor to gain access to the |
| 86 // aura::Window hierarchy and attach event handlers. | 86 // aura::Window hierarchy and attach event handlers. |
| 87 aura::WindowTreeHost* host() { return window_tree_host_.get(); } | 87 aura::WindowTreeHost* host() { return window_tree_host_.get(); } |
| 88 | 88 |
| 89 void InitFocus(wm::FocusRules* rules); | 89 void InitFocus(wm::FocusRules* rules); |
| 90 | 90 |
| 91 // Overridden from ApplicationDelegate: | 91 // Overridden from ApplicationDelegate: |
| 92 virtual void Initialize(ApplicationImpl* impl) MOJO_OVERRIDE; | 92 virtual void Initialize(ApplicationImpl* impl) override; |
| 93 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 93 virtual bool ConfigureIncomingConnection( |
| 94 MOJO_OVERRIDE; | 94 ApplicationConnection* connection) override; |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 typedef std::set<WindowManagerServiceImpl*> Connections; | 97 typedef std::set<WindowManagerServiceImpl*> Connections; |
| 98 typedef std::map<Id, aura::Window*> ViewIdToWindowMap; | 98 typedef std::map<Id, aura::Window*> ViewIdToWindowMap; |
| 99 | 99 |
| 100 // Overridden from ViewManagerDelegate: | 100 // Overridden from ViewManagerDelegate: |
| 101 virtual void OnEmbed( | 101 virtual void OnEmbed(ViewManager* view_manager, |
| 102 ViewManager* view_manager, | 102 View* root, |
| 103 View* root, | 103 ServiceProviderImpl* exported_services, |
| 104 ServiceProviderImpl* exported_services, | 104 scoped_ptr<ServiceProvider> imported_services) override; |
| 105 scoped_ptr<ServiceProvider> imported_services) MOJO_OVERRIDE; | 105 virtual void OnViewManagerDisconnected(ViewManager* view_manager) override; |
| 106 virtual void OnViewManagerDisconnected( | |
| 107 ViewManager* view_manager) MOJO_OVERRIDE; | |
| 108 | 106 |
| 109 // Overridden from WindowManagerDelegate: | 107 // Overridden from WindowManagerDelegate: |
| 110 virtual void Embed( | 108 virtual void Embed( |
| 111 const String& url, | 109 const String& url, |
| 112 InterfaceRequest<ServiceProvider> service_provider) OVERRIDE; | 110 InterfaceRequest<ServiceProvider> service_provider) OVERRIDE; |
| 113 virtual void DispatchEvent(EventPtr event) OVERRIDE; | 111 virtual void DispatchEvent(EventPtr event) OVERRIDE; |
| 114 | 112 |
| 115 // Overridden from ViewObserver: | 113 // Overridden from ViewObserver: |
| 116 virtual void OnTreeChanged( | 114 virtual void OnTreeChanged( |
| 117 const ViewObserver::TreeChangeParams& params) MOJO_OVERRIDE; | 115 const ViewObserver::TreeChangeParams& params) override; |
| 118 virtual void OnViewDestroyed(View* view) MOJO_OVERRIDE; | 116 virtual void OnViewDestroyed(View* view) override; |
| 119 virtual void OnViewBoundsChanged(View* view, | 117 virtual void OnViewBoundsChanged(View* view, |
| 120 const gfx::Rect& old_bounds, | 118 const gfx::Rect& old_bounds, |
| 121 const gfx::Rect& new_bounds) MOJO_OVERRIDE; | 119 const gfx::Rect& new_bounds) override; |
| 122 | 120 |
| 123 // Overridden from WindowTreeHostMojoDelegate: | 121 // Overridden from WindowTreeHostMojoDelegate: |
| 124 virtual void CompositorContentsChanged(const SkBitmap& bitmap) MOJO_OVERRIDE; | 122 virtual void CompositorContentsChanged(const SkBitmap& bitmap) override; |
| 125 | 123 |
| 126 // Overridden from ui::EventHandler: | 124 // Overridden from ui::EventHandler: |
| 127 virtual void OnEvent(ui::Event* event) MOJO_OVERRIDE; | 125 virtual void OnEvent(ui::Event* event) override; |
| 128 | 126 |
| 129 // Overridden from aura::client::FocusChangeObserver: | 127 // Overridden from aura::client::FocusChangeObserver: |
| 130 virtual void OnWindowFocused(aura::Window* gained_focus, | 128 virtual void OnWindowFocused(aura::Window* gained_focus, |
| 131 aura::Window* lost_focus) MOJO_OVERRIDE; | 129 aura::Window* lost_focus) override; |
| 132 | 130 |
| 133 // Overridden from aura::client::ActivationChangeObserver: | 131 // Overridden from aura::client::ActivationChangeObserver: |
| 134 virtual void OnWindowActivated(aura::Window* gained_active, | 132 virtual void OnWindowActivated(aura::Window* gained_active, |
| 135 aura::Window* lost_active) MOJO_OVERRIDE; | 133 aura::Window* lost_active) override; |
| 136 | 134 |
| 137 // Creates an aura::Window for every view in the hierarchy beneath |view|, | 135 // Creates an aura::Window for every view in the hierarchy beneath |view|, |
| 138 // and adds to the registry so that it can be retrieved later via | 136 // and adds to the registry so that it can be retrieved later via |
| 139 // GetWindowForViewId(). | 137 // GetWindowForViewId(). |
| 140 // TODO(beng): perhaps View should have a property bag. | 138 // TODO(beng): perhaps View should have a property bag. |
| 141 void RegisterSubtree(View* view, aura::Window* parent); | 139 void RegisterSubtree(View* view, aura::Window* parent); |
| 142 // Deletes the aura::Windows associated with the hierarchy beneath |id|, | 140 // Deletes the aura::Windows associated with the hierarchy beneath |id|, |
| 143 // and removes from the registry. | 141 // and removes from the registry. |
| 144 void UnregisterSubtree(View* view); | 142 void UnregisterSubtree(View* view); |
| 145 | 143 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 164 ViewIdToWindowMap view_id_to_window_map_; | 162 ViewIdToWindowMap view_id_to_window_map_; |
| 165 | 163 |
| 166 scoped_ptr<DummyDelegate> dummy_delegate_; | 164 scoped_ptr<DummyDelegate> dummy_delegate_; |
| 167 | 165 |
| 168 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); | 166 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); |
| 169 }; | 167 }; |
| 170 | 168 |
| 171 } // namespace mojo | 169 } // namespace mojo |
| 172 | 170 |
| 173 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ | 171 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ |
| OLD | NEW |