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

Unified Diff: mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h

Issue 303163005: Embedding demo in View manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h
diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h b/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h
index 8e286b10be5209a36698e21e7a10a92884661555..887fef452b90aac1f8b3671bc6eaf7cf57ad8b35 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h
+++ b/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h
@@ -15,10 +15,6 @@
class SkBitmap;
-namespace base {
-class RunLoop;
-}
-
namespace mojo {
namespace view_manager {
@@ -26,7 +22,7 @@ class ViewManager;
class ViewManagerTransaction;
// Manages the connection with the View Manager service.
-class ViewManagerSynchronizer : public IViewManagerClient {
+class ViewManagerSynchronizer : public InterfaceImpl<IViewManagerClient> {
public:
explicit ViewManagerSynchronizer(ViewManager* view_manager);
virtual ~ViewManagerSynchronizer();
@@ -54,6 +50,8 @@ class ViewManagerSynchronizer : public IViewManagerClient {
void SetBounds(TransportNodeId node_id, const gfx::Rect& bounds);
void SetViewContents(TransportViewId view_id, const SkBitmap& contents);
+ void Embed(const String& url, TransportNodeId node_id);
+
void set_changes_acked_callback(const base::Callback<void(void)>& callback) {
changes_acked_callback_ = callback;
}
@@ -65,6 +63,9 @@ class ViewManagerSynchronizer : public IViewManagerClient {
friend class ViewManagerTransaction;
typedef ScopedVector<ViewManagerTransaction> Transactions;
+ // Overridden from InterfaceImpl:
+ virtual void OnConnectionEstablished() OVERRIDE;
+
// Overridden from IViewManagerClient:
virtual void OnViewManagerConnectionEstablished(
TransportConnectionId connection_id,
@@ -96,7 +97,9 @@ class ViewManagerSynchronizer : public IViewManagerClient {
// front of the queue.
void RemoveFromPendingQueue(ViewManagerTransaction* transaction);
- ViewManager* view_manager_;
+ ViewManager* view_manager() { return view_manager_.get(); }
+
+ scoped_ptr<ViewManager> view_manager_;
bool connected_;
TransportConnectionId connection_id_;
uint16_t next_id_;
@@ -106,13 +109,9 @@ class ViewManagerSynchronizer : public IViewManagerClient {
base::WeakPtrFactory<ViewManagerSynchronizer> sync_factory_;
- // Non-NULL while blocking on the connection to |service_| during
- // construction.
- base::RunLoop* init_loop_;
-
base::Callback<void(void)> changes_acked_callback_;
- IViewManagerPtr service_;
+ IViewManager* service_;
DISALLOW_COPY_AND_ASSIGN(ViewManagerSynchronizer);
};

Powered by Google App Engine
This is Rietveld 408576698