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

Unified Diff: mojo/services/view_manager/connection_manager.h

Issue 720883003: Adds a CloneAndAnimate function to WindowManagerInternalClient (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: tweaks Created 6 years, 1 month 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/view_manager/connection_manager.h
diff --git a/mojo/services/view_manager/connection_manager.h b/mojo/services/view_manager/connection_manager.h
index 9f0e9b1437db8341145c862a76c3c29813ce2570..7752773d04a48a6709c4e81666402715039a71c8 100644
--- a/mojo/services/view_manager/connection_manager.h
+++ b/mojo/services/view_manager/connection_manager.h
@@ -10,11 +10,11 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "base/timer/timer.h"
#include "mojo/public/cpp/bindings/array.h"
#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
#include "mojo/services/public/interfaces/window_manager/window_manager_internal.mojom.h"
#include "mojo/services/view_manager/ids.h"
-#include "mojo/services/view_manager/server_view.h"
#include "mojo/services/view_manager/server_view_delegate.h"
namespace mojo {
@@ -23,6 +23,7 @@ namespace service {
class ClientConnection;
class ConnectionManagerDelegate;
class DisplayManager;
+class ServerView;
class ViewManagerServiceImpl;
// ConnectionManager manages the set of connections to the ViewManager (all the
@@ -77,8 +78,8 @@ class ConnectionManager : public ServerViewDelegate,
// See description of ViewManagerService::Embed() for details. This assumes
// |transport_view_id| is valid.
void EmbedAtView(ConnectionSpecificId creator_id,
- const String& url,
- Id transport_view_id,
+ const std::string& url,
+ const ViewId& view_id,
InterfaceRequest<ServiceProvider> service_provider);
// Returns the connection by id.
@@ -117,6 +118,10 @@ class ConnectionManager : public ServerViewDelegate,
return window_manager_client_connection_ != nullptr;
}
+ // Implementation of WindowManagerInternalClient functions. See mojom for
msw 2014/11/18 23:37:42 nit: "WindowManagerInternalClient implementation h
sky 2014/11/19 00:49:39 Done.
+ // details.
+ bool CloneAndAnimate(const ViewId& view_id);
+
// These functions trivially delegate to all ViewManagerServiceImpls, which in
// term notify their clients.
void ProcessViewDestroyed(ServerView* view);
@@ -156,11 +161,16 @@ class ConnectionManager : public ServerViewDelegate,
// Adds |connection| to internal maps.
void AddConnection(ClientConnection* connection);
+ // Callback from animation timer.
+ // TODO(sky): make this real (move to a different class).
+ void DoAnimation();
+
// Overridden from ServerViewDelegate:
+ void OnWillDestroyView(ServerView* view) override;
void OnViewDestroyed(const ServerView* view) override;
- void OnWillChangeViewHierarchy(const ServerView* view,
- const ServerView* new_parent,
- const ServerView* old_parent) override;
+ void OnWillChangeViewHierarchy(ServerView* view,
+ ServerView* new_parent,
+ ServerView* old_parent) override;
void OnViewHierarchyChanged(const ServerView* view,
const ServerView* new_parent,
const ServerView* old_parent) override;
@@ -171,16 +181,18 @@ class ConnectionManager : public ServerViewDelegate,
void OnViewReordered(const ServerView* view,
const ServerView* relative,
OrderDirection direction) override;
- void OnWillChangeViewVisibility(const ServerView* view) override;
+ void OnWillChangeViewVisibility(ServerView* view) override;
void OnViewSharedPropertyChanged(
const ServerView* view,
const std::string& name,
const std::vector<uint8_t>* new_data) override;
+ void OnScheduleViewPaint(const ServerView* view) override;
// WindowManagerInternalClient:
- void DispatchInputEventToView(Id transport_view_id,
- EventPtr event) override;
+ void DispatchInputEventToView(Id transport_view_id, EventPtr event) override;
void SetViewportSize(SizePtr size) override;
+ void CloneAndAnimate(Id transport_view_id,
+ const Callback<void(bool)>& callback) override;
ConnectionManagerDelegate* delegate_;
@@ -207,6 +219,9 @@ class ConnectionManager : public ServerViewDelegate,
bool in_destructor_;
+ // TODO(sky): nuke! Just a proof of concept until get real animation api.
+ base::RepeatingTimer<ConnectionManager> animation_timer_;
+
DISALLOW_COPY_AND_ASSIGN(ConnectionManager);
};

Powered by Google App Engine
This is Rietveld 408576698