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

Side by Side Diff: chrome/browser/chromeos/login/login_display_host_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, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/login_display_host_impl.h" 5 #include "chrome/browser/chromeos/login/login_display_host_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/desktop_background/desktop_background_controller.h" 9 #include "ash/desktop_background/desktop_background_controller.h"
10 #include "ash/desktop_background/user_wallpaper_delegate.h" 10 #include "ash/desktop_background/user_wallpaper_delegate.h"
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 return; 850 return;
851 851
852 VLOG(1) << "Showing OOBE screen: " << first_screen_name; 852 VLOG(1) << "Showing OOBE screen: " << first_screen_name;
853 853
854 chromeos::input_method::InputMethodManager* manager = 854 chromeos::input_method::InputMethodManager* manager =
855 chromeos::input_method::InputMethodManager::Get(); 855 chromeos::input_method::InputMethodManager::Get();
856 856
857 // Set up keyboards. For example, when |locale| is "en-US", enable US qwerty 857 // Set up keyboards. For example, when |locale| is "en-US", enable US qwerty
858 // and US dvorak keyboard layouts. 858 // and US dvorak keyboard layouts.
859 if (g_browser_process && g_browser_process->local_state()) { 859 if (g_browser_process && g_browser_process->local_state()) {
860 const std::string locale = g_browser_process->GetApplicationLocale(); 860 manager->SetInputMethodDefault();
861 // If the preferred keyboard for the login screen has been saved, use it. 861
862 PrefService* prefs = g_browser_process->local_state(); 862 PrefService* prefs = g_browser_process->local_state();
863 std::string initial_input_method_id =
864 prefs->GetString(chromeos::language_prefs::kPreferredKeyboardLayout);
865 if (initial_input_method_id.empty()) {
866 // If kPreferredKeyboardLayout is not specified, use the hardware layout.
867 initial_input_method_id =
868 manager->GetInputMethodUtil()->GetHardwareInputMethodId();
869 }
870 manager->EnableLayouts(locale, initial_input_method_id);
871
872 // Apply owner preferences for tap-to-click and mouse buttons swap for 863 // Apply owner preferences for tap-to-click and mouse buttons swap for
873 // login screen. 864 // login screen.
874 system::mouse_settings::SetPrimaryButtonRight( 865 system::mouse_settings::SetPrimaryButtonRight(
875 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight)); 866 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight));
876 system::touchpad_settings::SetTapToClick( 867 system::touchpad_settings::SetTapToClick(
877 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); 868 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled));
878 } 869 }
879 870
880 ui::SetNaturalScroll(CommandLine::ForCurrentProcess()->HasSwitch( 871 ui::SetNaturalScroll(CommandLine::ForCurrentProcess()->HasSwitch(
881 switches::kNaturalScrollDefault)); 872 switches::kNaturalScrollDefault));
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 VLOG(1) << "Initial time zone: " << timezone_name; 980 VLOG(1) << "Initial time zone: " << timezone_name;
990 // Apply locale customizations only once to preserve whatever locale 981 // Apply locale customizations only once to preserve whatever locale
991 // user has changed to during OOBE. 982 // user has changed to during OOBE.
992 if (!timezone_name.empty()) { 983 if (!timezone_name.empty()) {
993 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( 984 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
994 UTF8ToUTF16(timezone_name)); 985 UTF8ToUTF16(timezone_name));
995 } 986 }
996 } 987 }
997 988
998 } // namespace chromeos 989 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698