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

Side by Side Diff: mojo/services/view_manager/node_delegate.h

Issue 383763003: Trigger Node destruction notifications from Node's dtor (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/services/view_manager/node.cc ('k') | mojo/services/view_manager/root_node_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_VIEW_MANAGER_NODE_DELEGATE_H_ 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_NODE_DELEGATE_H_
6 #define MOJO_SERVICES_VIEW_MANAGER_NODE_DELEGATE_H_ 6 #define MOJO_SERVICES_VIEW_MANAGER_NODE_DELEGATE_H_
7 7
8 #include "mojo/services/view_manager/view_manager_export.h" 8 #include "mojo/services/view_manager/view_manager_export.h"
9 9
10 namespace ui { 10 namespace ui {
11 class Event; 11 class Event;
12 } 12 }
13 13
14 namespace gfx { 14 namespace gfx {
15 class Rect; 15 class Rect;
16 } 16 }
17 17
18 namespace mojo { 18 namespace mojo {
19 namespace view_manager { 19 namespace view_manager {
20 namespace service { 20 namespace service {
21 21
22 class Node; 22 class Node;
23 class View; 23 class View;
24 24
25 class MOJO_VIEW_MANAGER_EXPORT NodeDelegate { 25 class MOJO_VIEW_MANAGER_EXPORT NodeDelegate {
26 public: 26 public:
27 // Invoked at the end of the Node's destructor (after it has been removed from
28 // the hierarchy and its active view has been reset).
29 virtual void OnNodeDestroyed(const Node* node) = 0;
30
27 // Invoked when the hierarchy has changed. 31 // Invoked when the hierarchy has changed.
28 virtual void OnNodeHierarchyChanged(const Node* node, 32 virtual void OnNodeHierarchyChanged(const Node* node,
29 const Node* new_parent, 33 const Node* new_parent,
30 const Node* old_parent) = 0; 34 const Node* old_parent) = 0;
31 35
32 virtual void OnNodeBoundsChanged(const Node* node, 36 virtual void OnNodeBoundsChanged(const Node* node,
33 const gfx::Rect& old_bounds, 37 const gfx::Rect& old_bounds,
34 const gfx::Rect& new_bounds) = 0; 38 const gfx::Rect& new_bounds) = 0;
35 39
36 // Invoked when the View associated with a node changes. 40 // Invoked when the View associated with a node changes.
37 virtual void OnNodeViewReplaced(const Node* node, 41 virtual void OnNodeViewReplaced(const Node* node,
38 const View* new_view, 42 const View* new_view,
39 const View* old_view) = 0; 43 const View* old_view) = 0;
40 44
41 // Invoked when an input event is received by the View at this node. 45 // Invoked when an input event is received by the View at this node.
42 virtual void OnViewInputEvent(const View* view, 46 virtual void OnViewInputEvent(const View* view,
43 const ui::Event* event) = 0; 47 const ui::Event* event) = 0;
44 48
45 protected: 49 protected:
46 virtual ~NodeDelegate() {} 50 virtual ~NodeDelegate() {}
47 }; 51 };
48 52
49 } // namespace service 53 } // namespace service
50 } // namespace view_manager 54 } // namespace view_manager
51 } // namespace mojo 55 } // namespace mojo
52 56
53 #endif // MOJO_SERVICES_VIEW_MANAGER_NODE_DELEGATE_H_ 57 #endif // MOJO_SERVICES_VIEW_MANAGER_NODE_DELEGATE_H_
OLDNEW
« no previous file with comments | « mojo/services/view_manager/node.cc ('k') | mojo/services/view_manager/root_node_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698