| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 UI_VIEWS_VIEW_OBSERVER_H_ | 5 #ifndef UI_VIEWS_VIEW_OBSERVER_H_ |
| 6 #define UI_VIEWS_VIEW_OBSERVER_H_ | 6 #define UI_VIEWS_VIEW_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "ui/views/views_export.h" | 8 #include "ui/views/views_export.h" |
| 9 | 9 |
| 10 namespace ui { |
| 11 class NativeTheme; |
| 12 } |
| 13 |
| 10 namespace views { | 14 namespace views { |
| 11 | 15 |
| 12 class View; | 16 class View; |
| 13 | 17 |
| 14 // ViewObserver is used to observe changes to a View. The first argument to all | 18 // ViewObserver is used to observe changes to a View. The first argument to all |
| 15 // ViewObserver functions is the View the observer was added to. | 19 // ViewObserver functions is the View the observer was added to. |
| 16 class VIEWS_EXPORT ViewObserver { | 20 class VIEWS_EXPORT ViewObserver { |
| 17 public: | 21 public: |
| 18 // Called when |child| is added as a child to |observed_view|. | 22 // Called when |child| is added as a child to |observed_view|. |
| 19 virtual void OnChildViewAdded(View* observed_view, View* child) {} | 23 virtual void OnChildViewAdded(View* observed_view, View* child) {} |
| (...skipping 11 matching lines...) Expand all Loading... |
| 31 // Called when the bounds of |observed_view| change. | 35 // Called when the bounds of |observed_view| change. |
| 32 virtual void OnViewBoundsChanged(View* observed_view) {} | 36 virtual void OnViewBoundsChanged(View* observed_view) {} |
| 33 | 37 |
| 34 // Called when a child is reordered among its siblings, specifically | 38 // Called when a child is reordered among its siblings, specifically |
| 35 // View::ReorderChildView() is called on |observed_view|. | 39 // View::ReorderChildView() is called on |observed_view|. |
| 36 virtual void OnChildViewReordered(View* observed_view, View* child) {} | 40 virtual void OnChildViewReordered(View* observed_view, View* child) {} |
| 37 | 41 |
| 38 // Called from ~View. | 42 // Called from ~View. |
| 39 virtual void OnViewIsDeleting(View* observed_view) {} | 43 virtual void OnViewIsDeleting(View* observed_view) {} |
| 40 | 44 |
| 45 virtual void OnThemeChanged(View* view) {} |
| 46 |
| 47 virtual void OnNativeThemeChanged(View* view, const ui::NativeTheme* theme) {} |
| 48 |
| 41 protected: | 49 protected: |
| 42 virtual ~ViewObserver() {} | 50 virtual ~ViewObserver() {} |
| 43 }; | 51 }; |
| 44 | 52 |
| 45 } // namespace views | 53 } // namespace views |
| 46 | 54 |
| 47 #endif // UI_VIEWS_VIEW_OBSERVER_H_ | 55 #endif // UI_VIEWS_VIEW_OBSERVER_H_ |
| OLD | NEW |