| 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 #include "ash/common/keyboard/keyboard_ui.h" | 5 #include "ash/common/keyboard/keyboard_ui.h" |
| 6 | 6 |
| 7 #include "ash/common/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
| 8 #include "ash/common/keyboard/keyboard_ui_observer.h" | 8 #include "ash/common/keyboard/keyboard_ui_observer.h" |
| 9 #include "ash/common/system/accessibility_observer.h" | 9 #include "ash/common/system/accessibility_observer.h" |
| 10 #include "ash/common/system/tray/system_tray_notifier.h" | 10 #include "ash/common/system/tray/system_tray_notifier.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // KeyboardUI: | 29 // KeyboardUI: |
| 30 void Show() override { | 30 void Show() override { |
| 31 keyboard::KeyboardController::GetInstance()->ShowKeyboard(true); | 31 keyboard::KeyboardController::GetInstance()->ShowKeyboard(true); |
| 32 } | 32 } |
| 33 void Hide() override { | 33 void Hide() override { |
| 34 // Do nothing as this is called from ash::Shell, which also calls through | 34 // Do nothing as this is called from ash::Shell, which also calls through |
| 35 // to the appropriate keyboard functions. | 35 // to the appropriate keyboard functions. |
| 36 } | 36 } |
| 37 bool IsEnabled() override { | 37 bool IsEnabled() override { |
| 38 return WmShell::Get() | 38 return WmShell::Get()->accessibility_delegate()->IsVirtualKeyboardEnabled(); |
| 39 ->GetAccessibilityDelegate() | |
| 40 ->IsVirtualKeyboardEnabled(); | |
| 41 } | 39 } |
| 42 | 40 |
| 43 // AccessibilityObserver: | 41 // AccessibilityObserver: |
| 44 void OnAccessibilityModeChanged( | 42 void OnAccessibilityModeChanged( |
| 45 AccessibilityNotificationVisibility notify) override { | 43 AccessibilityNotificationVisibility notify) override { |
| 46 FOR_EACH_OBSERVER(KeyboardUIObserver, *observers(), | 44 FOR_EACH_OBSERVER(KeyboardUIObserver, *observers(), |
| 47 OnKeyboardEnabledStateChanged(IsEnabled())); | 45 OnKeyboardEnabledStateChanged(IsEnabled())); |
| 48 } | 46 } |
| 49 | 47 |
| 50 private: | 48 private: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 62 observers_.AddObserver(observer); | 60 observers_.AddObserver(observer); |
| 63 } | 61 } |
| 64 | 62 |
| 65 void KeyboardUI::RemoveObserver(KeyboardUIObserver* observer) { | 63 void KeyboardUI::RemoveObserver(KeyboardUIObserver* observer) { |
| 66 observers_.RemoveObserver(observer); | 64 observers_.RemoveObserver(observer); |
| 67 } | 65 } |
| 68 | 66 |
| 69 KeyboardUI::KeyboardUI() {} | 67 KeyboardUI::KeyboardUI() {} |
| 70 | 68 |
| 71 } // namespace ash | 69 } // namespace ash |
| OLD | NEW |