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