Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h

Issue 534843002: Convert view manager to surfaces with uploading shim in client lib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 ApplicationConnection; 22 class ApplicationConnection;
23 class BitmapUploader;
23 class ViewManager; 24 class ViewManager;
24 class ViewManagerDelegate; 25 class ViewManagerDelegate;
25 class ViewManagerTransaction; 26 class ViewManagerTransaction;
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:
32 ViewManagerClientImpl(ViewManagerDelegate* delegate, 33 ViewManagerClientImpl(ViewManagerDelegate* delegate,
(...skipping 13 matching lines...) Expand all
46 // refers to the root view. 47 // refers to the root view.
47 void AddChild(Id child_id, Id parent_id); 48 void AddChild(Id child_id, Id parent_id);
48 void RemoveChild(Id child_id, Id parent_id); 49 void RemoveChild(Id child_id, Id parent_id);
49 50
50 void Reorder(Id view_id, Id relative_view_id, OrderDirection direction); 51 void Reorder(Id view_id, Id relative_view_id, OrderDirection direction);
51 52
52 // Returns true if the specified view was created by this connection. 53 // Returns true if the specified view was created by this connection.
53 bool OwnsView(Id id) const; 54 bool OwnsView(Id id) const;
54 55
55 void SetBounds(Id view_id, const gfx::Rect& bounds); 56 void SetBounds(Id view_id, const gfx::Rect& bounds);
57 void SetSurfaceId(Id view_id, SurfaceIdPtr surface_id);
58 // TODO(jamesr): Remove once all callers switch from SetContents to
59 // SetSurfaceId.
56 void SetViewContents(Id view_id, const SkBitmap& contents); 60 void SetViewContents(Id view_id, const SkBitmap& contents);
57 void SetFocus(Id view_id); 61 void SetFocus(Id view_id);
58 void SetVisible(Id view_id, bool visible); 62 void SetVisible(Id view_id, bool visible);
59 63
60 void Embed(const String& url, Id view_id); 64 void Embed(const String& url, Id view_id);
61 void Embed(const String& url, 65 void Embed(const String& url,
62 Id view_id, 66 Id view_id,
63 ServiceProviderPtr service_provider); 67 ServiceProviderPtr service_provider);
64 68
65 void set_change_acked_callback(const base::Callback<void(void)>& callback) { 69 void set_change_acked_callback(const base::Callback<void(void)>& callback) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 WindowManagerDelegate* window_manager_delegate_; 147 WindowManagerDelegate* window_manager_delegate_;
144 148
145 std::vector<View*> roots_; 149 std::vector<View*> roots_;
146 150
147 IdToViewMap views_; 151 IdToViewMap views_;
148 152
149 ViewManagerService* service_; 153 ViewManagerService* service_;
150 154
151 WindowManagerServicePtr window_manager_; 155 WindowManagerServicePtr window_manager_;
152 156
157 // TODO(jamesr): Remove once all callers switch from SetContents to
158 // SetSurfaceId.
159 ApplicationConnection* app_connection_;
160 scoped_ptr<BitmapUploader> bitmap_uploader_;
161
153 DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); 162 DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl);
154 }; 163 };
155 164
156 } // namespace mojo 165 } // namespace mojo
157 166
158 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ 167 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698