Index: ui/wm/public/activation_client.h |
diff --git a/ui/wm/public/activation_client.h b/ui/wm/public/activation_client.h |
index 0607ea1efbecce05bb77998dcf6e5d981d243750..401ceb559ef0de44ac4f7777e600fde94541b06f 100644 |
--- a/ui/wm/public/activation_client.h |
+++ b/ui/wm/public/activation_client.h |
@@ -28,7 +28,11 @@ class AURA_EXPORT ActivationClient { |
virtual void DeactivateWindow(Window* window) = 0; |
// Retrieves the active window, or NULL if there is none. |
- virtual Window* GetActiveWindow() = 0; |
+ Window* GetActiveWindow() { |
+ return const_cast<Window*>( |
+ const_cast<const ActivationClient*>(this)->GetActiveWindow()); |
+ } |
+ virtual const Window* GetActiveWindow() const = 0; |
alokp
2017/04/18 16:57:29
non-owner nit: I personally find *const* interface
sky
2017/04/18 17:16:05
This function is intended to be a trivial getter,
alokp
2017/04/18 18:48:33
Which is what I meant by making assumptions about
sky
2017/04/18 19:08:13
IsActiveWindow() requires the ActivationClient, wh
|
// Retrieves the activatable window for |window|, or NULL if there is none. |
// Note that this is often but not always the toplevel window (see |
@@ -52,6 +56,8 @@ class AURA_EXPORT ActivationClient { |
AURA_EXPORT void SetActivationClient(Window* root_window, |
ActivationClient* client); |
AURA_EXPORT ActivationClient* GetActivationClient(Window* root_window); |
+AURA_EXPORT const ActivationClient* GetActivationClient( |
+ const Window* root_window); |
// Some types of transient window are only visible when active. |
// The transient parents of these windows may have visual appearance properties |