Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Side by Side Diff: ui/views/view_observer.h

Issue 2500623002: Add ViewObserver to View for view updates (Closed)
Patch Set: Change OnViewParentChanged to OnChildViewAdded/Removed Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 when |child| is added to its parent. Invoked on the parent which has
20 // the |child| added to it.
21 virtual void OnChildViewAdded(View* child) {}
22
23 // Called when |child| is removed from its |parent|.
24 virtual void OnChildViewRemoved(View* child, View* parent) {}
25
26 // Called when View::SetVisible() is called with a new value.
27 // The |view| may still be 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 moved.
36 virtual void OnChildViewReordered(View* view) {}
37
38 protected:
39 virtual ~ViewObserver() {}
40 };
41
42 } // namespace views
43
44 #endif // UI_VIEWS_VIEW_OBSERVER_H_
OLDNEW
« ui/views/view.h ('K') | « ui/views/view.cc ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698