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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 | 415 |
416 registrar_.Add(this, | 416 registrar_.Add(this, |
417 chrome::NOTIFICATION_AUTH_NEEDED, | 417 chrome::NOTIFICATION_AUTH_NEEDED, |
418 content::NotificationService::AllSources()); | 418 content::NotificationService::AllSources()); |
419 registrar_.Add(this, | 419 registrar_.Add(this, |
420 chrome::NOTIFICATION_AUTH_SUPPLIED, | 420 chrome::NOTIFICATION_AUTH_SUPPLIED, |
421 content::NotificationService::AllSources()); | 421 content::NotificationService::AllSources()); |
422 registrar_.Add(this, | 422 registrar_.Add(this, |
423 chrome::NOTIFICATION_AUTH_CANCELLED, | 423 chrome::NOTIFICATION_AUTH_CANCELLED, |
424 content::NotificationService::AllSources()); | 424 content::NotificationService::AllSources()); |
| 425 |
| 426 WallpaperManager::Get()->AddObserver(this); |
425 } | 427 } |
426 | 428 |
427 SigninScreenHandler::~SigninScreenHandler() { | 429 SigninScreenHandler::~SigninScreenHandler() { |
| 430 WallpaperManager::Get()->RemoveObserver(this); |
428 weak_factory_.InvalidateWeakPtrs(); | 431 weak_factory_.InvalidateWeakPtrs(); |
429 SystemKeyEventListener* key_event_listener = | 432 SystemKeyEventListener* key_event_listener = |
430 SystemKeyEventListener::GetInstance(); | 433 SystemKeyEventListener::GetInstance(); |
431 if (key_event_listener) | 434 if (key_event_listener) |
432 key_event_listener->RemoveCapsLockObserver(this); | 435 key_event_listener->RemoveCapsLockObserver(this); |
433 if (delegate_) | 436 if (delegate_) |
434 delegate_->SetWebUIHandler(NULL); | 437 delegate_->SetWebUIHandler(NULL); |
435 network_state_informer_->RemoveObserver(this); | 438 network_state_informer_->RemoveObserver(this); |
436 } | 439 } |
437 | 440 |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 | 1287 |
1285 void SigninScreenHandler::HandleShutdownSystem() { | 1288 void SigninScreenHandler::HandleShutdownSystem() { |
1286 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown(); | 1289 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown(); |
1287 } | 1290 } |
1288 | 1291 |
1289 void SigninScreenHandler::HandleLoadWallpaper(const std::string& email) { | 1292 void SigninScreenHandler::HandleLoadWallpaper(const std::string& email) { |
1290 if (delegate_) | 1293 if (delegate_) |
1291 delegate_->LoadWallpaper(email); | 1294 delegate_->LoadWallpaper(email); |
1292 } | 1295 } |
1293 | 1296 |
| 1297 void SigninScreenHandler::OnWallpaperAnimationFinished( |
| 1298 const std::string& email) { |
| 1299 CallJS("login.AccountPickerScreen.onWallpaperLoaded", email); |
| 1300 } |
| 1301 |
1294 void SigninScreenHandler::HandleRebootSystem() { | 1302 void SigninScreenHandler::HandleRebootSystem() { |
1295 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); | 1303 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); |
1296 } | 1304 } |
1297 | 1305 |
1298 void SigninScreenHandler::HandleRemoveUser(const std::string& email) { | 1306 void SigninScreenHandler::HandleRemoveUser(const std::string& email) { |
1299 if (!delegate_) | 1307 if (!delegate_) |
1300 return; | 1308 return; |
1301 delegate_->RemoveUser(email); | 1309 delegate_->RemoveUser(email); |
1302 UpdateAddButtonStatus(); | 1310 UpdateAddButtonStatus(); |
1303 } | 1311 } |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1816 if (!kiosk_enable_flow_aborted_callback_for_test_.is_null()) | 1824 if (!kiosk_enable_flow_aborted_callback_for_test_.is_null()) |
1817 kiosk_enable_flow_aborted_callback_for_test_.Run(); | 1825 kiosk_enable_flow_aborted_callback_for_test_.Run(); |
1818 return; | 1826 return; |
1819 } | 1827 } |
1820 | 1828 |
1821 if (delegate_) | 1829 if (delegate_) |
1822 delegate_->ShowKioskEnableScreen(); | 1830 delegate_->ShowKioskEnableScreen(); |
1823 } | 1831 } |
1824 | 1832 |
1825 } // namespace chromeos | 1833 } // namespace chromeos |
OLD | NEW |