| 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, |
| 20 // the target is being added, otherwise it is being removed/reparented. |
| 21 virtual void OnViewParentChanged(View* target, View* old_parent) {} |
| 22 |
| 23 // Called when View::SetVisible() is called with a new value. |
| 24 // The |view| may still be hidden at this point. |
| 25 virtual void OnViewVisibilityChanged(View* view) {} |
| 26 |
| 27 virtual void OnViewEnabledChanged(View* view) {} |
| 28 |
| 29 virtual void OnViewBoundsChanged(View* view) {} |
| 30 |
| 31 // Invoked whenever a child is moved to another index. This is called on the |
| 32 // parent view. |view| is the child view being moved. |
| 33 virtual void OnChildViewReordered(View* view) {} |
| 34 |
| 35 protected: |
| 36 virtual ~ViewObserver() {} |
| 37 }; |
| 38 |
| 39 } // namespace views |
| 40 |
| 41 #endif // UI_VIEWS_VIEW_OBSERVER_H_ |
| OLD | NEW |