1 // Copyright 2015 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.
5 #ifndef COMPONENTS_VIEW_MANAGER_SERVER_VIEW_OBSERVER_H_
6 #define COMPONENTS_VIEW_MANAGER_SERVER_VIEW_OBSERVER_H_
8 #include "components/view_manager/public/interfaces/view_manager_constants.mojom.h"
15 class ViewportMetrics
;
18 namespace view_manager
{
22 // TODO(sky): rename to OnDid and OnWill everywhere.
23 class ServerViewObserver
{
25 // Invoked when a view is about to be destroyed; before any of the children
26 // have been removed and before the view has been removed from its parent.
27 virtual void OnWillDestroyView(ServerView
* view
) {}
29 // Invoked at the end of the View's destructor (after it has been removed from
31 virtual void OnViewDestroyed(ServerView
* view
) {}
33 virtual void OnWillChangeViewHierarchy(ServerView
* view
,
34 ServerView
* new_parent
,
35 ServerView
* old_parent
) {}
37 virtual void OnViewHierarchyChanged(ServerView
* view
,
38 ServerView
* new_parent
,
39 ServerView
* old_parent
) {}
41 virtual void OnViewBoundsChanged(ServerView
* view
,
42 const gfx::Rect
& old_bounds
,
43 const gfx::Rect
& new_bounds
) {}
45 virtual void OnViewReordered(ServerView
* view
,
47 mojo::OrderDirection direction
) {}
49 virtual void OnWillChangeViewVisibility(ServerView
* view
) {}
50 virtual void OnViewVisibilityChanged(ServerView
* view
) {}
52 virtual void OnViewSharedPropertyChanged(
54 const std::string
& name
,
55 const std::vector
<uint8_t>* new_data
) {}
58 virtual ~ServerViewObserver() {}
61 } // namespace view_manager
63 #endif // COMPONENTS_VIEW_MANAGER_SERVER_VIEW_OBSERVER_H_