| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 public ViewManagerDelegate, | 48 public ViewManagerDelegate, |
| 49 public ViewObserver, | 49 public ViewObserver, |
| 50 public ui::EventHandler, | 50 public ui::EventHandler, |
| 51 public FocusControllerObserver, | 51 public FocusControllerObserver, |
| 52 public InterfaceFactory<WindowManagerInternal> { | 52 public InterfaceFactory<WindowManagerInternal> { |
| 53 public: | 53 public: |
| 54 WindowManagerApp(ViewManagerDelegate* view_manager_delegate, | 54 WindowManagerApp(ViewManagerDelegate* view_manager_delegate, |
| 55 WindowManagerDelegate* window_manager_delegate); | 55 WindowManagerDelegate* window_manager_delegate); |
| 56 ~WindowManagerApp() override; | 56 ~WindowManagerApp() override; |
| 57 | 57 |
| 58 static View* GetViewForViewTarget(ViewTarget* view); | |
| 59 ViewTarget* GetViewTargetForViewId(Id view); | |
| 60 | |
| 61 mojo::ViewEventDispatcher* event_dispatcher() { | 58 mojo::ViewEventDispatcher* event_dispatcher() { |
| 62 return view_event_dispatcher_.get(); | 59 return view_event_dispatcher_.get(); |
| 63 } | 60 } |
| 64 | 61 |
| 65 // Register/deregister new connections to the window manager service. | 62 // Register/deregister new connections to the window manager service. |
| 66 void AddConnection(WindowManagerImpl* connection); | 63 void AddConnection(WindowManagerImpl* connection); |
| 67 void RemoveConnection(WindowManagerImpl* connection); | 64 void RemoveConnection(WindowManagerImpl* connection); |
| 68 | 65 |
| 69 // These are canonical implementations of the window manager API methods. | 66 // These are canonical implementations of the window manager API methods. |
| 70 void SetCapture(Id view); | 67 void SetCapture(Id view); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 95 typedef std::set<WindowManagerImpl*> Connections; | 92 typedef std::set<WindowManagerImpl*> Connections; |
| 96 typedef std::map<Id, ViewTarget*> ViewIdToViewTargetMap; | 93 typedef std::map<Id, ViewTarget*> ViewIdToViewTargetMap; |
| 97 | 94 |
| 98 struct PendingEmbed; | 95 struct PendingEmbed; |
| 99 class WindowManagerInternalImpl; | 96 class WindowManagerInternalImpl; |
| 100 | 97 |
| 101 // Creates an ViewTarget for every view in the hierarchy beneath |view|, | 98 // Creates an ViewTarget for every view in the hierarchy beneath |view|, |
| 102 // and adds to the registry so that it can be retrieved later via | 99 // and adds to the registry so that it can be retrieved later via |
| 103 // GetViewTargetForViewId(). | 100 // GetViewTargetForViewId(). |
| 104 // TODO(beng): perhaps View should have a property bag. | 101 // TODO(beng): perhaps View should have a property bag. |
| 105 void RegisterSubtree(View* view, ViewTarget* parent); | 102 void RegisterSubtree(View* view); |
| 106 | 103 |
| 107 // Recursively invokes Unregister() for |view| and all its descendants. | 104 // Recursively invokes Unregister() for |view| and all its descendants. |
| 108 void UnregisterSubtree(View* view); | 105 void UnregisterSubtree(View* view); |
| 109 | 106 |
| 110 // Deletes the ViewTarget associated with the hierarchy beneath |id|, | 107 // Deletes the ViewTarget associated with the hierarchy beneath |id|, |
| 111 // and removes from the registry. | 108 // and removes from the registry. |
| 112 void Unregister(View* view); | 109 void Unregister(View* view); |
| 113 | 110 |
| 114 // Overridden from ViewManagerDelegate: | 111 // Overridden from ViewManagerDelegate: |
| 115 void OnEmbed(ViewManager* view_manager, | 112 void OnEmbed(ViewManager* view_manager, |
| 116 View* root, | 113 View* root, |
| 117 ServiceProviderImpl* exported_services, | 114 ServiceProviderImpl* exported_services, |
| 118 scoped_ptr<ServiceProvider> imported_services) override; | 115 scoped_ptr<ServiceProvider> imported_services) override; |
| 119 void OnViewManagerDisconnected(ViewManager* view_manager) override; | 116 void OnViewManagerDisconnected(ViewManager* view_manager) override; |
| 120 | 117 |
| 121 // Overridden from ViewObserver: | 118 // Overridden from ViewObserver: |
| 122 void OnTreeChanged(const ViewObserver::TreeChangeParams& params) override; | 119 void OnTreeChanged(const ViewObserver::TreeChangeParams& params) override; |
| 123 void OnViewDestroying(View* view) override; | 120 void OnViewDestroying(View* view) override; |
| 124 void OnViewBoundsChanged(View* view, | |
| 125 const Rect& old_bounds, | |
| 126 const Rect& new_bounds) override; | |
| 127 | 121 |
| 128 // Overridden from ui::EventHandler: | 122 // Overridden from ui::EventHandler: |
| 129 void OnEvent(ui::Event* event) override; | 123 void OnEvent(ui::Event* event) override; |
| 130 | 124 |
| 131 // Overridden from mojo::FocusControllerObserver: | 125 // Overridden from mojo::FocusControllerObserver: |
| 132 void OnViewFocused(View* gained_focus, View* lost_focus) override; | 126 void OnViewFocused(View* gained_focus, View* lost_focus) override; |
| 133 void OnViewActivated(View* gained_active, View* lost_active) override; | 127 void OnViewActivated(View* gained_active, View* lost_active) override; |
| 134 | 128 |
| 135 // Creates the connection to the ViewManager. | 129 // Creates the connection to the ViewManager. |
| 136 void LaunchViewManager(ApplicationImpl* app); | 130 void LaunchViewManager(ApplicationImpl* app); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 167 scoped_ptr<ViewManagerClient> view_manager_client_; | 161 scoped_ptr<ViewManagerClient> view_manager_client_; |
| 168 | 162 |
| 169 scoped_ptr<ViewEventDispatcher> view_event_dispatcher_; | 163 scoped_ptr<ViewEventDispatcher> view_event_dispatcher_; |
| 170 | 164 |
| 171 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); | 165 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); |
| 172 }; | 166 }; |
| 173 | 167 |
| 174 } // namespace mojo | 168 } // namespace mojo |
| 175 | 169 |
| 176 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ | 170 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ |
| OLD | NEW |