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

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

Issue 288313002: Tweaks to ViewManager: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup 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/view_manager/root_node_manager.h
diff --git a/mojo/services/view_manager/root_node_manager.h b/mojo/services/view_manager/root_node_manager.h
index b81a566b30a0a5c4e020d99165423c4aec7615a2..321faf752bc85534877b8f5b687cdb095354da51 100644
--- a/mojo/services/view_manager/root_node_manager.h
+++ b/mojo/services/view_manager/root_node_manager.h
@@ -41,7 +41,8 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager : public NodeDelegate {
public:
ScopedChange(ViewManagerConnection* connection,
RootNodeManager* root,
- RootNodeManager::ChangeType change_type);
+ RootNodeManager::ChangeType change_type,
+ bool is_delete_node);
~ScopedChange();
private:
@@ -75,16 +76,20 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager : public NodeDelegate {
Node* root() { return &root_; }
+ bool IsProcessingChange() const { return change_source_ != 0; }
+
+ bool is_processing_delete_node() const { return is_processing_delete_node_; }
+
// These functions trivially delegate to all ViewManagerConnections, which in
// term notify their clients.
- void NotifyNodeHierarchyChanged(const NodeId& node,
- const NodeId& new_parent,
- const NodeId& old_parent);
- void NotifyNodeViewReplaced(const NodeId& node,
- const ViewId& new_view_id,
- const ViewId& old_view_id);
- void NotifyNodeDeleted(const NodeId& node);
- void NotifyViewDeleted(const ViewId& view);
+ void ProcessNodeHierarchyChanged(const NodeId& node,
+ const NodeId& new_parent,
+ const NodeId& old_parent);
+ void ProcessNodeViewReplaced(const NodeId& node,
+ const ViewId& new_view_id,
+ const ViewId& old_view_id);
+ void ProcessNodeDeleted(const NodeId& node);
+ void ProcessViewDeleted(const ViewId& view);
private:
// Used to setup any static state needed by RootNodeManager.
@@ -101,14 +106,15 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager : public NodeDelegate {
// Changes should never nest, meaning each PrepareForChange() must be
// balanced with a call to FinishChange() with no PrepareForChange()
// in between.
- void PrepareForChange(ViewManagerConnection* connection);
+ void PrepareForChange(ViewManagerConnection* connection, bool is_delete_node);
// Balances a call to PrepareForChange().
void FinishChange(ChangeType change_type);
- // Returns true if the specified connection should be notified of the current
- // change.
- bool ShouldNotifyConnection(TransportConnectionId connection_id) const;
+ // Returns true if the specified connection originated the current change.
+ bool IsChangeSource(TransportConnectionId connection_id) const {
+ return connection_id == change_source_;
+ }
// Overriden from NodeDelegate:
virtual void OnNodeHierarchyChanged(const NodeId& node,
@@ -131,6 +137,9 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager : public NodeDelegate {
// If non-zero we're processing a change from this client.
TransportConnectionId change_source_;
+ // True if we're processing a DeleteNode request.
+ bool is_processing_delete_node_;
+
RootViewManager root_view_manager_;
// Root node.

Powered by Google App Engine
This is Rietveld 408576698