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

Unified Diff: mojo/services/public/cpp/view_manager/node_observer.h

Issue 374933003: Remove DispositionChangePhase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/node_observer.h
diff --git a/mojo/services/public/cpp/view_manager/node_observer.h b/mojo/services/public/cpp/view_manager/node_observer.h
index 523b54228308212de696600d6f73d937b9721ac2..f32325e3e4d4375434b119e685c959f592c3e8ea 100644
--- a/mojo/services/public/cpp/view_manager/node_observer.h
+++ b/mojo/services/public/cpp/view_manager/node_observer.h
@@ -21,40 +21,52 @@ namespace view_manager {
class Node;
class View;
+// A note on -ing and -ed suffixes:
+//
+// -ing methods are called before changes are applied to the local node model.
+// -ed methods are called after changes are applied to the local node model.
+//
+// If the change originated from another connection to the view manager, it's
+// possible that the change has already been applied to the service-side model
+// prior to being called, so for example in the case of OnNodeDestroying(), it's
+// possible the node has already been destroyed on the service side.
+
class NodeObserver {
public:
- enum DispositionChangePhase {
- DISPOSITION_CHANGING,
- DISPOSITION_CHANGED
- };
-
struct TreeChangeParams {
TreeChangeParams();
Node* target;
Node* old_parent;
Node* new_parent;
Node* receiver;
- DispositionChangePhase phase;
};
- virtual void OnTreeChange(const TreeChangeParams& params) {}
+ virtual void OnTreeChanging(const TreeChangeParams& params) {}
+ virtual void OnTreeChanged(const TreeChangeParams& params) {}
+ virtual void OnNodeReordering(Node* node,
+ Node* relative_node,
+ OrderDirection direction) {}
virtual void OnNodeReordered(Node* node,
Node* relative_node,
- OrderDirection direction,
- DispositionChangePhase phase) {}
-
- virtual void OnNodeDestroy(Node* node, DispositionChangePhase phase) {}
-
- virtual void OnNodeActiveViewChange(Node* node,
- View* old_view,
- View* new_view,
- DispositionChangePhase phase) {}
-
- virtual void OnNodeBoundsChange(Node* node,
- const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds,
- DispositionChangePhase phase) {}
+ OrderDirection direction) {}
+
+ virtual void OnNodeDestroying(Node* node) {}
+ virtual void OnNodeDestroyed(Node* node) {}
+
+ virtual void OnNodeActiveViewChanging(Node* node,
+ View* old_view,
+ View* new_view) {}
+ virtual void OnNodeActiveViewChanged(Node* node,
+ View* old_view,
+ View* new_view) {}
+
+ virtual void OnNodeBoundsChanging(Node* node,
+ const gfx::Rect& old_bounds,
+ const gfx::Rect& new_bounds) {}
+ virtual void OnNodeBoundsChanged(Node* node,
+ const gfx::Rect& old_bounds,
+ const gfx::Rect& new_bounds) {}
virtual void OnNodeFocusChanged(Node* gained_focus, Node* lost_focus) {}

Powered by Google App Engine
This is Rietveld 408576698