| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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 HEADLESS_LIB_BROWSER_HEADLESS_FOCUS_CLIENT_H_ |
| 6 #define HEADLESS_LIB_BROWSER_HEADLESS_FOCUS_CLIENT_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" |
| 10 #include "base/observer_list.h" |
| 11 #include "base/scoped_observer.h" |
| 12 #include "ui/aura/client/focus_client.h" |
| 13 #include "ui/aura/window_observer.h" |
| 14 |
| 15 namespace headless { |
| 16 |
| 17 class HeadlessFocusClient : public aura::client::FocusClient, |
| 18 public aura::WindowObserver { |
| 19 public: |
| 20 HeadlessFocusClient(); |
| 21 ~HeadlessFocusClient() override; |
| 22 |
| 23 private: |
| 24 // Overridden from aura::client::FocusClient: |
| 25 void AddObserver(aura::client::FocusChangeObserver* observer) override; |
| 26 void RemoveObserver(aura::client::FocusChangeObserver* observer) override; |
| 27 void FocusWindow(aura::Window* window) override; |
| 28 void ResetFocusWithinActiveWindow(aura::Window* window) override; |
| 29 aura::Window* GetFocusedWindow() override; |
| 30 |
| 31 // Overridden from aura::WindowObserver: |
| 32 void OnWindowDestroying(aura::Window* window) override; |
| 33 |
| 34 std::set<aura::Window*> focused_windows_; |
| 35 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; |
| 36 base::ObserverList<aura::client::FocusChangeObserver> focus_observers_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(HeadlessFocusClient); |
| 39 }; |
| 40 |
| 41 } // namespace headless |
| 42 |
| 43 #endif // HEADLESS_LIB_BROWSER_HEADLESS_FOCUS_CLIENT_H_ |
| OLD | NEW |