| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/aura/aura_export.h" | 9 #include "ui/aura/aura_export.h" |
| 10 | 10 |
| 11 namespace gfx { |
| 12 class Rect; |
| 13 } // namespace gfx |
| 14 |
| 11 namespace aura { | 15 namespace aura { |
| 12 | 16 |
| 13 class Window; | 17 class Window; |
| 14 | 18 |
| 15 class AURA_EXPORT WindowObserver { | 19 class AURA_EXPORT WindowObserver { |
| 16 public: | 20 public: |
| 17 // Invoked when the Window |new_window| has been added. | 21 // Invoked when |new_window| has been added as a child of this window. |
| 18 virtual void OnWindowAdded(Window* new_window) {} | 22 virtual void OnWindowAdded(Window* new_window) {} |
| 19 | 23 |
| 20 // Invoked prior to removing |window|. | 24 // Invoked prior to removing |window| as a child of this window. |
| 21 virtual void OnWillRemoveWindow(Window* window) {} | 25 virtual void OnWillRemoveWindow(Window* window) {} |
| 22 | 26 |
| 23 // Invoked when |SetProperty| or |SetIntProperty| is called on |window|. | 27 // Invoked when this window's parent window changes. |parent| may be NULL. |
| 28 virtual void OnWindowParentChanged(Window* window, Window* parent) {} |
| 29 |
| 30 // Invoked when SetProperty() or SetIntProperty() is called on |window|. |
| 24 // |old| is the old property value. | 31 // |old| is the old property value. |
| 25 virtual void OnPropertyChanged(Window* window, const char* key, void* old) {} | 32 virtual void OnPropertyChanged(Window* window, const char* key, void* old) {} |
| 26 | 33 |
| 27 // Invoked when the SetVisible() is invoked on a window. |visible| is the | 34 // Invoked when SetVisible() is invoked on a window. |visible| is the |
| 28 // value supplied to SetVisible(). If |visible| is true, window->IsVisible() | 35 // value supplied to SetVisible(). If |visible| is true, window->IsVisible() |
| 29 // may still return false. See description in Window::IsVisible() for details. | 36 // may still return false. See description in Window::IsVisible() for details. |
| 30 virtual void OnWindowVisibilityChanged(Window* window, bool visible) {} | 37 virtual void OnWindowVisibilityChanged(Window* window, bool visible) {} |
| 31 | 38 |
| 39 // Invoked when SetBounds() is invoked on |window|. |bounds| contains the |
| 40 // window's new bounds. |
| 41 virtual void OnWindowBoundsChanged(Window* window, const gfx::Rect& bounds) {} |
| 42 |
| 43 // Invoked when |window|'s position among its siblings in the stacking order |
| 44 // has changed. |
| 45 virtual void OnWindowStackingChanged(Window* window) {} |
| 46 |
| 32 // Invoked when the Window has been destroyed (i.e. from its destructor). | 47 // Invoked when the Window has been destroyed (i.e. from its destructor). |
| 33 virtual void OnWindowDestroyed(Window* window) {} | 48 virtual void OnWindowDestroyed(Window* window) {} |
| 34 | 49 |
| 35 protected: | 50 protected: |
| 36 virtual ~WindowObserver() {} | 51 virtual ~WindowObserver() {} |
| 37 }; | 52 }; |
| 38 | 53 |
| 39 } // namespace aura | 54 } // namespace aura |
| 40 | 55 |
| 41 #endif // UI_AURA_WINDOW_OBSERVER_H_ | 56 #endif // UI_AURA_WINDOW_OBSERVER_H_ |
| OLD | NEW |