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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 414 |
415 registrar_.Add(this, | 415 registrar_.Add(this, |
416 chrome::NOTIFICATION_AUTH_NEEDED, | 416 chrome::NOTIFICATION_AUTH_NEEDED, |
417 content::NotificationService::AllSources()); | 417 content::NotificationService::AllSources()); |
418 registrar_.Add(this, | 418 registrar_.Add(this, |
419 chrome::NOTIFICATION_AUTH_SUPPLIED, | 419 chrome::NOTIFICATION_AUTH_SUPPLIED, |
420 content::NotificationService::AllSources()); | 420 content::NotificationService::AllSources()); |
421 registrar_.Add(this, | 421 registrar_.Add(this, |
422 chrome::NOTIFICATION_AUTH_CANCELLED, | 422 chrome::NOTIFICATION_AUTH_CANCELLED, |
423 content::NotificationService::AllSources()); | 423 content::NotificationService::AllSources()); |
424 | |
425 WallpaperManager::Get()->AddObserver(this); | |
426 } | 424 } |
427 | 425 |
428 SigninScreenHandler::~SigninScreenHandler() { | 426 SigninScreenHandler::~SigninScreenHandler() { |
429 WallpaperManager::Get()->RemoveObserver(this); | |
430 weak_factory_.InvalidateWeakPtrs(); | 427 weak_factory_.InvalidateWeakPtrs(); |
431 SystemKeyEventListener* key_event_listener = | 428 SystemKeyEventListener* key_event_listener = |
432 SystemKeyEventListener::GetInstance(); | 429 SystemKeyEventListener::GetInstance(); |
433 if (key_event_listener) | 430 if (key_event_listener) |
434 key_event_listener->RemoveCapsLockObserver(this); | 431 key_event_listener->RemoveCapsLockObserver(this); |
435 if (delegate_) | 432 if (delegate_) |
436 delegate_->SetWebUIHandler(NULL); | 433 delegate_->SetWebUIHandler(NULL); |
437 network_state_informer_->RemoveObserver(this); | 434 network_state_informer_->RemoveObserver(this); |
438 } | 435 } |
439 | 436 |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 | 1278 |
1282 void SigninScreenHandler::HandleShutdownSystem() { | 1279 void SigninScreenHandler::HandleShutdownSystem() { |
1283 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown(); | 1280 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown(); |
1284 } | 1281 } |
1285 | 1282 |
1286 void SigninScreenHandler::HandleLoadWallpaper(const std::string& email) { | 1283 void SigninScreenHandler::HandleLoadWallpaper(const std::string& email) { |
1287 if (delegate_) | 1284 if (delegate_) |
1288 delegate_->LoadWallpaper(email); | 1285 delegate_->LoadWallpaper(email); |
1289 } | 1286 } |
1290 | 1287 |
1291 void SigninScreenHandler::OnWallpaperAnimationFinished( | |
1292 const std::string& email) { | |
1293 CallJS("login.AccountPickerScreen.onWallpaperLoaded", email); | |
1294 } | |
1295 | |
1296 void SigninScreenHandler::HandleRebootSystem() { | 1288 void SigninScreenHandler::HandleRebootSystem() { |
1297 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); | 1289 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); |
1298 } | 1290 } |
1299 | 1291 |
1300 void SigninScreenHandler::HandleRemoveUser(const std::string& email) { | 1292 void SigninScreenHandler::HandleRemoveUser(const std::string& email) { |
1301 if (!delegate_) | 1293 if (!delegate_) |
1302 return; | 1294 return; |
1303 delegate_->RemoveUser(email); | 1295 delegate_->RemoveUser(email); |
1304 UpdateAddButtonStatus(); | 1296 UpdateAddButtonStatus(); |
1305 } | 1297 } |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 if (!kiosk_enable_flow_aborted_callback_for_test_.is_null()) | 1799 if (!kiosk_enable_flow_aborted_callback_for_test_.is_null()) |
1808 kiosk_enable_flow_aborted_callback_for_test_.Run(); | 1800 kiosk_enable_flow_aborted_callback_for_test_.Run(); |
1809 return; | 1801 return; |
1810 } | 1802 } |
1811 | 1803 |
1812 if (delegate_) | 1804 if (delegate_) |
1813 delegate_->ShowKioskEnableScreen(); | 1805 delegate_->ShowKioskEnableScreen(); |
1814 } | 1806 } |
1815 | 1807 |
1816 } // namespace chromeos | 1808 } // namespace chromeos |
OLD | NEW |