| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 ASH_KEYBOARD_KEYBOARD_OBSERVER_REGISTER_H_ | 5 #ifndef ASH_KEYBOARD_KEYBOARD_OBSERVER_REGISTER_H_ |
| 6 #define ASH_KEYBOARD_KEYBOARD_OBSERVER_REGISTER_H_ | 6 #define ASH_KEYBOARD_KEYBOARD_OBSERVER_REGISTER_H_ |
| 7 | 7 |
| 8 #include "base/scoped_observer.h" | 8 #include "base/scoped_observer.h" |
| 9 | 9 |
| 10 namespace aura { |
| 11 class Window; |
| 12 } |
| 13 |
| 10 namespace keyboard { | 14 namespace keyboard { |
| 11 class KeyboardController; | 15 class KeyboardController; |
| 12 class KeyboardControllerObserver; | 16 class KeyboardControllerObserver; |
| 13 } | 17 } |
| 14 | 18 |
| 15 namespace ash { | 19 namespace ash { |
| 16 | 20 |
| 17 class WmWindow; | |
| 18 | |
| 19 // Helper function to start/stop observing KeyboardController. | 21 // Helper function to start/stop observing KeyboardController. |
| 20 // |keyboard_root_window| is the root window where KeyboardController changes | 22 // |keyboard_root_window| is the root window where KeyboardController changes |
| 21 // states. |observer_root_window| is the root window relevant to the | 23 // states. |observer_root_window| is the root window relevant to the |
| 22 // |keyboard_observer|. If |keyboard_root_window| is different from | 24 // |keyboard_observer|. If |keyboard_root_window| is different from |
| 23 // |observer_root_window|, this function is a no-op. Otherwise, the observing | 25 // |observer_root_window|, this function is a no-op. Otherwise, the observing |
| 24 // starts if |keyboard_activated| is true and stops if |keyboard_activated| is | 26 // starts if |keyboard_activated| is true and stops if |keyboard_activated| is |
| 25 // false. | 27 // false. |
| 26 void UpdateKeyboardObserverFromStateChanged( | 28 void UpdateKeyboardObserverFromStateChanged( |
| 27 bool keyboard_activated, | 29 bool keyboard_activated, |
| 28 WmWindow* keyboard_root_window, | 30 aura::Window* keyboard_root_window, |
| 29 WmWindow* observer_root_window, | 31 aura::Window* observer_root_window, |
| 30 ScopedObserver<keyboard::KeyboardController, | 32 ScopedObserver<keyboard::KeyboardController, |
| 31 keyboard::KeyboardControllerObserver>* keyboard_observer); | 33 keyboard::KeyboardControllerObserver>* keyboard_observer); |
| 32 | 34 |
| 33 } // namespace ash | 35 } // namespace ash |
| 34 | 36 |
| 35 #endif // ASH_KEYBOARD_KEYBOARD_OBSERVER_REGISTER_H_ | 37 #endif // ASH_KEYBOARD_KEYBOARD_OBSERVER_REGISTER_H_ |
| OLD | NEW |