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

Side by Side Diff: mojo/services/public/cpp/view_manager/view_tree_node_observer.h

Issue 272833002: View synchronization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_TREE_NODE_OBSERVER_H_ 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_ 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_TREE_NODE_OBSERVER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 11
12 namespace mojo { 12 namespace mojo {
13 namespace services { 13 namespace services {
14 namespace view_manager { 14 namespace view_manager {
15 15
16 class View;
16 class ViewTreeNode; 17 class ViewTreeNode;
17 18
18 class ViewTreeNodeObserver { 19 class ViewTreeNodeObserver {
19 public: 20 public:
20 enum DispositionChangePhase { 21 enum DispositionChangePhase {
21 DISPOSITION_CHANGING, 22 DISPOSITION_CHANGING,
22 DISPOSITION_CHANGED 23 DISPOSITION_CHANGED
23 }; 24 };
24 25
25 struct TreeChangeParams { 26 struct TreeChangeParams {
26 TreeChangeParams(); 27 TreeChangeParams();
27 ViewTreeNode* target; 28 ViewTreeNode* target;
28 ViewTreeNode* old_parent; 29 ViewTreeNode* old_parent;
29 ViewTreeNode* new_parent; 30 ViewTreeNode* new_parent;
30 ViewTreeNode* receiver; 31 ViewTreeNode* receiver;
31 DispositionChangePhase phase; 32 DispositionChangePhase phase;
32 }; 33 };
33 34
34 virtual void OnTreeChange(const TreeChangeParams& params) {} 35 virtual void OnTreeChange(const TreeChangeParams& params) {}
35 36
36 virtual void OnNodeDestroy(ViewTreeNode* node, 37 virtual void OnNodeDestroy(ViewTreeNode* node,
37 DispositionChangePhase phase) {} 38 DispositionChangePhase phase) {}
38 39
40 virtual void OnNodeActiveViewChange(ViewTreeNode* node,
41 View* old_view,
42 View* new_view,
43 DispositionChangePhase phase) {}
44
39 protected: 45 protected:
40 virtual ~ViewTreeNodeObserver() {} 46 virtual ~ViewTreeNodeObserver() {}
41 }; 47 };
42 48
43 } // namespace view_manager 49 } // namespace view_manager
44 } // namespace services 50 } // namespace services
45 } // namespace mojo 51 } // namespace mojo
46 52
47 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_TREE_NODE_OBSERVER_H_ 53 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_TREE_NODE_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698