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. |