| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_TREE_NODE_OBSERVER_H_ | |
| 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_TREE_NODE_OBSERVER_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 | |
| 12 #include "mojo/services/public/cpp/view_manager/view_tree_node.h" | |
| 13 | |
| 14 namespace gfx { | |
| 15 class Rect; | |
| 16 } | |
| 17 | |
| 18 namespace mojo { | |
| 19 namespace view_manager { | |
| 20 | |
| 21 class View; | |
| 22 class ViewTreeNode; | |
| 23 | |
| 24 class ViewTreeNodeObserver { | |
| 25 public: | |
| 26 enum DispositionChangePhase { | |
| 27 DISPOSITION_CHANGING, | |
| 28 DISPOSITION_CHANGED | |
| 29 }; | |
| 30 | |
| 31 struct TreeChangeParams { | |
| 32 TreeChangeParams(); | |
| 33 ViewTreeNode* target; | |
| 34 ViewTreeNode* old_parent; | |
| 35 ViewTreeNode* new_parent; | |
| 36 ViewTreeNode* receiver; | |
| 37 DispositionChangePhase phase; | |
| 38 }; | |
| 39 | |
| 40 virtual void OnTreeChange(const TreeChangeParams& params) {} | |
| 41 | |
| 42 virtual void OnNodeReordered(ViewTreeNode* node, | |
| 43 ViewTreeNode* relative_node, | |
| 44 OrderDirection direction, | |
| 45 DispositionChangePhase phase) {} | |
| 46 | |
| 47 virtual void OnNodeDestroy(ViewTreeNode* node, | |
| 48 DispositionChangePhase phase) {} | |
| 49 | |
| 50 virtual void OnNodeActiveViewChange(ViewTreeNode* node, | |
| 51 View* old_view, | |
| 52 View* new_view, | |
| 53 DispositionChangePhase phase) {} | |
| 54 | |
| 55 virtual void OnNodeBoundsChange(ViewTreeNode* node, | |
| 56 const gfx::Rect& old_bounds, | |
| 57 const gfx::Rect& new_bounds, | |
| 58 DispositionChangePhase phase) {} | |
| 59 | |
| 60 protected: | |
| 61 virtual ~ViewTreeNodeObserver() {} | |
| 62 }; | |
| 63 | |
| 64 } // namespace view_manager | |
| 65 } // namespace mojo | |
| 66 | |
| 67 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_TREE_NODE_OBSERVER_H_ | |
| OLD | NEW |