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

Unified Diff: ash/shell.cc

Issue 1684823004: Refactors keyboard related code so mash can use a keyboard (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to trunk Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.h ('k') | ash/shell_init_params.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 53cff3d13e9ce7d3d71e9f5fe14369fcfe5adce0..bbec48e754ee51ce1336375998dbd0f1c94cf378 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -31,6 +31,7 @@
#include "ash/high_contrast/high_contrast_controller.h"
#include "ash/host/ash_window_tree_host_init_params.h"
#include "ash/ime/input_method_event_handler.h"
+#include "ash/keyboard/keyboard_ui.h"
#include "ash/keyboard_uma_event_filter.h"
#include "ash/magnifier/magnification_controller.h"
#include "ash/magnifier/partial_magnification_controller.h"
@@ -444,6 +445,8 @@ void Shell::OnShelfCreatedForRootWindow(aura::Window* root_window) {
}
void Shell::CreateKeyboard() {
+ if (in_mus_)
+ return;
// TODO(bshe): Primary root window controller may not be the controller to
// attach virtual keyboard. See http://crbug.com/303429
InitKeyboard();
@@ -452,6 +455,9 @@ void Shell::CreateKeyboard() {
}
void Shell::DeactivateKeyboard() {
+ keyboard_ui_->Hide();
+ if (in_mus_)
+ return;
if (keyboard::KeyboardController::GetInstance()) {
RootWindowControllerList controllers = GetAllRootWindowControllers();
for (RootWindowControllerList::iterator iter = controllers.begin();
@@ -841,6 +847,8 @@ Shell::~Shell() {
}
void Shell::Init(const ShellInitParams& init_params) {
+ in_mus_ = init_params.in_mus;
+
delegate_->PreInit();
bool display_initialized = display_manager_->InitFromCommandLine();
@@ -1045,6 +1053,10 @@ void Shell::Init(const ShellInitParams& init_params) {
touch_transformer_controller_.reset(new TouchTransformerController());
#endif // defined(OS_CHROMEOS)
+ keyboard_ui_ = init_params.keyboard_factory.is_null()
+ ? KeyboardUI::Create()
+ : init_params.keyboard_factory.Run();
+
window_tree_host_manager_->InitHosts();
#if defined(OS_CHROMEOS)
@@ -1090,6 +1102,9 @@ void Shell::Init(const ShellInitParams& init_params) {
}
void Shell::InitKeyboard() {
+ if (in_mus_)
+ return;
+
if (keyboard::IsKeyboardEnabled()) {
if (keyboard::KeyboardController::GetInstance()) {
RootWindowControllerList controllers = GetAllRootWindowControllers();
« no previous file with comments | « ash/shell.h ('k') | ash/shell_init_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698