| 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_manager/window_manager.mojom.h" |
| 18 | 18 |
| 19 class SkBitmap; | 19 class SkBitmap; |
| 20 | 20 |
| 21 namespace mojo { | 21 namespace mojo { |
| 22 class BitmapUploader; |
| 22 class ViewManager; | 23 class ViewManager; |
| 23 class ViewManagerDelegate; | 24 class ViewManagerDelegate; |
| 24 class ViewManagerTransaction; | 25 class ViewManagerTransaction; |
| 25 class Shell; | 26 class Shell; |
| 26 | 27 |
| 27 // Manages the connection with the View Manager service. | 28 // Manages the connection with the View Manager service. |
| 28 class ViewManagerClientImpl : public ViewManager, | 29 class ViewManagerClientImpl : public ViewManager, |
| 29 public InterfaceImpl<ViewManagerClient>, | 30 public InterfaceImpl<ViewManagerClient>, |
| 30 public WindowManagerClient { | 31 public WindowManagerClient { |
| 31 public: | 32 public: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 45 // refers to the root view. | 46 // refers to the root view. |
| 46 void AddChild(Id child_id, Id parent_id); | 47 void AddChild(Id child_id, Id parent_id); |
| 47 void RemoveChild(Id child_id, Id parent_id); | 48 void RemoveChild(Id child_id, Id parent_id); |
| 48 | 49 |
| 49 void Reorder(Id view_id, Id relative_view_id, OrderDirection direction); | 50 void Reorder(Id view_id, Id relative_view_id, OrderDirection direction); |
| 50 | 51 |
| 51 // Returns true if the specified view was created by this connection. | 52 // Returns true if the specified view was created by this connection. |
| 52 bool OwnsView(Id id) const; | 53 bool OwnsView(Id id) const; |
| 53 | 54 |
| 54 void SetBounds(Id view_id, const gfx::Rect& bounds); | 55 void SetBounds(Id view_id, const gfx::Rect& bounds); |
| 56 void SetSurfaceId(Id view_id, SurfaceIdPtr surface_id); |
| 57 // TODO(jamesr): Remove once all callers switch from SetContents to |
| 58 // SetSurfaceId. |
| 55 void SetViewContents(Id view_id, const SkBitmap& contents); | 59 void SetViewContents(Id view_id, const SkBitmap& contents); |
| 56 void SetFocus(Id view_id); | 60 void SetFocus(Id view_id); |
| 57 void SetVisible(Id view_id, bool visible); | 61 void SetVisible(Id view_id, bool visible); |
| 58 | 62 |
| 59 void Embed(const String& url, Id view_id); | 63 void Embed(const String& url, Id view_id); |
| 60 void Embed(const String& url, | 64 void Embed(const String& url, |
| 61 Id view_id, | 65 Id view_id, |
| 62 ServiceProviderPtr service_provider); | 66 ServiceProviderPtr service_provider); |
| 63 | 67 |
| 64 void set_change_acked_callback(const base::Callback<void(void)>& callback) { | 68 void set_change_acked_callback(const base::Callback<void(void)>& callback) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 WindowManagerDelegate* window_manager_delegate_; | 148 WindowManagerDelegate* window_manager_delegate_; |
| 145 | 149 |
| 146 std::vector<View*> roots_; | 150 std::vector<View*> roots_; |
| 147 | 151 |
| 148 IdToViewMap views_; | 152 IdToViewMap views_; |
| 149 | 153 |
| 150 ViewManagerService* service_; | 154 ViewManagerService* service_; |
| 151 | 155 |
| 152 WindowManagerServicePtr window_manager_; | 156 WindowManagerServicePtr window_manager_; |
| 153 | 157 |
| 158 // TODO(jamesr): Remove once all callers switch from SetContents to |
| 159 // SetSurfaceId. |
| 160 Shell* shell_; |
| 161 scoped_ptr<BitmapUploader> bitmap_uploader_; |
| 162 |
| 154 DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); | 163 DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); |
| 155 }; | 164 }; |
| 156 | 165 |
| 157 } // namespace mojo | 166 } // namespace mojo |
| 158 | 167 |
| 159 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 168 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
| OLD | NEW |