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