| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_WM_CORE_DEFAULT_ACTIVATION_CLIENT_H_ | 5 #ifndef UI_WM_CORE_DEFAULT_ACTIVATION_CLIENT_H_ |
| 6 #define UI_WM_CORE_DEFAULT_ACTIVATION_CLIENT_H_ | 6 #define UI_WM_CORE_DEFAULT_ACTIVATION_CLIENT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "ui/aura/window_observer.h" | 13 #include "ui/aura/window_observer.h" |
| 14 #include "ui/wm/public/activation_change_observer.h" |
| 14 #include "ui/wm/public/activation_client.h" | 15 #include "ui/wm/public/activation_client.h" |
| 15 #include "ui/wm/wm_export.h" | 16 #include "ui/wm/wm_export.h" |
| 16 | 17 |
| 17 namespace aura { | 18 namespace aura { |
| 18 namespace client { | 19 namespace client { |
| 19 class ActivationChangeObserver; | 20 class ActivationChangeObserver; |
| 20 } | 21 } |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace wm { | 24 namespace wm { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 | 45 |
| 45 // Overridden from WindowObserver: | 46 // Overridden from WindowObserver: |
| 46 void OnWindowDestroyed(aura::Window* window) override; | 47 void OnWindowDestroyed(aura::Window* window) override; |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 class Deleter; | 50 class Deleter; |
| 50 | 51 |
| 51 ~DefaultActivationClient() override; | 52 ~DefaultActivationClient() override; |
| 52 void RemoveActiveWindow(aura::Window* window); | 53 void RemoveActiveWindow(aura::Window* window); |
| 53 | 54 |
| 55 void ActivateWindowImpl( |
| 56 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 57 aura::Window* window); |
| 58 |
| 54 // This class explicitly does NOT store the active window in a window property | 59 // This class explicitly does NOT store the active window in a window property |
| 55 // to make sure that ActivationChangeObserver is not treated as part of the | 60 // to make sure that ActivationChangeObserver is not treated as part of the |
| 56 // aura API. Assumptions to that end will cause tests that use this client to | 61 // aura API. Assumptions to that end will cause tests that use this client to |
| 57 // fail. | 62 // fail. |
| 58 std::vector<aura::Window*> active_windows_; | 63 std::vector<aura::Window*> active_windows_; |
| 59 | 64 |
| 60 // The window which was active before the currently active one. | 65 // The window which was active before the currently active one. |
| 61 aura::Window* last_active_; | 66 aura::Window* last_active_; |
| 62 | 67 |
| 63 ObserverList<aura::client::ActivationChangeObserver> observers_; | 68 ObserverList<aura::client::ActivationChangeObserver> observers_; |
| 64 | 69 |
| 65 DISALLOW_COPY_AND_ASSIGN(DefaultActivationClient); | 70 DISALLOW_COPY_AND_ASSIGN(DefaultActivationClient); |
| 66 }; | 71 }; |
| 67 | 72 |
| 68 } // namespace wm | 73 } // namespace wm |
| 69 | 74 |
| 70 #endif // UI_WM_CORE_DEFAULT_ACTIVATION_CLIENT_H_ | 75 #endif // UI_WM_CORE_DEFAULT_ACTIVATION_CLIENT_H_ |
| OLD | NEW |