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

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

Issue 460863002: Rename Node to View in the View Manager mojom & client lib. Service TBD. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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
(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_NODE_OBSERVER_H_
6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_NODE_OBSERVER_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11
12 #include "mojo/services/public/cpp/view_manager/node.h"
13 #include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
14
15 namespace gfx {
16 class Rect;
17 }
18
19 namespace mojo {
20
21 class Node;
22 class View;
23
24 // A note on -ing and -ed suffixes:
25 //
26 // -ing methods are called before changes are applied to the local node model.
27 // -ed methods are called after changes are applied to the local node model.
28 //
29 // If the change originated from another connection to the view manager, it's
30 // possible that the change has already been applied to the service-side model
31 // prior to being called, so for example in the case of OnNodeDestroying(), it's
32 // possible the node has already been destroyed on the service side.
33
34 class NodeObserver {
35 public:
36 struct TreeChangeParams {
37 TreeChangeParams();
38 Node* target;
39 Node* old_parent;
40 Node* new_parent;
41 Node* receiver;
42 };
43
44 virtual void OnTreeChanging(const TreeChangeParams& params) {}
45 virtual void OnTreeChanged(const TreeChangeParams& params) {}
46
47 virtual void OnNodeReordering(Node* node,
48 Node* relative_node,
49 OrderDirection direction) {}
50 virtual void OnNodeReordered(Node* node,
51 Node* relative_node,
52 OrderDirection direction) {}
53
54 virtual void OnNodeDestroying(Node* node) {}
55 virtual void OnNodeDestroyed(Node* node) {}
56
57 virtual void OnNodeBoundsChanging(Node* node,
58 const gfx::Rect& old_bounds,
59 const gfx::Rect& new_bounds) {}
60 virtual void OnNodeBoundsChanged(Node* node,
61 const gfx::Rect& old_bounds,
62 const gfx::Rect& new_bounds) {}
63
64 virtual void OnNodeFocusChanged(Node* gained_focus, Node* lost_focus) {}
65
66 virtual void OnNodeInputEvent(Node* node, const EventPtr& event) {}
67
68 protected:
69 virtual ~NodeObserver() {}
70 };
71
72 } // namespace mojo
73
74 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_NODE_OBSERVER_H_
OLDNEW
« no previous file with comments | « mojo/services/public/cpp/view_manager/node.h ('k') | mojo/services/public/cpp/view_manager/tests/node_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698