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