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_TEST_TEST_ACTIVATION_CLIENT_H_ | 5 #ifndef UI_AURA_TEST_TEST_ACTIVATION_CLIENT_H_ |
6 #define UI_AURA_TEST_TEST_ACTIVATION_CLIENT_H_ | 6 #define UI_AURA_TEST_TEST_ACTIVATION_CLIENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "ui/aura/client/activation_client.h" | 11 #include "ui/aura/client/activation_client.h" |
12 #include "ui/aura/window_observer.h" | 12 #include "ui/aura/window_observer.h" |
13 | 13 |
14 namespace aura { | 14 namespace aura { |
15 namespace test { | 15 namespace test { |
16 | 16 |
17 class TestActivationClient : public ActivationClient, public WindowObserver { | 17 class TestActivationClient : public client::ActivationClient, |
| 18 public WindowObserver { |
18 public: | 19 public: |
19 TestActivationClient(); | 20 TestActivationClient(); |
20 virtual ~TestActivationClient(); | 21 virtual ~TestActivationClient(); |
21 | 22 |
22 // Overridden from ActivationClient: | 23 // Overridden from client::ActivationClient: |
23 virtual void ActivateWindow(Window* window) OVERRIDE; | 24 virtual void ActivateWindow(Window* window) OVERRIDE; |
24 virtual void DeactivateWindow(Window* window) OVERRIDE; | 25 virtual void DeactivateWindow(Window* window) OVERRIDE; |
25 virtual Window* GetActiveWindow() OVERRIDE; | 26 virtual Window* GetActiveWindow() OVERRIDE; |
26 virtual bool CanFocusWindow(Window* window) const OVERRIDE; | 27 virtual bool CanFocusWindow(Window* window) const OVERRIDE; |
27 | 28 |
28 // Overridden from WindowObserver: | 29 // Overridden from WindowObserver: |
29 virtual void OnWindowDestroyed(Window* window) OVERRIDE; | 30 virtual void OnWindowDestroyed(Window* window) OVERRIDE; |
30 | 31 |
31 private: | 32 private: |
32 // This class explicitly does NOT store the active window in a window property | 33 // This class explicitly does NOT store the active window in a window property |
33 // to make sure that storing the active window in a property is not treated as | 34 // to make sure that storing the active window in a property is not treated as |
34 // part of the aura API. Assumptions to that end will cause tests that use | 35 // part of the aura API. Assumptions to that end will cause tests that use |
35 // this client to fail. | 36 // this client to fail. |
36 Window* active_window_; | 37 Window* active_window_; |
37 | 38 |
38 DISALLOW_COPY_AND_ASSIGN(TestActivationClient); | 39 DISALLOW_COPY_AND_ASSIGN(TestActivationClient); |
39 }; | 40 }; |
40 | 41 |
41 } // namespace test | 42 } // namespace test |
42 } // namespace aura | 43 } // namespace aura |
43 | 44 |
44 #endif // UI_AURA_TEST_TEST_ACTIVATION_CLIENT_H_ | 45 #endif // UI_AURA_TEST_TEST_ACTIVATION_CLIENT_H_ |
OLD | NEW |