Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 UI_VIEWS_VIEW_OBSERVER_H_ | |
| 6 #define UI_VIEWS_VIEW_OBSERVER_H_ | |
| 7 | |
| 8 #include "ui/views/view.h" | |
| 9 | |
| 10 namespace gfx { | |
| 11 class Rect; | |
| 12 } | |
| 13 | |
| 14 namespace views { | |
| 15 | |
| 16 // Observer can listen to various events on the Views. | |
| 17 class VIEWS_EXPORT ViewObserver { | |
| 18 public: | |
| 19 // Called whenever target |view| is being moved. If |old_parent| is NULL, | |
|
sky
2016/11/21 16:33:37
NULL -> null for all cases.
Sarmad Hashmi
2016/11/21 17:09:53
Done.
| |
| 20 // the target is being added. If the |new_parent| is NULL, then the target | |
| 21 // is being removed. | |
| 22 virtual void OnViewParentChanged(View* target, | |
| 23 View* old_parent, | |
| 24 View* new_parent) {} | |
| 25 | |
| 26 // Called when the visibile property is changed (the |view| may still be | |
|
sky
2016/11/21 16:33:37
How about: Called when View::SetEnabled() is calle
Sarmad Hashmi
2016/11/21 17:09:53
Done.
| |
| 27 // hidden at this point) | |
| 28 virtual void OnViewVisibilityChanged(View* view) {} | |
| 29 | |
| 30 virtual void OnViewEnabledChanged(View* view) {} | |
| 31 | |
| 32 virtual void OnViewBoundsChanged(View* view) {} | |
| 33 | |
| 34 // Invoked whenever a child is moved to another index. This is called on the | |
| 35 // parent view. |view| is the child view being reordered to the index. | |
| 36 virtual void OnChildViewReordered(View* view, int index) {} | |
| 37 | |
| 38 protected: | |
| 39 virtual ~ViewObserver() {} | |
| 40 }; | |
| 41 | |
| 42 } // namespace views | |
| 43 | |
| 44 #endif // UI_VIEWS_VIEW_OBSERVER_H_ | |
| OLD | NEW |