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

Unified Diff: ash/shell.cc

Issue 62833010: Reland "Add a full screen virtual keyboard to virtual keyboard root window" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: format nit. The main change is patchset 2 Created 7 years, 1 month 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/keyboard_controller_proxy_stub.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 7e2b62308c78289a09b310101d201fc18f94eeee..67340198fe8d62ee785108eb5da56999d832902a 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -23,6 +23,7 @@
#include "ash/display/mouse_cursor_event_filter.h"
#include "ash/display/resolution_notification_controller.h"
#include "ash/display/screen_position_controller.h"
+#include "ash/display/virtual_keyboard_window_controller.h"
#include "ash/drag_drop/drag_drop_controller.h"
#include "ash/first_run/first_run_helper_impl.h"
#include "ash/focus_cycler.h"
@@ -336,16 +337,14 @@ void Shell::SetDisplayWorkAreaInsets(Window* contains,
}
void Shell::OnLoginStateChanged(user::LoginStatus status) {
- if (status != user::LOGGED_IN_NONE) {
- // TODO(bshe): Primary root window controller may not be the controller to
- // attach virtual keyboard. See http://crbug.com/303429
- InitKeyboard(GetPrimaryRootWindowController());
- GetPrimaryRootWindowController()->ActivateKeyboard(
- keyboard_controller_.get());
- }
FOR_EACH_OBSERVER(ShellObserver, observers_, OnLoginStateChanged(status));
}
+void Shell::OnLoginUserProfilePrepared() {
+ CreateLauncher();
+ CreateKeyboard();
+}
+
void Shell::UpdateAfterLoginStatusChange(user::LoginStatus status) {
RootWindowControllerList controllers = GetAllRootWindowControllers();
for (RootWindowControllerList::iterator iter = controllers.begin();
@@ -380,6 +379,19 @@ void Shell::CreateLauncher() {
(*iter)->shelf()->CreateLauncher();
}
+void Shell::CreateKeyboard() {
+ // TODO(bshe): Primary root window controller may not be the controller to
+ // attach virtual keyboard. See http://crbug.com/303429
+ InitKeyboard();
+ if (keyboard::IsKeyboardUsabilityExperimentEnabled()) {
+ display_controller()->virtual_keyboard_window_controller()->
+ ActivateKeyboard(keyboard_controller_.get());
+ } else {
+ GetPrimaryRootWindowController()->
+ ActivateKeyboard(keyboard_controller_.get());
+ }
+}
+
void Shell::ShowLauncher() {
RootWindowControllerList controllers = GetAllRootWindowControllers();
for (RootWindowControllerList::iterator iter = controllers.begin();
@@ -618,6 +630,7 @@ Shell::~Shell() {
// Destroy all child windows including widgets.
display_controller_->CloseChildWindows();
+ display_controller_->CloseNonDesktopDisplay();
// Destroy SystemTrayNotifier after destroying SystemTray as TrayItems
// needs to remove observers from it.
@@ -692,7 +705,7 @@ void Shell::Init() {
CommandLine* command_line = CommandLine::ForCurrentProcess();
delegate_->PreInit();
- if (command_line->HasSwitch(keyboard::switches::kKeyboardUsabilityTest)) {
+ if (keyboard::IsKeyboardUsabilityExperimentEnabled()) {
display_manager_->SetSecondDisplayMode(
internal::DisplayManager::VIRTUAL_KEYBOARD);
}
@@ -915,7 +928,7 @@ void Shell::Init() {
weak_display_manager_factory_->GetWeakPtr()));
}
-void Shell::InitKeyboard(internal::RootWindowController* root) {
+void Shell::InitKeyboard() {
if (keyboard::IsKeyboardEnabled()) {
if (keyboard_controller_.get()) {
RootWindowControllerList controllers = GetAllRootWindowControllers();
« no previous file with comments | « ash/shell.h ('k') | ash/shell/keyboard_controller_proxy_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698