| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_COMMON_KEYBOARD_KEYBOARD_UI_H_ | 5 #ifndef ASH_COMMON_KEYBOARD_KEYBOARD_UI_H_ |
| 6 #define ASH_COMMON_KEYBOARD_KEYBOARD_UI_H_ | 6 #define ASH_COMMON_KEYBOARD_KEYBOARD_UI_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 | 13 |
| 14 namespace ash { | 14 namespace ash { |
| 15 | 15 |
| 16 class KeyboardUIObserver; | 16 class KeyboardUIObserver; |
| 17 | 17 |
| 18 // KeyboardUI wraps the appropriate keyboard ui depending upon whether ash is | 18 // KeyboardUI wraps the appropriate keyboard ui depending upon whether ash is |
| 19 // running in mus or non-mus. | 19 // running in mus or non-mus. |
| 20 class ASH_EXPORT KeyboardUI { | 20 class ASH_EXPORT KeyboardUI { |
| 21 public: | 21 public: |
| 22 virtual ~KeyboardUI(); | 22 virtual ~KeyboardUI(); |
| 23 | 23 |
| 24 static std::unique_ptr<KeyboardUI> Create(); | 24 static std::unique_ptr<KeyboardUI> Create(); |
| 25 | 25 |
| 26 virtual void Show() = 0; | |
| 27 virtual void ShowInDisplay(const int64_t display_id) = 0; | 26 virtual void ShowInDisplay(const int64_t display_id) = 0; |
| 28 virtual void Hide() = 0; | 27 virtual void Hide() = 0; |
| 29 | 28 |
| 30 // Returns true if the keyboard is enabled. | 29 // Returns true if the keyboard is enabled. |
| 31 virtual bool IsEnabled() = 0; | 30 virtual bool IsEnabled() = 0; |
| 32 | 31 |
| 33 void AddObserver(KeyboardUIObserver* observer); | 32 void AddObserver(KeyboardUIObserver* observer); |
| 34 void RemoveObserver(KeyboardUIObserver* observer); | 33 void RemoveObserver(KeyboardUIObserver* observer); |
| 35 | 34 |
| 36 // Applist also queries this for bounds. If app list remains in ash then | 35 // Applist also queries this for bounds. If app list remains in ash then |
| 37 // we need to plumb bounds through here too. | 36 // we need to plumb bounds through here too. |
| 38 | 37 |
| 39 protected: | 38 protected: |
| 40 KeyboardUI(); | 39 KeyboardUI(); |
| 41 | 40 |
| 42 base::ObserverList<KeyboardUIObserver>* observers() { return &observers_; } | 41 base::ObserverList<KeyboardUIObserver>* observers() { return &observers_; } |
| 43 | 42 |
| 44 private: | 43 private: |
| 45 base::ObserverList<KeyboardUIObserver> observers_; | 44 base::ObserverList<KeyboardUIObserver> observers_; |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 } // namespace ash | 47 } // namespace ash |
| 49 | 48 |
| 50 #endif // ASH_COMMON_KEYBOARD_KEYBOARD_UI_H_ | 49 #endif // ASH_COMMON_KEYBOARD_KEYBOARD_UI_H_ |
| OLD | NEW |