summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-31 14:39:51 +0000
committerbshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-31 14:39:51 +0000
commit1b962b05cc701b902492e87f1d78b7459057e8c5 (patch)
treee58d8c72e80f6d92bbb79edd5361f8637a2be67d
parenta9c2d6481ca1228e72621041db3fb052480c08bb (diff)
downloadchromium_src-1b962b05cc701b902492e87f1d78b7459057e8c5.zip
chromium_src-1b962b05cc701b902492e87f1d78b7459057e8c5.tar.gz
chromium_src-1b962b05cc701b902492e87f1d78b7459057e8c5.tar.bz2
Use component virtual keyboard at login screen
BUG=245064 R=bryeung@chromium.org, sky@chromium.org Review URL: https://codereview.chromium.org/15713005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203404 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc8
-rw-r--r--ui/keyboard/keyboard.cc5
-rw-r--r--ui/keyboard/keyboard.h2
3 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc
index fb98e58..16f9940 100644
--- a/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc
+++ b/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc
@@ -16,6 +16,8 @@
#include "ui/aura/env.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/screen_type_delegate.h"
+#include "ui/keyboard/keyboard.h"
+#include "ui/keyboard/keyboard_util.h"
#include "ui/views/widget/desktop_aura/desktop_screen.h"
#if defined(FILE_MANAGER_EXTENSION)
@@ -73,6 +75,12 @@ void ChromeBrowserMainExtraPartsAsh::PreProfileInit() {
ui::SelectFileDialog::SetShellDialogsDelegate(
&g_shell_dialogs_delegate.Get());
}
+#else
+ // For OS_CHROMEOS, virtual keyboard needs to be initialized before profile
+ // initialized. Otherwise, virtual keyboard extension will not load at login
+ // screen.
+ if (keyboard::IsKeyboardEnabled())
+ keyboard::InitializeKeyboard();
#endif
#if defined(FILE_MANAGER_EXTENSION)
diff --git a/ui/keyboard/keyboard.cc b/ui/keyboard/keyboard.cc
index d41f897..9a18cb2 100644
--- a/ui/keyboard/keyboard.cc
+++ b/ui/keyboard/keyboard.cc
@@ -66,6 +66,11 @@ class KeyboardWebUIControllerFactory : public content::WebUIControllerFactory {
namespace keyboard {
void InitializeKeyboard() {
+ static bool initialized = false;
+ if (initialized)
+ return;
+ initialized = true;
+
base::FilePath pak_dir;
PathService::Get(base::DIR_MODULE, &pak_dir);
base::FilePath pak_file = pak_dir.Append(
diff --git a/ui/keyboard/keyboard.h b/ui/keyboard/keyboard.h
index 83826d1..ce14a0b 100644
--- a/ui/keyboard/keyboard.h
+++ b/ui/keyboard/keyboard.h
@@ -12,7 +12,7 @@ namespace keyboard {
// Initializes the keyboard module. This includes adding the necessary pak files
// for loading resources used in for the virtual keyboard, and registers
// a WebUIControllerFactory for creating a WebUIController necessary for the
-// virtual keyboard.
+// virtual keyboard. This becomes a no-op after the first call.
KEYBOARD_EXPORT void InitializeKeyboard();
} // namespace keyboard