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

Side by Side Diff: ash/virtual_keyboard_controller.cc

Issue 2739763003: Moves maintaining ShellObservers back to Shell (Closed)
Patch Set: merge Created 3 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/virtual_keyboard_controller.h" 5 #include "ash/virtual_keyboard_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/common/keyboard/keyboard_ui.h" 9 #include "ash/common/keyboard/keyboard_ui.h"
10 #include "ash/common/system/tray/system_tray_notifier.h" 10 #include "ash/common/system/tray/system_tray_notifier.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 } 66 }
67 67
68 } // namespace 68 } // namespace
69 69
70 VirtualKeyboardController::VirtualKeyboardController() 70 VirtualKeyboardController::VirtualKeyboardController()
71 : has_external_keyboard_(false), 71 : has_external_keyboard_(false),
72 has_internal_keyboard_(false), 72 has_internal_keyboard_(false),
73 has_touchscreen_(false), 73 has_touchscreen_(false),
74 ignore_external_keyboard_(false) { 74 ignore_external_keyboard_(false) {
75 WmShell::Get()->AddShellObserver(this); 75 Shell::GetInstance()->AddShellObserver(this);
76 ui::InputDeviceManager::GetInstance()->AddObserver(this); 76 ui::InputDeviceManager::GetInstance()->AddObserver(this);
77 UpdateDevices(); 77 UpdateDevices();
78 } 78 }
79 79
80 VirtualKeyboardController::~VirtualKeyboardController() { 80 VirtualKeyboardController::~VirtualKeyboardController() {
81 WmShell::Get()->RemoveShellObserver(this); 81 Shell::GetInstance()->RemoveShellObserver(this);
82 ui::InputDeviceManager::GetInstance()->RemoveObserver(this); 82 ui::InputDeviceManager::GetInstance()->RemoveObserver(this);
83 } 83 }
84 84
85 void VirtualKeyboardController::OnMaximizeModeStarted() { 85 void VirtualKeyboardController::OnMaximizeModeStarted() {
86 if (!IsSmartVirtualKeyboardEnabled()) { 86 if (!IsSmartVirtualKeyboardEnabled()) {
87 SetKeyboardEnabled(true); 87 SetKeyboardEnabled(true);
88 } else { 88 } else {
89 UpdateKeyboardEnabled(); 89 UpdateKeyboardEnabled();
90 } 90 }
91 keyboard::SetOverscrollEnabledWithAccessibilityKeyboard(true); 91 keyboard::SetOverscrollEnabledWithAccessibilityKeyboard(true);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 if (is_enabled == was_enabled) 212 if (is_enabled == was_enabled)
213 return; 213 return;
214 if (is_enabled) { 214 if (is_enabled) {
215 Shell::GetInstance()->CreateKeyboard(); 215 Shell::GetInstance()->CreateKeyboard();
216 } else { 216 } else {
217 Shell::GetInstance()->DeactivateKeyboard(); 217 Shell::GetInstance()->DeactivateKeyboard();
218 } 218 }
219 } 219 }
220 220
221 } // namespace ash 221 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/rotation/tray_rotation_lock.cc ('k') | ash/wm/panels/attached_panel_window_targeter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698