OLD | NEW |
---|---|
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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
416 content::NotificationService::AllSources()); | 416 content::NotificationService::AllSources()); |
417 registrar_.Add(this, | 417 registrar_.Add(this, |
418 chrome::NOTIFICATION_AUTH_SUPPLIED, | 418 chrome::NOTIFICATION_AUTH_SUPPLIED, |
419 content::NotificationService::AllSources()); | 419 content::NotificationService::AllSources()); |
420 registrar_.Add(this, | 420 registrar_.Add(this, |
421 chrome::NOTIFICATION_AUTH_CANCELLED, | 421 chrome::NOTIFICATION_AUTH_CANCELLED, |
422 content::NotificationService::AllSources()); | 422 content::NotificationService::AllSources()); |
423 } | 423 } |
424 | 424 |
425 SigninScreenHandler::~SigninScreenHandler() { | 425 SigninScreenHandler::~SigninScreenHandler() { |
426 WallpaperManager::Get()->RemoveObserver(this); | |
426 weak_factory_.InvalidateWeakPtrs(); | 427 weak_factory_.InvalidateWeakPtrs(); |
427 SystemKeyEventListener* key_event_listener = | 428 SystemKeyEventListener* key_event_listener = |
428 SystemKeyEventListener::GetInstance(); | 429 SystemKeyEventListener::GetInstance(); |
429 if (key_event_listener) | 430 if (key_event_listener) |
430 key_event_listener->RemoveCapsLockObserver(this); | 431 key_event_listener->RemoveCapsLockObserver(this); |
431 if (delegate_) | 432 if (delegate_) |
432 delegate_->SetWebUIHandler(NULL); | 433 delegate_->SetWebUIHandler(NULL); |
433 network_state_informer_->RemoveObserver(this); | 434 network_state_informer_->RemoveObserver(this); |
434 } | 435 } |
435 | 436 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
546 UpdateUIState(UI_STATE_ACCOUNT_PICKER, ¶ms); | 547 UpdateUIState(UI_STATE_ACCOUNT_PICKER, ¶ms); |
547 } | 548 } |
548 } | 549 } |
549 | 550 |
550 void SigninScreenHandler::ShowRetailModeLoginSpinner() { | 551 void SigninScreenHandler::ShowRetailModeLoginSpinner() { |
551 CallJS("showLoginSpinner"); | 552 CallJS("showLoginSpinner"); |
552 } | 553 } |
553 | 554 |
554 void SigninScreenHandler::SetDelegate(SigninScreenHandlerDelegate* delegate) { | 555 void SigninScreenHandler::SetDelegate(SigninScreenHandlerDelegate* delegate) { |
555 delegate_ = delegate; | 556 delegate_ = delegate; |
556 if (delegate_) | 557 if (delegate_) { |
557 delegate_->SetWebUIHandler(this); | 558 delegate_->SetWebUIHandler(this); |
559 WallpaperManager::Get()->AddObserver(this); | |
dzhioev (left Google)
2013/10/17 12:47:49
Why do you add observer here? I see that |this| ad
Alexander Alekseev
2013/10/18 17:01:52
Hmmm... I don't reember why, but there was a reaso
| |
560 } | |
558 } | 561 } |
559 | 562 |
560 void SigninScreenHandler::SetNativeWindowDelegate( | 563 void SigninScreenHandler::SetNativeWindowDelegate( |
561 NativeWindowDelegate* native_window_delegate) { | 564 NativeWindowDelegate* native_window_delegate) { |
562 native_window_delegate_ = native_window_delegate; | 565 native_window_delegate_ = native_window_delegate; |
563 } | 566 } |
564 | 567 |
565 void SigninScreenHandler::OnNetworkReady() { | 568 void SigninScreenHandler::OnNetworkReady() { |
566 MaybePreloadAuthExtension(); | 569 MaybePreloadAuthExtension(); |
567 } | 570 } |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1277 | 1280 |
1278 void SigninScreenHandler::HandleShutdownSystem() { | 1281 void SigninScreenHandler::HandleShutdownSystem() { |
1279 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown(); | 1282 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown(); |
1280 } | 1283 } |
1281 | 1284 |
1282 void SigninScreenHandler::HandleLoadWallpaper(const std::string& email) { | 1285 void SigninScreenHandler::HandleLoadWallpaper(const std::string& email) { |
1283 if (delegate_) | 1286 if (delegate_) |
1284 delegate_->LoadWallpaper(email); | 1287 delegate_->LoadWallpaper(email); |
1285 } | 1288 } |
1286 | 1289 |
1290 void SigninScreenHandler::OnWallpaperAnimationFinished( | |
1291 const std::string& email) { | |
1292 CallJS("login.AccountPickerScreen.onWallpaperLoaded", email); | |
1293 } | |
1294 | |
1287 void SigninScreenHandler::HandleRebootSystem() { | 1295 void SigninScreenHandler::HandleRebootSystem() { |
1288 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); | 1296 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); |
1289 } | 1297 } |
1290 | 1298 |
1291 void SigninScreenHandler::HandleRemoveUser(const std::string& email) { | 1299 void SigninScreenHandler::HandleRemoveUser(const std::string& email) { |
1292 if (!delegate_) | 1300 if (!delegate_) |
1293 return; | 1301 return; |
1294 delegate_->RemoveUser(email); | 1302 delegate_->RemoveUser(email); |
1295 UpdateAddButtonStatus(); | 1303 UpdateAddButtonStatus(); |
1296 } | 1304 } |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1775 rvh->ExecuteJavascriptInWebFrame( | 1783 rvh->ExecuteJavascriptInWebFrame( |
1776 ASCIIToUTF16("//iframe[@id='signin-frame']\n//iframe"), | 1784 ASCIIToUTF16("//iframe[@id='signin-frame']\n//iframe"), |
1777 ASCIIToUTF16(code)); | 1785 ASCIIToUTF16(code)); |
1778 | 1786 |
1779 // Test properties are cleared in HandleCompleteLogin because the form | 1787 // Test properties are cleared in HandleCompleteLogin because the form |
1780 // submission might fail and login will not be attempted after reloading | 1788 // submission might fail and login will not be attempted after reloading |
1781 // if they are cleared here. | 1789 // if they are cleared here. |
1782 } | 1790 } |
1783 | 1791 |
1784 } // namespace chromeos | 1792 } // namespace chromeos |
OLD | NEW |