OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 SERVICES_VIEW_MANAGER_SERVER_VIEW_DELEGATE_H_ | 5 #ifndef SERVICES_VIEW_MANAGER_SERVER_VIEW_OBSERVER_H_ |
6 #define SERVICES_VIEW_MANAGER_SERVER_VIEW_DELEGATE_H_ | 6 #define SERVICES_VIEW_MANAGER_SERVER_VIEW_OBSERVER_H_ |
7 | 7 |
8 #include "mojo/services/view_manager/public/interfaces/view_manager_constants.mo
jom.h" | 8 #include "mojo/services/view_manager/public/interfaces/view_manager_constants.mo
jom.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
11 class Rect; | 11 class Rect; |
12 } | 12 } |
13 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 class ViewportMetrics; | 15 class ViewportMetrics; |
16 } | 16 } |
17 | 17 |
18 namespace view_manager { | 18 namespace view_manager { |
19 | 19 |
20 class ServerView; | 20 class ServerView; |
21 | 21 |
22 class ServerViewDelegate { | 22 class ServerViewObserver { |
23 public: | 23 public: |
24 // Invoked when a view is about to be destroyed; before any of the children | 24 // Invoked when a view is about to be destroyed; before any of the children |
25 // have been removed and before the view has been removed from its parent. | 25 // have been removed and before the view has been removed from its parent. |
26 virtual void OnWillDestroyView(ServerView* view) = 0; | 26 virtual void OnWillDestroyView(const ServerView* view) {} |
27 | 27 |
28 // Invoked at the end of the View's destructor (after it has been removed from | 28 // Invoked at the end of the View's destructor (after it has been removed from |
29 // the hierarchy). | 29 // the hierarchy). |
30 virtual void OnViewDestroyed(const ServerView* view) = 0; | 30 virtual void OnViewDestroyed(const ServerView* view) {} |
31 | 31 |
32 virtual void OnWillChangeViewHierarchy(ServerView* view, | 32 virtual void OnWillChangeViewHierarchy(const ServerView* view, |
33 ServerView* new_parent, | 33 const ServerView* new_parent, |
34 ServerView* old_parent) = 0; | 34 const ServerView* old_parent) {} |
35 | 35 |
36 virtual void OnViewHierarchyChanged(const ServerView* view, | 36 virtual void OnViewHierarchyChanged(const ServerView* view, |
37 const ServerView* new_parent, | 37 const ServerView* new_parent, |
38 const ServerView* old_parent) = 0; | 38 const ServerView* old_parent) {} |
39 | 39 |
40 virtual void OnViewBoundsChanged(const ServerView* view, | 40 virtual void OnViewBoundsChanged(const ServerView* view, |
41 const gfx::Rect& old_bounds, | 41 const gfx::Rect& old_bounds, |
42 const gfx::Rect& new_bounds) = 0; | 42 const gfx::Rect& new_bounds) {} |
43 | |
44 virtual void OnViewSurfaceIdChanged(const ServerView* view) = 0; | |
45 | 43 |
46 virtual void OnViewReordered(const ServerView* view, | 44 virtual void OnViewReordered(const ServerView* view, |
47 const ServerView* relative, | 45 const ServerView* relative, |
48 mojo::OrderDirection direction) = 0; | 46 mojo::OrderDirection direction) {} |
49 | 47 |
50 virtual void OnWillChangeViewVisibility(ServerView* view) = 0; | 48 virtual void OnWillChangeViewVisibility(const ServerView* view) {} |
51 | 49 |
52 virtual void OnViewSharedPropertyChanged( | 50 virtual void OnViewSharedPropertyChanged( |
53 const ServerView* view, | 51 const ServerView* view, |
54 const std::string& name, | 52 const std::string& name, |
55 const std::vector<uint8_t>* new_data) = 0; | 53 const std::vector<uint8_t>* new_data) {} |
56 | |
57 virtual void OnScheduleViewPaint(const ServerView* view) = 0; | |
58 | 54 |
59 protected: | 55 protected: |
60 virtual ~ServerViewDelegate() {} | 56 virtual ~ServerViewObserver() {} |
61 }; | 57 }; |
62 | 58 |
63 } // namespace view_manager | 59 } // namespace view_manager |
64 | 60 |
65 #endif // SERVICES_VIEW_MANAGER_SERVER_VIEW_DELEGATE_H_ | 61 #endif // SERVICES_VIEW_MANAGER_SERVER_VIEW_OBSERVER_H_ |
OLD | NEW |