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