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

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

Issue 24625003: Delay wallpaper load by 2 * average wallpaper load time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Catch WallpaperAnimationFinished event and inform JS. Created 7 years, 2 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 "base/callback.h" 7 #include "base/callback.h"
8 #include "base/chromeos/chromeos_version.h" 8 #include "base/chromeos/chromeos_version.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 oobe_ui_(false), 384 oobe_ui_(false),
385 focus_stolen_(false), 385 focus_stolen_(false),
386 gaia_silent_load_(false), 386 gaia_silent_load_(false),
387 is_account_picker_showing_first_time_(false), 387 is_account_picker_showing_first_time_(false),
388 dns_cleared_(false), 388 dns_cleared_(false),
389 dns_clear_task_running_(false), 389 dns_clear_task_running_(false),
390 cookies_cleared_(false), 390 cookies_cleared_(false),
391 network_state_informer_(network_state_informer), 391 network_state_informer_(network_state_informer),
392 test_expects_complete_login_(false), 392 test_expects_complete_login_(false),
393 weak_factory_(this), 393 weak_factory_(this),
394 weak_factory_as_observer_(this),
394 webui_visible_(false), 395 webui_visible_(false),
395 preferences_changed_delayed_(false), 396 preferences_changed_delayed_(false),
396 error_screen_actor_(error_screen_actor), 397 error_screen_actor_(error_screen_actor),
397 core_oobe_actor_(core_oobe_actor), 398 core_oobe_actor_(core_oobe_actor),
398 is_first_update_state_call_(true), 399 is_first_update_state_call_(true),
399 offline_login_active_(false), 400 offline_login_active_(false),
400 last_network_state_(NetworkStateInformer::UNKNOWN), 401 last_network_state_(NetworkStateInformer::UNKNOWN),
401 has_pending_auth_ui_(false) { 402 has_pending_auth_ui_(false) {
402 DCHECK(network_state_informer_.get()); 403 DCHECK(network_state_informer_.get());
403 DCHECK(error_screen_actor_); 404 DCHECK(error_screen_actor_);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 UpdateUIState(UI_STATE_ACCOUNT_PICKER, &params); 548 UpdateUIState(UI_STATE_ACCOUNT_PICKER, &params);
548 } 549 }
549 } 550 }
550 551
551 void SigninScreenHandler::ShowRetailModeLoginSpinner() { 552 void SigninScreenHandler::ShowRetailModeLoginSpinner() {
552 CallJS("showLoginSpinner"); 553 CallJS("showLoginSpinner");
553 } 554 }
554 555
555 void SigninScreenHandler::SetDelegate(SigninScreenHandlerDelegate* delegate) { 556 void SigninScreenHandler::SetDelegate(SigninScreenHandlerDelegate* delegate) {
556 delegate_ = delegate; 557 delegate_ = delegate;
557 if (delegate_) 558 if (delegate_) {
558 delegate_->SetWebUIHandler(this); 559 delegate_->SetWebUIHandler(this);
560 WallpaperManager::Get()->AddObserver(
561 weak_factory_as_observer_.GetWeakPtr());
562 }
559 } 563 }
560 564
561 void SigninScreenHandler::SetNativeWindowDelegate( 565 void SigninScreenHandler::SetNativeWindowDelegate(
562 NativeWindowDelegate* native_window_delegate) { 566 NativeWindowDelegate* native_window_delegate) {
563 native_window_delegate_ = native_window_delegate; 567 native_window_delegate_ = native_window_delegate;
564 } 568 }
565 569
566 void SigninScreenHandler::OnNetworkReady() { 570 void SigninScreenHandler::OnNetworkReady() {
567 MaybePreloadAuthExtension(); 571 MaybePreloadAuthExtension();
568 } 572 }
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 1282
1279 void SigninScreenHandler::HandleShutdownSystem() { 1283 void SigninScreenHandler::HandleShutdownSystem() {
1280 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown(); 1284 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown();
1281 } 1285 }
1282 1286
1283 void SigninScreenHandler::HandleLoadWallpaper(const std::string& email) { 1287 void SigninScreenHandler::HandleLoadWallpaper(const std::string& email) {
1284 if (delegate_) 1288 if (delegate_)
1285 delegate_->LoadWallpaper(email); 1289 delegate_->LoadWallpaper(email);
1286 } 1290 }
1287 1291
1292 void SigninScreenHandler::OnWallpaperAnimationFinished(
1293 const std::string& email) {
1294 CallJS("login.AccountPickerScreen.onWallpaperLoaded", email);
1295 }
1296
1288 void SigninScreenHandler::HandleRebootSystem() { 1297 void SigninScreenHandler::HandleRebootSystem() {
1289 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); 1298 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
1290 } 1299 }
1291 1300
1292 void SigninScreenHandler::HandleRemoveUser(const std::string& email) { 1301 void SigninScreenHandler::HandleRemoveUser(const std::string& email) {
1293 if (!delegate_) 1302 if (!delegate_)
1294 return; 1303 return;
1295 delegate_->RemoveUser(email); 1304 delegate_->RemoveUser(email);
1296 UpdateAddButtonStatus(); 1305 UpdateAddButtonStatus();
1297 } 1306 }
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 rvh->ExecuteJavascriptInWebFrame( 1781 rvh->ExecuteJavascriptInWebFrame(
1773 ASCIIToUTF16("//iframe[@id='signin-frame']\n//iframe"), 1782 ASCIIToUTF16("//iframe[@id='signin-frame']\n//iframe"),
1774 ASCIIToUTF16(code)); 1783 ASCIIToUTF16(code));
1775 1784
1776 // Test properties are cleared in HandleCompleteLogin because the form 1785 // Test properties are cleared in HandleCompleteLogin because the form
1777 // submission might fail and login will not be attempted after reloading 1786 // submission might fail and login will not be attempted after reloading
1778 // if they are cleared here. 1787 // if they are cleared here.
1779 } 1788 }
1780 1789
1781 } // namespace chromeos 1790 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698