Commit cebe6768 authored by Mike Wasserman's avatar Mike Wasserman Committed by Commit Bot

OopAsh: Bail on Shell::EnableKeyboard in Mash and OopAsh.

ShellDelegateMash does not create a valid keyboard ui instance.

TBR=blakeo@chromium.org

Bug: 856235, 646565
Test: No keyboard crash on --enable-features=OopAsh device startup.
Change-Id: I26ac1c13f46b839a4b77c6aaf478abec745126f1
Reviewed-on: https://chromium-review.googlesource.com/1119088
Commit-Queue: Michael Wasserman <msw@chromium.org>
Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571313}
parent 8e2be8df
...@@ -491,11 +491,16 @@ void Shell::EnableKeyboard() { ...@@ -491,11 +491,16 @@ void Shell::EnableKeyboard() {
for (auto* const controller : GetAllRootWindowControllers()) for (auto* const controller : GetAllRootWindowControllers())
controller->DeactivateKeyboard(keyboard_controller_.get()); controller->DeactivateKeyboard(keyboard_controller_.get());
} }
keyboard_controller_->EnableKeyboard(shell_delegate_->CreateKeyboardUI(),
// TODO(crbug.com/646565): ShellDelegateMash does not support keyboard ui yet.
auto keyboard_ui = shell_delegate_->CreateKeyboardUI();
if (!keyboard_ui && !::features::IsAshInBrowserProcess())
return;
keyboard_controller_->EnableKeyboard(std::move(keyboard_ui),
virtual_keyboard_controller_.get()); virtual_keyboard_controller_.get());
for (auto& observer : shell_observers_) for (auto& observer : shell_observers_)
observer.OnKeyboardControllerCreated(); observer.OnKeyboardControllerCreated();
GetPrimaryRootWindowController()->ActivateKeyboard( GetPrimaryRootWindowController()->ActivateKeyboard(
keyboard_controller_.get()); keyboard_controller_.get());
} }
......
...@@ -182,6 +182,7 @@ void KeyboardController::EnableKeyboard(std::unique_ptr<KeyboardUI> ui, ...@@ -182,6 +182,7 @@ void KeyboardController::EnableKeyboard(std::unique_ptr<KeyboardUI> ui,
DisableKeyboard(); DisableKeyboard();
ui_ = std::move(ui); ui_ = std::move(ui);
DCHECK(ui_);
layout_delegate_ = delegate; layout_delegate_ = delegate;
show_on_content_update_ = false; show_on_content_update_ = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment