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

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

Issue 2931063004: Extract colors from wallpaper and dynamically update login screen overlay (Closed)
Patch Set: Add image-loading class to small pods container Created 3 years, 6 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) 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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 } 1010 }
1011 1011
1012 void SigninScreenHandler::OnCurrentScreenChanged(OobeScreen current_screen, 1012 void SigninScreenHandler::OnCurrentScreenChanged(OobeScreen current_screen,
1013 OobeScreen new_screen) { 1013 OobeScreen new_screen) {
1014 if (new_screen == OobeScreen::SCREEN_ACCOUNT_PICKER) { 1014 if (new_screen == OobeScreen::SCREEN_ACCOUNT_PICKER) {
1015 // Restore active IME state if returning to user pod row screen. 1015 // Restore active IME state if returning to user pod row screen.
1016 input_method::InputMethodManager::Get()->SetState(ime_state_); 1016 input_method::InputMethodManager::Get()->SetState(ime_state_);
1017 } 1017 }
1018 } 1018 }
1019 1019
1020 void SigninScreenHandler::OnColorCalculationComplete() {
1021 std::string dm_color;
1022 std::string scroll_color;
1023 std::string background_color;
1024 WallpaperManager::Get()->getLoginOverlayColors(&dm_color, &scroll_color,
1025 &background_color);
1026 WallpaperManager::Get()->SetLoginOverlayCalculatorObserver(nullptr);
1027 CallJS("login.AccountPickerScreen.setOverlayColors", dm_color, scroll_color,
1028 background_color);
1029 }
1030
1020 void SigninScreenHandler::ClearAndEnablePassword() { 1031 void SigninScreenHandler::ClearAndEnablePassword() {
1021 core_oobe_view_->ResetSignInUI(false); 1032 core_oobe_view_->ResetSignInUI(false);
1022 } 1033 }
1023 1034
1024 void SigninScreenHandler::ClearUserPodPassword() { 1035 void SigninScreenHandler::ClearUserPodPassword() {
1025 core_oobe_view_->ClearUserPodPassword(); 1036 core_oobe_view_->ClearUserPodPassword();
1026 } 1037 }
1027 1038
1028 void SigninScreenHandler::RefocusCurrentPod() { 1039 void SigninScreenHandler::RefocusCurrentPod() {
1029 core_oobe_view_->RefocusCurrentPod(); 1040 core_oobe_view_->RefocusCurrentPod();
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 gaia_screen_handler_->set_populated_email(email); 1279 gaia_screen_handler_->set_populated_email(email);
1269 gaia_screen_handler_->LoadAuthExtension(true /* force */, true /* offline */); 1280 gaia_screen_handler_->LoadAuthExtension(true /* force */, true /* offline */);
1270 UpdateUIState(UI_STATE_GAIA_SIGNIN, nullptr); 1281 UpdateUIState(UI_STATE_GAIA_SIGNIN, nullptr);
1271 } 1282 }
1272 1283
1273 void SigninScreenHandler::HandleShutdownSystem() { 1284 void SigninScreenHandler::HandleShutdownSystem() {
1274 ash::Shell::Get()->lock_state_controller()->RequestShutdown(); 1285 ash::Shell::Get()->lock_state_controller()->RequestShutdown();
1275 } 1286 }
1276 1287
1277 void SigninScreenHandler::HandleLoadWallpaper(const AccountId& account_id) { 1288 void SigninScreenHandler::HandleLoadWallpaper(const AccountId& account_id) {
1278 if (delegate_) 1289 WallpaperManager::Get()->SetLoginOverlayCalculatorObserver(this);
1279 delegate_->LoadWallpaper(account_id); 1290 WallpaperManager::Get()->SetUserWallpaperDelayed(account_id);
1280 } 1291 }
1281 1292
1282 void SigninScreenHandler::HandleRebootSystem() { 1293 void SigninScreenHandler::HandleRebootSystem() {
1283 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); 1294 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
1284 } 1295 }
1285 1296
1286 void SigninScreenHandler::HandleRemoveUser(const AccountId& account_id) { 1297 void SigninScreenHandler::HandleRemoveUser(const AccountId& account_id) {
1287 if (delegate_ && 1298 if (delegate_ &&
1288 (delegate_->IsUserSigninCompleted() || delegate_->IsSigninInProgress())) { 1299 (delegate_->IsUserSigninCompleted() || delegate_->IsSigninInProgress())) {
1289 return; 1300 return;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 focused_pod_account_id_ = base::MakeUnique<AccountId>(account_id); 1499 focused_pod_account_id_ = base::MakeUnique<AccountId>(account_id);
1489 1500
1490 const user_manager::User* user = 1501 const user_manager::User* user =
1491 user_manager::UserManager::Get()->FindUser(account_id); 1502 user_manager::UserManager::Get()->FindUser(account_id);
1492 // |user| may be nullptr in kiosk mode or unit tests. 1503 // |user| may be nullptr in kiosk mode or unit tests.
1493 if (user && user->is_logged_in() && !user->is_active()) { 1504 if (user && user->is_logged_in() && !user->is_active()) {
1494 SessionControllerClient::DoSwitchActiveUser(account_id); 1505 SessionControllerClient::DoSwitchActiveUser(account_id);
1495 } else { 1506 } else {
1496 SetUserInputMethod(account_id.GetUserEmail(), ime_state_.get()); 1507 SetUserInputMethod(account_id.GetUserEmail(), ime_state_.get());
1497 SetKeyboardSettings(account_id); 1508 SetKeyboardSettings(account_id);
1509 WallpaperManager::Get()->SetLoginOverlayCalculatorObserver(this);
1498 WallpaperManager::Get()->SetUserWallpaperDelayed(account_id); 1510 WallpaperManager::Get()->SetUserWallpaperDelayed(account_id);
1499 1511
1500 bool use_24hour_clock = false; 1512 bool use_24hour_clock = false;
1501 if (user_manager::known_user::GetBooleanPref( 1513 if (user_manager::known_user::GetBooleanPref(
1502 account_id, prefs::kUse24HourClock, &use_24hour_clock)) { 1514 account_id, prefs::kUse24HourClock, &use_24hour_clock)) {
1503 g_browser_process->platform_part() 1515 g_browser_process->platform_part()
1504 ->GetSystemClock() 1516 ->GetSystemClock()
1505 ->SetLastFocusedPodHourClockType( 1517 ->SetLastFocusedPodHourClockType(
1506 use_24hour_clock ? base::k24HourClock : base::k12HourClock); 1518 use_24hour_clock ? base::k24HourClock : base::k12HourClock);
1507 } 1519 }
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 rate.initial_delay_in_ms = auto_repeat_delay; 1719 rate.initial_delay_in_ms = auto_repeat_delay;
1708 rate.repeat_interval_in_ms = auto_repeat_interval; 1720 rate.repeat_interval_in_ms = auto_repeat_interval;
1709 input_method::InputMethodManager::Get() 1721 input_method::InputMethodManager::Get()
1710 ->GetImeKeyboard() 1722 ->GetImeKeyboard()
1711 ->SetAutoRepeatEnabled(true); 1723 ->SetAutoRepeatEnabled(true);
1712 input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate( 1724 input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate(
1713 rate); 1725 rate);
1714 } 1726 }
1715 1727
1716 } // namespace chromeos 1728 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698