| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ASH_WM_WINDOW_MANAGER_EXTENSION_H_ |
| 6 #define ASH_WM_WINDOW_MANAGER_EXTENSION_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "ash/ash_export.h" |
| 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" |
| 13 #include "ui/aura/client/activation_change_observer.h" |
| 14 #include "ui/aura/env_observer.h" |
| 15 #include "ui/aura/window_observer.h" |
| 16 |
| 17 namespace ash { |
| 18 |
| 19 class WindowManagerExtensionDelegate { |
| 20 public: |
| 21 virtual ~WindowManagerExtensionDelegate() {} |
| 22 |
| 23 virtual void OnWindowCreated(const aura::Window* window) = 0; |
| 24 |
| 25 virtual void OnWindowClosed(const aura::Window* window) = 0; |
| 26 |
| 27 virtual void OnWindowHidden(const aura::Window* window) = 0; |
| 28 |
| 29 virtual void OnWindowShown(const aura::Window* window) = 0; |
| 30 |
| 31 virtual void OnActiveWindowChanged(const aura::Window* window) = 0; |
| 32 }; |
| 33 |
| 34 namespace internal { |
| 35 |
| 36 class WindowManagerExtension : public aura::EnvObserver, |
| 37 public aura::WindowObserver, |
| 38 public aura::client::ActivationChangeObserver { |
| 39 public: |
| 40 WindowManagerExtension(); |
| 41 virtual ~WindowManagerExtension(); |
| 42 |
| 43 void set_delegate(WindowManagerExtensionDelegate* delegate) { |
| 44 delegate_ = delegate; |
| 45 } |
| 46 |
| 47 private: |
| 48 // Overridden from aura::EnvObserver: |
| 49 virtual void OnWindowInitialized(aura::Window* window) OVERRIDE; |
| 50 |
| 51 // Overridden from aura::WindowObserver: |
| 52 virtual void OnWindowVisibilityChanged(aura::Window* window, |
| 53 bool visible) OVERRIDE; |
| 54 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; |
| 55 |
| 56 // Overridden from aura::client::ActivationChangeObserver: |
| 57 virtual void OnWindowActivated(aura::Window* active, |
| 58 aura::Window* old_active) OVERRIDE; |
| 59 |
| 60 std::vector<aura::Window*> windows_; |
| 61 WindowManagerExtensionDelegate* delegate_; |
| 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(WindowManagerExtension); |
| 64 }; |
| 65 |
| 66 } // namespace internal |
| 67 } // namespace ash |
| 68 |
| 69 #endif // ASH_WM_WINDOW_MANAGER_EXTENSION_H_ |
| OLD | NEW |