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

Unified Diff: chrome/browser/chromeos/input_method/input_method_manager_impl.cc

Issue 23608003: Default keyboard layout should be set considering owners preference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
Index: chrome/browser/chromeos/input_method/input_method_manager_impl.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index 5a41b15ef0156f77d7599952704fe86993c176f9..7078f78b3667a1bbfe21688bca16270913ae8a01 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -10,8 +10,10 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/memory/scoped_ptr.h"
+#include "base/prefs/pref_service.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/input_method/candidate_window_controller.h"
#include "chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.h"
#include "chrome/browser/chromeos/input_method/input_method_engine_ibus.h"
@@ -668,6 +670,24 @@ void InputMethodManagerImpl::SetEnabledExtensionImes(
}
}
+void InputMethodManagerImpl::SetInputMethodDefault() {
+ // Set up keyboards. For example, when |locale| is "en-US", enable US qwerty
+ // and US dvorak keyboard layouts.
+ if (g_browser_process && g_browser_process->local_state()) {
+ const std::string locale = g_browser_process->GetApplicationLocale();
+ // If the preferred keyboard for the login screen has been saved, use it.
+ PrefService* prefs = g_browser_process->local_state();
+ std::string initial_input_method_id =
+ prefs->GetString(chromeos::language_prefs::kPreferredKeyboardLayout);
+ if (initial_input_method_id.empty()) {
+ // If kPreferredKeyboardLayout is not specified, use the hardware layout.
+ initial_input_method_id =
+ GetInputMethodUtil()->GetHardwareInputMethodId();
+ }
+ EnableLayouts(locale, initial_input_method_id);
+ }
+}
+
bool InputMethodManagerImpl::SwitchToNextInputMethod() {
// Sanity checks.
if (active_input_method_ids_.empty()) {

Powered by Google App Engine
This is Rietveld 408576698