Chromium Code Reviews| Index: chromecast/graphics/cast_window_manager_aura.h |
| diff --git a/chromecast/graphics/cast_window_manager_aura.h b/chromecast/graphics/cast_window_manager_aura.h |
| index 8ce021d61ab986347357cd8b2287d570db256874..dc3f3271958ae4dba2a3cfc3d05c4c2aa78c4e96 100644 |
| --- a/chromecast/graphics/cast_window_manager_aura.h |
| +++ b/chromecast/graphics/cast_window_manager_aura.h |
| @@ -6,11 +6,14 @@ |
| #define CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_AURA_H_ |
| #include <memory> |
| +#include <vector> |
| #include "base/macros.h" |
| #include "base/observer_list.h" |
| #include "chromecast/graphics/cast_vsync_settings.h" |
| #include "chromecast/graphics/cast_window_manager.h" |
| +#include "ui/aura/client/focus_client.h" |
| +#include "ui/aura/window_observer.h" |
| namespace aura { |
| class Window; |
| @@ -24,7 +27,9 @@ namespace chromecast { |
| class CastWindowTreeHost; |
| class CastWindowManagerAura : public CastWindowManager, |
| - private CastVSyncSettings::Observer { |
| + private CastVSyncSettings::Observer, |
| + private aura::WindowObserver, |
| + private aura::client::FocusClient { |
| public: |
| ~CastWindowManagerAura() override; |
| @@ -32,6 +37,13 @@ class CastWindowManagerAura : public CastWindowManager, |
| void TearDown() override; |
| void AddWindow(gfx::NativeView window) override; |
| + // aura::client::FocusClient implementation: |
| + void AddObserver(aura::client::FocusChangeObserver* observer) override; |
| + void RemoveObserver(aura::client::FocusChangeObserver* observer) override; |
| + void FocusWindow(aura::Window* window) override; |
| + void ResetFocusWithinActiveWindow(aura::Window* window) override; |
| + aura::Window* GetFocusedWindow() override; |
| + |
| private: |
| friend class CastWindowManager; |
| @@ -41,12 +53,34 @@ class CastWindowManagerAura : public CastWindowManager, |
| // CastVSyncSettings::Observer implementation: |
| void OnVSyncIntervalChanged(base::TimeDelta interval) override; |
| + // aura::WindowObserver implementation: |
| + void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; |
| + void OnWindowDestroying(aura::Window* window) override; |
| + void OnWindowHierarchyChanging(const HierarchyChangeParams& params) override; |
| + |
| void Setup(); |
| const bool enable_input_; |
| std::unique_ptr<CastWindowTreeHost> window_tree_host_; |
| + base::ObserverList<aura::client::FocusChangeObserver> focus_observers_; |
| std::unique_ptr<aura::client::DefaultCaptureClient> capture_client_; |
| + // Track the currently focused window, which isn't necessarily a top-level |
| + // window. |
| + aura::Window* focused_window_; |
| + // Track the windows that we've focused in the past, so that we can restore |
| + // focus to them. We assume that this is a small list so that we can perform |
| + // linear ops on it. |
| + std::vector<aura::Window*> focusable_windows_; |
| + |
| + // Change the focused window and notify focus observers. |
| + void UpdateWindowFocus(aura::Window* skip); |
|
halliwell
2017/01/19 20:49:17
what does 'skip' mean?
Joshua LeVasseur
2017/01/23 23:38:32
It was redundant, so removed.
|
| + // Get the window that should be focused. |
| + aura::Window* GetWindowToFocus(aura::Window* skip); |
| + |
| + // Return the top-level window for |window|. |
| + aura::Window* GetTopLevelWindow(aura::Window* window); |
| + |
| DISALLOW_COPY_AND_ASSIGN(CastWindowManagerAura); |
| }; |