| 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 413 |
| 414 registrar_.Add(this, | 414 registrar_.Add(this, |
| 415 chrome::NOTIFICATION_AUTH_NEEDED, | 415 chrome::NOTIFICATION_AUTH_NEEDED, |
| 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 |
| 424 WallpaperManager::Get()->AddObserver(this); |
| 423 } | 425 } |
| 424 | 426 |
| 425 SigninScreenHandler::~SigninScreenHandler() { | 427 SigninScreenHandler::~SigninScreenHandler() { |
| 428 WallpaperManager::Get()->RemoveObserver(this); |
| 426 weak_factory_.InvalidateWeakPtrs(); | 429 weak_factory_.InvalidateWeakPtrs(); |
| 427 SystemKeyEventListener* key_event_listener = | 430 SystemKeyEventListener* key_event_listener = |
| 428 SystemKeyEventListener::GetInstance(); | 431 SystemKeyEventListener::GetInstance(); |
| 429 if (key_event_listener) | 432 if (key_event_listener) |
| 430 key_event_listener->RemoveCapsLockObserver(this); | 433 key_event_listener->RemoveCapsLockObserver(this); |
| 431 if (delegate_) | 434 if (delegate_) |
| 432 delegate_->SetWebUIHandler(NULL); | 435 delegate_->SetWebUIHandler(NULL); |
| 433 network_state_informer_->RemoveObserver(this); | 436 network_state_informer_->RemoveObserver(this); |
| 434 } | 437 } |
| 435 | 438 |
| (...skipping 841 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 |