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

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

Issue 2702393003: [ChromeOS] Expose keyboard remapping to signin screen. (Closed)
Patch Set: . 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/chromeos/preferences.cc ('k') | chrome/common/pref_names.h » ('j') | 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 } 966 }
967 967
968 gfx::NativeWindow SigninScreenHandler::GetNativeWindow() { 968 gfx::NativeWindow SigninScreenHandler::GetNativeWindow() {
969 if (native_window_delegate_) 969 if (native_window_delegate_)
970 return native_window_delegate_->GetNativeWindow(); 970 return native_window_delegate_->GetNativeWindow();
971 return nullptr; 971 return nullptr;
972 } 972 }
973 973
974 void SigninScreenHandler::RegisterPrefs(PrefRegistrySimple* registry) { 974 void SigninScreenHandler::RegisterPrefs(PrefRegistrySimple* registry) {
975 registry->RegisterDictionaryPref(prefs::kUsersLRUInputMethod); 975 registry->RegisterDictionaryPref(prefs::kUsersLRUInputMethod);
976 registry->RegisterStringPref(prefs::kFocusedPodUserId, std::string());
Alexander Alekseev 2017/02/22 00:41:22 Could you also explain the idea behind this? CL de
xdai1 2017/02/22 00:52:09 kFocusedPodUserId is used to track the current foc
Alexander Alekseev 2017/02/22 01:04:47 It seems to me that storing temporary (not statefu
xdai1 2017/02/22 01:42:16 Thanks. Done.
976 } 977 }
977 978
978 void SigninScreenHandler::OnCurrentScreenChanged(OobeScreen current_screen, 979 void SigninScreenHandler::OnCurrentScreenChanged(OobeScreen current_screen,
979 OobeScreen new_screen) { 980 OobeScreen new_screen) {
980 if (new_screen == OobeScreen::SCREEN_ACCOUNT_PICKER) { 981 if (new_screen == OobeScreen::SCREEN_ACCOUNT_PICKER) {
981 // Restore active IME state if returning to user pod row screen. 982 // Restore active IME state if returning to user pod row screen.
982 input_method::InputMethodManager::Get()->SetState(ime_state_); 983 input_method::InputMethodManager::Get()->SetState(ime_state_);
983 } 984 }
984 } 985 }
985 986
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 } 1424 }
1424 1425
1425 void SigninScreenHandler::HandleFocusPod(const AccountId& account_id) { 1426 void SigninScreenHandler::HandleFocusPod(const AccountId& account_id) {
1426 proximity_auth::ScreenlockBridge::Get()->SetFocusedUser(account_id); 1427 proximity_auth::ScreenlockBridge::Get()->SetFocusedUser(account_id);
1427 if (delegate_) 1428 if (delegate_)
1428 delegate_->CheckUserStatus(account_id); 1429 delegate_->CheckUserStatus(account_id);
1429 if (!test_focus_pod_callback_.is_null()) 1430 if (!test_focus_pod_callback_.is_null())
1430 test_focus_pod_callback_.Run(); 1431 test_focus_pod_callback_.Run();
1431 1432
1432 focused_pod_account_id_ = base::MakeUnique<AccountId>(account_id); 1433 focused_pod_account_id_ = base::MakeUnique<AccountId>(account_id);
1434 PrefService* const prefs = g_browser_process->local_state();
1435 prefs->SetString(prefs::kFocusedPodUserId, account_id.GetGaiaId());
1436 prefs->CommitPendingWrite();
1433 1437
1434 const user_manager::User* user = 1438 const user_manager::User* user =
1435 user_manager::UserManager::Get()->FindUser(account_id); 1439 user_manager::UserManager::Get()->FindUser(account_id);
1436 // |user| may be nullptr in kiosk mode or unit tests. 1440 // |user| may be nullptr in kiosk mode or unit tests.
1437 if (user && user->is_logged_in() && !user->is_active()) { 1441 if (user && user->is_logged_in() && !user->is_active()) {
1438 ash::WmShell::Get()->GetSessionStateDelegate()->SwitchActiveUser( 1442 ash::WmShell::Get()->GetSessionStateDelegate()->SwitchActiveUser(
1439 account_id); 1443 account_id);
1440 } else { 1444 } else {
1441 SetUserInputMethod(account_id.GetUserEmail(), ime_state_.get()); 1445 SetUserInputMethod(account_id.GetUserEmail(), ime_state_.get());
1442 SetKeyboardSettings(account_id); 1446 SetKeyboardSettings(account_id);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 rate.initial_delay_in_ms = auto_repeat_delay; 1641 rate.initial_delay_in_ms = auto_repeat_delay;
1638 rate.repeat_interval_in_ms = auto_repeat_interval; 1642 rate.repeat_interval_in_ms = auto_repeat_interval;
1639 input_method::InputMethodManager::Get() 1643 input_method::InputMethodManager::Get()
1640 ->GetImeKeyboard() 1644 ->GetImeKeyboard()
1641 ->SetAutoRepeatEnabled(true); 1645 ->SetAutoRepeatEnabled(true);
1642 input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate( 1646 input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate(
1643 rate); 1647 rate);
1644 } 1648 }
1645 1649
1646 } // namespace chromeos 1650 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/preferences.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698