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

Side by Side Diff: ash/display/virtual_keyboard_window_controller.cc

Issue 219503003: Make keyboard controller a singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix root window controller unittets. Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/root_window_controller.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/display/virtual_keyboard_window_controller.h" 5 #include "ash/display/virtual_keyboard_window_controller.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/display_info.h" 8 #include "ash/display/display_info.h"
9 #include "ash/display/display_manager.h" 9 #include "ash/display/display_manager.h"
10 #include "ash/display/root_window_transformers.h" 10 #include "ash/display/root_window_transformers.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 // No need to remove WindowTreeHostObserver because the DisplayController 53 // No need to remove WindowTreeHostObserver because the DisplayController
54 // outlives the host. 54 // outlives the host.
55 host->AddObserver(Shell::GetInstance()->display_controller()); 55 host->AddObserver(Shell::GetInstance()->display_controller());
56 InitRootWindowSettings(host->window())->display_id = display_info.id(); 56 InitRootWindowSettings(host->window())->display_id = display_info.id();
57 host->InitHost(); 57 host->InitHost();
58 RootWindowController::CreateForVirtualKeyboardDisplay(host); 58 RootWindowController::CreateForVirtualKeyboardDisplay(host);
59 root_window_controller_.reset(GetRootWindowController(host->window())); 59 root_window_controller_.reset(GetRootWindowController(host->window()));
60 root_window_controller_->host()->Show(); 60 root_window_controller_->host()->Show();
61 root_window_controller_->ActivateKeyboard( 61 root_window_controller_->ActivateKeyboard(
62 Shell::GetInstance()->keyboard_controller()); 62 keyboard::KeyboardController::GetInstance());
63 FlipDisplay(); 63 FlipDisplay();
64 } else { 64 } else {
65 aura::WindowTreeHost* host = root_window_controller_->host(); 65 aura::WindowTreeHost* host = root_window_controller_->host();
66 GetRootWindowSettings(host->window())->display_id = display_info.id(); 66 GetRootWindowSettings(host->window())->display_id = display_info.id();
67 host->SetBounds(display_info.bounds_in_native()); 67 host->SetBounds(display_info.bounds_in_native());
68 } 68 }
69 } 69 }
70 70
71 void VirtualKeyboardWindowController::Close() { 71 void VirtualKeyboardWindowController::Close() {
72 if (root_window_controller_.get()) { 72 if (root_window_controller_.get()) {
(...skipping 26 matching lines...) Expand all
99 Shell::GetInstance()->CreateKeyboard(); 99 Shell::GetInstance()->CreateKeyboard();
100 } 100 }
101 101
102 void VirtualKeyboardWindowController::OnMaximizeModeEnded() { 102 void VirtualKeyboardWindowController::OnMaximizeModeEnded() {
103 keyboard::SetTouchKeyboardEnabled(false); 103 keyboard::SetTouchKeyboardEnabled(false);
104 if (!keyboard::IsKeyboardEnabled()) 104 if (!keyboard::IsKeyboardEnabled())
105 Shell::GetInstance()->DeactivateKeyboard(); 105 Shell::GetInstance()->DeactivateKeyboard();
106 } 106 }
107 107
108 } // namespace ash 108 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698