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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 2697413003: [Chrome OS] Expose keyboard auto repeat delay/interval to login screen. (Closed)
Patch Set: Nit. Created 3 years, 10 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
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/ui/webui/chromeos/login/signin_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 17 matching lines...) Expand all
28 #include "base/strings/utf_string_conversions.h" 28 #include "base/strings/utf_string_conversions.h"
29 #include "base/sys_info.h" 29 #include "base/sys_info.h"
30 #include "base/threading/thread_task_runner_handle.h" 30 #include "base/threading/thread_task_runner_handle.h"
31 #include "base/trace_event/trace_event.h" 31 #include "base/trace_event/trace_event.h"
32 #include "chrome/browser/browser_process.h" 32 #include "chrome/browser/browser_process.h"
33 #include "chrome/browser/browser_process_platform_part_chromeos.h" 33 #include "chrome/browser/browser_process_platform_part_chromeos.h"
34 #include "chrome/browser/browser_shutdown.h" 34 #include "chrome/browser/browser_shutdown.h"
35 #include "chrome/browser/chrome_notification_types.h" 35 #include "chrome/browser/chrome_notification_types.h"
36 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 36 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
37 #include "chrome/browser/chromeos/input_method/input_method_util.h" 37 #include "chrome/browser/chromeos/input_method/input_method_util.h"
38 #include "chrome/browser/chromeos/language_preferences.h"
38 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" 39 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h"
39 #include "chrome/browser/chromeos/login/hwid_checker.h" 40 #include "chrome/browser/chromeos/login/hwid_checker.h"
40 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 41 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
41 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h" 42 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h"
42 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h" 43 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h"
43 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.h" 44 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.h"
44 #include "chrome/browser/chromeos/login/reauth_stats.h" 45 #include "chrome/browser/chromeos/login/reauth_stats.h"
45 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" 46 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h"
46 #include "chrome/browser/chromeos/login/screens/network_error.h" 47 #include "chrome/browser/chromeos/login/screens/network_error.h"
47 #include "chrome/browser/chromeos/login/startup_utils.h" 48 #include "chrome/browser/chromeos/login/startup_utils.h"
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 focused_pod_account_id_ = base::MakeUnique<AccountId>(account_id); 1430 focused_pod_account_id_ = base::MakeUnique<AccountId>(account_id);
1430 1431
1431 const user_manager::User* user = 1432 const user_manager::User* user =
1432 user_manager::UserManager::Get()->FindUser(account_id); 1433 user_manager::UserManager::Get()->FindUser(account_id);
1433 // |user| may be nullptr in kiosk mode or unit tests. 1434 // |user| may be nullptr in kiosk mode or unit tests.
1434 if (user && user->is_logged_in() && !user->is_active()) { 1435 if (user && user->is_logged_in() && !user->is_active()) {
1435 ash::WmShell::Get()->GetSessionStateDelegate()->SwitchActiveUser( 1436 ash::WmShell::Get()->GetSessionStateDelegate()->SwitchActiveUser(
1436 account_id); 1437 account_id);
1437 } else { 1438 } else {
1438 SetUserInputMethod(account_id.GetUserEmail(), ime_state_.get()); 1439 SetUserInputMethod(account_id.GetUserEmail(), ime_state_.get());
1440 SetKeyboardSettings(account_id);
1439 WallpaperManager::Get()->SetUserWallpaperDelayed(account_id); 1441 WallpaperManager::Get()->SetUserWallpaperDelayed(account_id);
1440 1442
1441 bool use_24hour_clock = false; 1443 bool use_24hour_clock = false;
1442 if (user_manager::known_user::GetBooleanPref( 1444 if (user_manager::known_user::GetBooleanPref(
1443 account_id, prefs::kUse24HourClock, &use_24hour_clock)) { 1445 account_id, prefs::kUse24HourClock, &use_24hour_clock)) {
1444 g_browser_process->platform_part() 1446 g_browser_process->platform_part()
1445 ->GetSystemClock() 1447 ->GetSystemClock()
1446 ->SetLastFocusedPodHourClockType( 1448 ->SetLastFocusedPodHourClockType(
1447 use_24hour_clock ? base::k24HourClock : base::k12HourClock); 1449 use_24hour_clock ? base::k24HourClock : base::k12HourClock);
1448 } 1450 }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 void SigninScreenHandler::OnAllowedInputMethodsChanged() { 1606 void SigninScreenHandler::OnAllowedInputMethodsChanged() {
1605 if (focused_pod_account_id_) { 1607 if (focused_pod_account_id_) {
1606 std::string user_input_method = 1608 std::string user_input_method =
1607 GetUserLRUInputMethod(focused_pod_account_id_->GetUserEmail()); 1609 GetUserLRUInputMethod(focused_pod_account_id_->GetUserEmail());
1608 EnforcePolicyInputMethods(user_input_method); 1610 EnforcePolicyInputMethods(user_input_method);
1609 } else { 1611 } else {
1610 EnforcePolicyInputMethods(std::string()); 1612 EnforcePolicyInputMethods(std::string());
1611 } 1613 }
1612 } 1614 }
1613 1615
1616 void SigninScreenHandler::SetKeyboardSettings(const AccountId& account_id) {
1617 bool auto_repeat_enabled = language_prefs::kXkbAutoRepeatEnabled;
1618 if (user_manager::known_user::GetBooleanPref(
1619 account_id, prefs::kLanguageXkbAutoRepeatEnabled,
1620 &auto_repeat_enabled) &&
1621 !auto_repeat_enabled) {
1622 input_method::InputMethodManager::Get()
1623 ->GetImeKeyboard()
1624 ->SetAutoRepeatEnabled(false);
1625 return;
1626 }
1627
1628 int auto_repeat_delay = language_prefs::kXkbAutoRepeatDelayInMs;
1629 int auto_repeat_interval = language_prefs::kXkbAutoRepeatIntervalInMs;
1630 user_manager::known_user::GetIntegerPref(
1631 account_id, prefs::kLanguageXkbAutoRepeatDelay, &auto_repeat_delay);
1632 user_manager::known_user::GetIntegerPref(
1633 account_id, prefs::kLanguageXkbAutoRepeatInterval, &auto_repeat_interval);
1634 input_method::AutoRepeatRate rate;
1635 rate.initial_delay_in_ms = auto_repeat_delay;
1636 rate.repeat_interval_in_ms = auto_repeat_interval;
1637 input_method::InputMethodManager::Get()
1638 ->GetImeKeyboard()
1639 ->SetAutoRepeatEnabled(true);
1640 input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate(
1641 rate);
1642 }
1643
1614 } // namespace chromeos 1644 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698