Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: ash/common/keyboard/keyboard_ui.cc

Issue 2154523002: Move AccessibilityDelegate ownership to ash::WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setmediadelegate
Patch Set: fix mash_unittests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/aura/wm_shell_aura.cc ('k') | ash/common/system/ime/tray_ime_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/aura/wm_shell_aura.cc ('k') | ash/common/system/ime/tray_ime_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698