OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AURA_WINDOW_OBSERVER_H_ | 5 #ifndef UI_AURA_WINDOW_OBSERVER_H_ |
6 #define UI_AURA_WINDOW_OBSERVER_H_ | 6 #define UI_AURA_WINDOW_OBSERVER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "ui/aura/aura_export.h" | 10 #include "ui/aura/aura_export.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // compared for equality with the property constant. |old| is the old property | 63 // compared for equality with the property constant. |old| is the old property |
64 // value, which must be cast to the appropriate type before use. | 64 // value, which must be cast to the appropriate type before use. |
65 virtual void OnWindowPropertyChanged(Window* window, | 65 virtual void OnWindowPropertyChanged(Window* window, |
66 const void* key, | 66 const void* key, |
67 intptr_t old) {} | 67 intptr_t old) {} |
68 | 68 |
69 // Invoked when SetVisible() is invoked on a window. |visible| is the | 69 // Invoked when SetVisible() is invoked on a window. |visible| is the |
70 // value supplied to SetVisible(). If |visible| is true, window->IsVisible() | 70 // value supplied to SetVisible(). If |visible| is true, window->IsVisible() |
71 // may still return false. See description in Window::IsVisible() for details. | 71 // may still return false. See description in Window::IsVisible() for details. |
72 virtual void OnWindowVisibilityChanging(Window* window, bool visible) {} | 72 virtual void OnWindowVisibilityChanging(Window* window, bool visible) {} |
| 73 |
| 74 // When the visibility of a Window changes OnWindowVisibilityChanged() is |
| 75 // called for all observers attached to descendants of the Window as well |
| 76 // as all observers attached to ancestors of the Window. The Window supplied |
| 77 // to OnWindowVisibilityChanged() is the Window that Show()/Hide() was called |
| 78 // on. |
73 virtual void OnWindowVisibilityChanged(Window* window, bool visible) {} | 79 virtual void OnWindowVisibilityChanged(Window* window, bool visible) {} |
74 | 80 |
75 // Invoked when SetBounds() is invoked on |window|. |old_bounds| and | 81 // Invoked when SetBounds() is invoked on |window|. |old_bounds| and |
76 // |new_bounds| are in parent coordinates. | 82 // |new_bounds| are in parent coordinates. |
77 virtual void OnWindowBoundsChanged(Window* window, | 83 virtual void OnWindowBoundsChanged(Window* window, |
78 const gfx::Rect& old_bounds, | 84 const gfx::Rect& old_bounds, |
79 const gfx::Rect& new_bounds) {} | 85 const gfx::Rect& new_bounds) {} |
80 | 86 |
81 // Invoked when SetTransform() is invoked on |window|. | 87 // Invoked when SetTransform() is invoked on |window|. |
82 virtual void OnWindowTransforming(Window* window) {} | 88 virtual void OnWindowTransforming(Window* window) {} |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Tracks the number of windows being observed to track down | 141 // Tracks the number of windows being observed to track down |
136 // http://crbug.com/365364. | 142 // http://crbug.com/365364. |
137 int observing_; | 143 int observing_; |
138 | 144 |
139 DISALLOW_COPY_AND_ASSIGN(WindowObserver); | 145 DISALLOW_COPY_AND_ASSIGN(WindowObserver); |
140 }; | 146 }; |
141 | 147 |
142 } // namespace aura | 148 } // namespace aura |
143 | 149 |
144 #endif // UI_AURA_WINDOW_OBSERVER_H_ | 150 #endif // UI_AURA_WINDOW_OBSERVER_H_ |
OLD | NEW |