| 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_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 5 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
| 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" | 12 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" |
| 13 #include "mojo/services/public/cpp/view_manager/types.h" | 13 #include "mojo/services/public/cpp/view_manager/types.h" |
| 14 #include "mojo/services/public/cpp/view_manager/view.h" | 14 #include "mojo/services/public/cpp/view_manager/view.h" |
| 15 #include "mojo/services/public/cpp/view_manager/view_manager.h" | 15 #include "mojo/services/public/cpp/view_manager/view_manager.h" |
| 16 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" | 16 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" |
| 17 #include "mojo/services/public/interfaces/window_manager/window_manager.mojom.h" | 17 #include "mojo/services/public/interfaces/window_manager2/window_manager2.mojom.
h" |
| 18 | 18 |
| 19 namespace mojo { | 19 namespace mojo { |
| 20 class Shell; | 20 class Shell; |
| 21 class ViewManager; | 21 class ViewManager; |
| 22 class ViewManagerDelegate; | 22 class ViewManagerDelegate; |
| 23 class ViewManagerTransaction; | 23 class ViewManagerTransaction; |
| 24 | 24 |
| 25 // Manages the connection with the View Manager service. | 25 // Manages the connection with the View Manager service. |
| 26 class ViewManagerClientImpl : public ViewManager, | 26 class ViewManagerClientImpl : public ViewManager, |
| 27 public InterfaceImpl<ViewManagerClient>, | 27 public InterfaceImpl<ViewManagerClient>, |
| 28 public WindowManagerClient { | 28 public WindowManagerClient2 { |
| 29 public: | 29 public: |
| 30 ViewManagerClientImpl(ViewManagerDelegate* delegate, Shell* shell); | 30 ViewManagerClientImpl(ViewManagerDelegate* delegate, Shell* shell); |
| 31 virtual ~ViewManagerClientImpl(); | 31 virtual ~ViewManagerClientImpl(); |
| 32 | 32 |
| 33 bool connected() const { return connected_; } | 33 bool connected() const { return connected_; } |
| 34 ConnectionSpecificId connection_id() const { return connection_id_; } | 34 ConnectionSpecificId connection_id() const { return connection_id_; } |
| 35 | 35 |
| 36 // API exposed to the view implementations that pushes local changes to the | 36 // API exposed to the view implementations that pushes local changes to the |
| 37 // service. | 37 // service. |
| 38 Id CreateView(); | 38 Id CreateView(); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 virtual void OnViewVisibilityChanged(Id view_id, bool visible) override; | 106 virtual void OnViewVisibilityChanged(Id view_id, bool visible) override; |
| 107 virtual void OnViewDrawnStateChanged(Id view_id, bool drawn) override; | 107 virtual void OnViewDrawnStateChanged(Id view_id, bool drawn) override; |
| 108 virtual void OnViewInputEvent(Id view_id, | 108 virtual void OnViewInputEvent(Id view_id, |
| 109 EventPtr event, | 109 EventPtr event, |
| 110 const Callback<void()>& callback) override; | 110 const Callback<void()>& callback) override; |
| 111 virtual void Embed( | 111 virtual void Embed( |
| 112 const String& url, | 112 const String& url, |
| 113 InterfaceRequest<ServiceProvider> service_provider) override; | 113 InterfaceRequest<ServiceProvider> service_provider) override; |
| 114 virtual void DispatchOnViewInputEvent(EventPtr event) override; | 114 virtual void DispatchOnViewInputEvent(EventPtr event) override; |
| 115 | 115 |
| 116 // Overridden from WindowManagerClient: | 116 // Overridden from WindowManagerClient2: |
| 117 virtual void OnWindowManagerReady() override; | 117 virtual void OnWindowManagerReady() override; |
| 118 virtual void OnCaptureChanged(Id old_capture_view_id, | 118 virtual void OnCaptureChanged(Id old_capture_view_id, |
| 119 Id new_capture_view_id) override; | 119 Id new_capture_view_id) override; |
| 120 virtual void OnFocusChanged(Id old_focused_view_id, | 120 virtual void OnFocusChanged(Id old_focused_view_id, |
| 121 Id new_focused_view_id) override; | 121 Id new_focused_view_id) override; |
| 122 virtual void OnActiveWindowChanged(Id old_focused_window, | 122 virtual void OnActiveWindowChanged(Id old_focused_window, |
| 123 Id new_focused_window) override; | 123 Id new_focused_window) override; |
| 124 | 124 |
| 125 void RemoveRoot(View* root); | 125 void RemoveRoot(View* root); |
| 126 | 126 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 140 | 140 |
| 141 ViewManagerDelegate* delegate_; | 141 ViewManagerDelegate* delegate_; |
| 142 WindowManagerDelegate* window_manager_delegate_; | 142 WindowManagerDelegate* window_manager_delegate_; |
| 143 | 143 |
| 144 std::vector<View*> roots_; | 144 std::vector<View*> roots_; |
| 145 | 145 |
| 146 IdToViewMap views_; | 146 IdToViewMap views_; |
| 147 | 147 |
| 148 ViewManagerService* service_; | 148 ViewManagerService* service_; |
| 149 | 149 |
| 150 WindowManagerServicePtr window_manager_; | 150 WindowManagerService2Ptr window_manager_; |
| 151 | 151 |
| 152 DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); | 152 DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace mojo | 155 } // namespace mojo |
| 156 | 156 |
| 157 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 157 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
| OLD | NEW |