| OLD | NEW |
| 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 { | |
| 11 class Event; | |
| 12 } | |
| 13 | |
| 14 namespace gfx { | 10 namespace gfx { |
| 15 class Rect; | 11 class Rect; |
| 16 } | 12 } |
| 17 | 13 |
| 18 namespace mojo { | 14 namespace mojo { |
| 19 namespace service { | 15 namespace service { |
| 20 | 16 |
| 21 class Node; | 17 class Node; |
| 22 | 18 |
| 23 class MOJO_VIEW_MANAGER_EXPORT NodeDelegate { | 19 class MOJO_VIEW_MANAGER_EXPORT NodeDelegate { |
| 24 public: | 20 public: |
| 25 // Invoked at the end of the Node's destructor (after it has been removed from | 21 // Invoked at the end of the Node's destructor (after it has been removed from |
| 26 // the hierarchy and its active view has been reset). | 22 // the hierarchy and its active view has been reset). |
| 27 virtual void OnNodeDestroyed(const Node* node) = 0; | 23 virtual void OnNodeDestroyed(const Node* node) = 0; |
| 28 | 24 |
| 29 // Invoked when the hierarchy has changed. | 25 // Invoked when the hierarchy has changed. |
| 30 virtual void OnNodeHierarchyChanged(const Node* node, | 26 virtual void OnNodeHierarchyChanged(const Node* node, |
| 31 const Node* new_parent, | 27 const Node* new_parent, |
| 32 const Node* old_parent) = 0; | 28 const Node* old_parent) = 0; |
| 33 | 29 |
| 34 virtual void OnNodeBoundsChanged(const Node* node, | 30 virtual void OnNodeBoundsChanged(const Node* node, |
| 35 const gfx::Rect& old_bounds, | 31 const gfx::Rect& old_bounds, |
| 36 const gfx::Rect& new_bounds) = 0; | 32 const gfx::Rect& new_bounds) = 0; |
| 37 | 33 |
| 38 // Invoked when an input event is received by a node. | |
| 39 virtual void OnNodeInputEvent(const Node* node, | |
| 40 const ui::Event* event) = 0; | |
| 41 | |
| 42 protected: | 34 protected: |
| 43 virtual ~NodeDelegate() {} | 35 virtual ~NodeDelegate() {} |
| 44 }; | 36 }; |
| 45 | 37 |
| 46 } // namespace service | 38 } // namespace service |
| 47 } // namespace mojo | 39 } // namespace mojo |
| 48 | 40 |
| 49 #endif // MOJO_SERVICES_VIEW_MANAGER_NODE_DELEGATE_H_ | 41 #endif // MOJO_SERVICES_VIEW_MANAGER_NODE_DELEGATE_H_ |
| OLD | NEW |