| 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 aura { | 11 namespace aura { |
| 12 | 12 |
| 13 class Window; | 13 class Window; |
| 14 | 14 |
| 15 class AURA_EXPORT WindowObserver { | 15 class AURA_EXPORT WindowObserver { |
| 16 public: | 16 public: |
| 17 // Invoked when the Window |new_window| has been added. | 17 // Invoked when the Window |new_window| has been added. |
| 18 virtual void OnWindowAdded(Window* new_window) {} | 18 virtual void OnWindowAdded(Window* new_window) {} |
| 19 | 19 |
| 20 // Invoked prior to removing |window|. | 20 // Invoked prior to removing |window|. |
| 21 virtual void OnWillRemoveWindow(Window* window) {} | 21 virtual void OnWillRemoveWindow(Window* window) {} |
| 22 | 22 |
| 23 // Invoked when |SetProperty| or |SetIntProperty| is called on |window|. |
| 24 // |old| is the old property value. |
| 25 virtual void OnPropertyChanged(Window* window, const char* key, void* old) {} |
| 26 |
| 23 // Invoked when the SetVisible() is invoked on a window. |visible| is the | 27 // Invoked when the SetVisible() is invoked on a window. |visible| is the |
| 24 // value supplied to SetVisible(). If |visible| is true, window->IsVisible() | 28 // value supplied to SetVisible(). If |visible| is true, window->IsVisible() |
| 25 // may still return false. See description in Window::IsVisible() for details. | 29 // may still return false. See description in Window::IsVisible() for details. |
| 26 virtual void OnWindowVisibilityChanged(Window* window, bool visible) {} | 30 virtual void OnWindowVisibilityChanged(Window* window, bool visible) {} |
| 27 | 31 |
| 28 // Invoked when the Window has been destroyed (i.e. from its destructor). | 32 // Invoked when the Window has been destroyed (i.e. from its destructor). |
| 29 virtual void OnWindowDestroyed(Window* window) {} | 33 virtual void OnWindowDestroyed(Window* window) {} |
| 30 | 34 |
| 31 protected: | 35 protected: |
| 32 virtual ~WindowObserver() {} | 36 virtual ~WindowObserver() {} |
| 33 }; | 37 }; |
| 34 | 38 |
| 35 } // namespace aura | 39 } // namespace aura |
| 36 | 40 |
| 37 #endif // UI_AURA_WINDOW_OBSERVER_H_ | 41 #endif // UI_AURA_WINDOW_OBSERVER_H_ |
| OLD | NEW |