| 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 { | 10 namespace ui { |
| 11 class Event; | 11 class Event; |
| 12 } | 12 } |
| 13 | 13 |
| 14 namespace gfx { | |
| 15 class Rect; | |
| 16 } | |
| 17 | |
| 18 namespace mojo { | 14 namespace mojo { |
| 19 namespace view_manager { | 15 namespace view_manager { |
| 20 namespace service { | 16 namespace service { |
| 21 | 17 |
| 22 class Node; | 18 class Node; |
| 23 class View; | 19 class View; |
| 24 | 20 |
| 25 class MOJO_VIEW_MANAGER_EXPORT NodeDelegate { | 21 class MOJO_VIEW_MANAGER_EXPORT NodeDelegate { |
| 26 public: | 22 public: |
| 27 // Invoked when the hierarchy has changed. | 23 // Invoked when the hierarchy has changed. |
| 28 virtual void OnNodeHierarchyChanged(const Node* node, | 24 virtual void OnNodeHierarchyChanged(const Node* node, |
| 29 const Node* new_parent, | 25 const Node* new_parent, |
| 30 const Node* old_parent) = 0; | 26 const Node* old_parent) = 0; |
| 31 | 27 |
| 32 virtual void OnNodeBoundsChanged(const Node* node, | |
| 33 const gfx::Rect& old_bounds, | |
| 34 const gfx::Rect& new_bounds) = 0; | |
| 35 | |
| 36 // Invoked when the View associated with a node changes. | 28 // Invoked when the View associated with a node changes. |
| 37 virtual void OnNodeViewReplaced(const Node* node, | 29 virtual void OnNodeViewReplaced(const Node* node, |
| 38 const View* new_view, | 30 const View* new_view, |
| 39 const View* old_view) = 0; | 31 const View* old_view) = 0; |
| 40 | 32 |
| 41 // Invoked when an input event is received by the View at this node. | 33 // Invoked when an input event is received by the View at this node. |
| 42 virtual void OnViewInputEvent(const View* view, | 34 virtual void OnViewInputEvent(const View* view, |
| 43 const ui::Event* event) = 0; | 35 const ui::Event* event) = 0; |
| 44 | 36 |
| 45 protected: | 37 protected: |
| 46 virtual ~NodeDelegate() {} | 38 virtual ~NodeDelegate() {} |
| 47 }; | 39 }; |
| 48 | 40 |
| 49 } // namespace service | 41 } // namespace service |
| 50 } // namespace view_manager | 42 } // namespace view_manager |
| 51 } // namespace mojo | 43 } // namespace mojo |
| 52 | 44 |
| 53 #endif // MOJO_SERVICES_VIEW_MANAGER_NODE_DELEGATE_H_ | 45 #endif // MOJO_SERVICES_VIEW_MANAGER_NODE_DELEGATE_H_ |
| OLD | NEW |