| 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_CLIENT_ACTIVATION_CLIENT_H_ | 5 #ifndef UI_AURA_CLIENT_ACTIVATION_CLIENT_H_ |
| 6 #define UI_AURA_CLIENT_ACTIVATION_CLIENT_H_ | 6 #define UI_AURA_CLIENT_ACTIVATION_CLIENT_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 | |
| 13 class Window; | 12 class Window; |
| 13 namespace client { |
| 14 | 14 |
| 15 // An interface implemented by an object that manages window activation. | 15 // An interface implemented by an object that manages window activation. |
| 16 class AURA_EXPORT ActivationClient { | 16 class AURA_EXPORT ActivationClient { |
| 17 public: | 17 public: |
| 18 // Sets/Gets the activation client on the RootWindow. | |
| 19 static void SetActivationClient(ActivationClient* client); | |
| 20 static ActivationClient* GetActivationClient(); | |
| 21 | |
| 22 // Activates |window|. If |window| is NULL, nothing happens. | 18 // Activates |window|. If |window| is NULL, nothing happens. |
| 23 virtual void ActivateWindow(Window* window) = 0; | 19 virtual void ActivateWindow(Window* window) = 0; |
| 24 | 20 |
| 25 // Deactivates |window|. What (if anything) is activated next is up to the | 21 // Deactivates |window|. What (if anything) is activated next is up to the |
| 26 // client. If |window| is NULL, nothing happens. | 22 // client. If |window| is NULL, nothing happens. |
| 27 virtual void DeactivateWindow(Window* window) = 0; | 23 virtual void DeactivateWindow(Window* window) = 0; |
| 28 | 24 |
| 29 // Retrieves the active window, or NULL if there is none. | 25 // Retrieves the active window, or NULL if there is none. |
| 30 virtual aura::Window* GetActiveWindow() = 0; | 26 virtual aura::Window* GetActiveWindow() = 0; |
| 31 | 27 |
| 32 // Returns true if |window| can be focused. To be focusable, |window| must | 28 // Returns true if |window| can be focused. To be focusable, |window| must |
| 33 // exist inside an activatable window. | 29 // exist inside an activatable window. |
| 34 virtual bool CanFocusWindow(Window* window) const = 0; | 30 virtual bool CanFocusWindow(Window* window) const = 0; |
| 35 | 31 |
| 36 protected: | 32 protected: |
| 37 virtual ~ActivationClient() {} | 33 virtual ~ActivationClient() {} |
| 38 }; | 34 }; |
| 39 | 35 |
| 36 // Sets/Gets the activation client on the RootWindow. |
| 37 AURA_EXPORT void SetActivationClient(ActivationClient* client); |
| 38 AURA_EXPORT ActivationClient* GetActivationClient(); |
| 39 |
| 40 } // namespace clients |
| 40 } // namespace aura | 41 } // namespace aura |
| 41 | 42 |
| 42 #endif // UI_AURA_CLIENT_ACTIVATION_CLIENT_H_ | 43 #endif // UI_AURA_CLIENT_ACTIVATION_CLIENT_H_ |
| OLD | NEW |