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

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

Issue 2779743002: cros: Defer lockscreen updateUserImage and loadUser calls. (Closed)
Patch Set: Created 3 years, 8 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/base_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 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 } 1014 }
1015 1015
1016 void SigninScreenHandler::OnUserRemoved(const AccountId& account_id, 1016 void SigninScreenHandler::OnUserRemoved(const AccountId& account_id,
1017 bool last_user_removed) { 1017 bool last_user_removed) {
1018 CallJS("login.AccountPickerScreen.removeUser", account_id); 1018 CallJS("login.AccountPickerScreen.removeUser", account_id);
1019 if (last_user_removed) 1019 if (last_user_removed)
1020 OnShowAddUser(); 1020 OnShowAddUser();
1021 } 1021 }
1022 1022
1023 void SigninScreenHandler::OnUserImageChanged(const user_manager::User& user) { 1023 void SigninScreenHandler::OnUserImageChanged(const user_manager::User& user) {
1024 if (page_is_ready()) 1024 if (page_is_ready()) {
1025 CallJS("login.AccountPickerScreen.updateUserImage", user.GetAccountId()); 1025 // TODO(jdufault): Remove DCHECK after resolving crbug.com/699798
1026 DCHECK(is_js_initialized_and_ready());
1027 CallJSOrDefer("login.AccountPickerScreen.updateUserImage",
1028 user.GetAccountId());
1029 }
1026 } 1030 }
1027 1031
1028 void SigninScreenHandler::OnPreferencesChanged() { 1032 void SigninScreenHandler::OnPreferencesChanged() {
1029 // Make sure that one of the login UI is fully functional now, otherwise 1033 // Make sure that one of the login UI is fully functional now, otherwise
1030 // preferences update would be picked up next time it will be shown. 1034 // preferences update would be picked up next time it will be shown.
1031 if (!webui_visible_) { 1035 if (!webui_visible_) {
1032 LOG(WARNING) << "Login UI is not active - postponed prefs change."; 1036 LOG(WARNING) << "Login UI is not active - postponed prefs change.";
1033 preferences_changed_delayed_ = true; 1037 preferences_changed_delayed_ = true;
1034 return; 1038 return;
1035 } 1039 }
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 1300
1297 void SigninScreenHandler::HandleToggleKioskAutolaunchScreen() { 1301 void SigninScreenHandler::HandleToggleKioskAutolaunchScreen() {
1298 policy::BrowserPolicyConnectorChromeOS* connector = 1302 policy::BrowserPolicyConnectorChromeOS* connector =
1299 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 1303 g_browser_process->platform_part()->browser_policy_connector_chromeos();
1300 if (delegate_ && !connector->IsEnterpriseManaged()) 1304 if (delegate_ && !connector->IsEnterpriseManaged())
1301 delegate_->ShowKioskAutolaunchScreen(); 1305 delegate_->ShowKioskAutolaunchScreen();
1302 } 1306 }
1303 1307
1304 void SigninScreenHandler::LoadUsers(const base::ListValue& users_list, 1308 void SigninScreenHandler::LoadUsers(const base::ListValue& users_list,
1305 bool showGuest) { 1309 bool showGuest) {
1306 CallJS("login.AccountPickerScreen.loadUsers", 1310 // TODO(jdufault): Remove DCHECK after resolving crbug.com/699798
1307 users_list, 1311 DCHECK(is_js_initialized_and_ready());
1308 delegate_->IsShowGuest()); 1312 CallJSOrDefer("login.AccountPickerScreen.loadUsers", users_list,
1313 delegate_->IsShowGuest());
1309 } 1314 }
1310 1315
1311 void SigninScreenHandler::HandleAccountPickerReady() { 1316 void SigninScreenHandler::HandleAccountPickerReady() {
1312 VLOG(0) << "Login WebUI >> AccountPickerReady"; 1317 VLOG(0) << "Login WebUI >> AccountPickerReady";
1313 1318
1314 if (delegate_ && !ScreenLocker::default_screen_locker() && 1319 if (delegate_ && !ScreenLocker::default_screen_locker() &&
1315 !chromeos::IsMachineHWIDCorrect() && 1320 !chromeos::IsMachineHWIDCorrect() &&
1316 !oobe_ui_) { 1321 !oobe_ui_) {
1317 delegate_->ShowWrongHWIDScreen(); 1322 delegate_->ShowWrongHWIDScreen();
1318 return; 1323 return;
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 rate.initial_delay_in_ms = auto_repeat_delay; 1653 rate.initial_delay_in_ms = auto_repeat_delay;
1649 rate.repeat_interval_in_ms = auto_repeat_interval; 1654 rate.repeat_interval_in_ms = auto_repeat_interval;
1650 input_method::InputMethodManager::Get() 1655 input_method::InputMethodManager::Get()
1651 ->GetImeKeyboard() 1656 ->GetImeKeyboard()
1652 ->SetAutoRepeatEnabled(true); 1657 ->SetAutoRepeatEnabled(true);
1653 input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate( 1658 input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate(
1654 rate); 1659 rate);
1655 } 1660 }
1656 1661
1657 } // namespace chromeos 1662 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/base_screen_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698