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

Side by Side Diff: ash/shell.cc

Issue 2445293002: Make the virtual keyboard show up on the display with input focus. (Closed)
Patch Set: fix one more compilation error on Windows Created 4 years 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/root_window_controller_unittest.cc ('k') | ash/virtual_keyboard_controller.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 observer.OnCastingSessionStartedOrStopped(started); 306 observer.OnCastingSessionStartedOrStopped(started);
307 #endif 307 #endif
308 } 308 }
309 309
310 void Shell::OnRootWindowAdded(WmWindow* root_window) { 310 void Shell::OnRootWindowAdded(WmWindow* root_window) {
311 for (auto& observer : *wm_shell_->shell_observers()) 311 for (auto& observer : *wm_shell_->shell_observers())
312 observer.OnRootWindowAdded(root_window); 312 observer.OnRootWindowAdded(root_window);
313 } 313 }
314 314
315 void Shell::CreateKeyboard() { 315 void Shell::CreateKeyboard() {
316 // TODO(bshe): Primary root window controller may not be the controller to
317 // attach virtual keyboard. See http://crbug.com/303429
318 InitKeyboard(); 316 InitKeyboard();
319 GetPrimaryRootWindowController()->ActivateKeyboard( 317 GetPrimaryRootWindowController()->ActivateKeyboard(
320 keyboard::KeyboardController::GetInstance()); 318 keyboard::KeyboardController::GetInstance());
321 } 319 }
322 320
323 void Shell::DeactivateKeyboard() { 321 void Shell::DeactivateKeyboard() {
324 // TODO(jamescook): Move keyboard create and hide into WmShell. 322 // TODO(jamescook): Move keyboard create and hide into WmShell.
325 wm_shell_->keyboard_ui()->Hide(); 323 wm_shell_->keyboard_ui()->Hide();
326 if (keyboard::KeyboardController::GetInstance()) { 324 if (keyboard::KeyboardController::GetInstance()) {
327 RootWindowControllerList controllers = GetAllRootWindowControllers(); 325 RootWindowControllerList controllers = GetAllRootWindowControllers();
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 void Shell::InitKeyboard() { 836 void Shell::InitKeyboard() {
839 if (keyboard::IsKeyboardEnabled()) { 837 if (keyboard::IsKeyboardEnabled()) {
840 if (keyboard::KeyboardController::GetInstance()) { 838 if (keyboard::KeyboardController::GetInstance()) {
841 RootWindowControllerList controllers = GetAllRootWindowControllers(); 839 RootWindowControllerList controllers = GetAllRootWindowControllers();
842 for (RootWindowControllerList::iterator iter = controllers.begin(); 840 for (RootWindowControllerList::iterator iter = controllers.begin();
843 iter != controllers.end(); ++iter) { 841 iter != controllers.end(); ++iter) {
844 (*iter)->DeactivateKeyboard( 842 (*iter)->DeactivateKeyboard(
845 keyboard::KeyboardController::GetInstance()); 843 keyboard::KeyboardController::GetInstance());
846 } 844 }
847 } 845 }
846 #if defined(OS_CHROMEOS)
848 keyboard::KeyboardController::ResetInstance( 847 keyboard::KeyboardController::ResetInstance(
849 new keyboard::KeyboardController( 848 new keyboard::KeyboardController(
850 wm_shell_->delegate()->CreateKeyboardUI())); 849 wm_shell_->delegate()->CreateKeyboardUI(),
850 virtual_keyboard_controller_.get()));
851 #else
852 keyboard::KeyboardController::ResetInstance(
853 new keyboard::KeyboardController(
854 wm_shell_->delegate()->CreateKeyboardUI(), nullptr));
855
856 #endif
851 } 857 }
852 } 858 }
853 859
854 void Shell::InitRootWindow(aura::Window* root_window) { 860 void Shell::InitRootWindow(aura::Window* root_window) {
855 DCHECK(activation_client_); 861 DCHECK(activation_client_);
856 DCHECK(visibility_controller_.get()); 862 DCHECK(visibility_controller_.get());
857 DCHECK(drag_drop_controller_.get()); 863 DCHECK(drag_drop_controller_.get());
858 864
859 aura::client::SetFocusClient(root_window, focus_client_.get()); 865 aura::client::SetFocusClient(root_window, focus_client_.get());
860 aura::client::SetActivationClient(root_window, activation_client_); 866 aura::client::SetActivationClient(root_window, activation_client_);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { 904 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const {
899 return std::unique_ptr<ui::EventTargetIterator>(); 905 return std::unique_ptr<ui::EventTargetIterator>();
900 } 906 }
901 907
902 ui::EventTargeter* Shell::GetEventTargeter() { 908 ui::EventTargeter* Shell::GetEventTargeter() {
903 NOTREACHED(); 909 NOTREACHED();
904 return nullptr; 910 return nullptr;
905 } 911 }
906 912
907 } // namespace ash 913 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ash/virtual_keyboard_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698