Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 base::Unretained(this))); | 433 base::Unretained(this))); |
| 434 web_ui()->RegisterMessageCallback("offlineLogin", | 434 web_ui()->RegisterMessageCallback("offlineLogin", |
| 435 base::Bind(&SigninScreenHandler::HandleOfflineLogin, | 435 base::Bind(&SigninScreenHandler::HandleOfflineLogin, |
| 436 base::Unretained(this))); | 436 base::Unretained(this))); |
| 437 web_ui()->RegisterMessageCallback("showAddUser", | 437 web_ui()->RegisterMessageCallback("showAddUser", |
| 438 base::Bind(&SigninScreenHandler::HandleShowAddUser, | 438 base::Bind(&SigninScreenHandler::HandleShowAddUser, |
| 439 base::Unretained(this))); | 439 base::Unretained(this))); |
| 440 web_ui()->RegisterMessageCallback("shutdownSystem", | 440 web_ui()->RegisterMessageCallback("shutdownSystem", |
| 441 base::Bind(&SigninScreenHandler::HandleShutdownSystem, | 441 base::Bind(&SigninScreenHandler::HandleShutdownSystem, |
| 442 base::Unretained(this))); | 442 base::Unretained(this))); |
| 443 web_ui()->RegisterMessageCallback("userSelected", | |
|
Nikita (slow)
2012/04/25 16:47:48
Rename to userSelectedDelayed (per comment in JS).
bshe
2012/04/25 23:54:43
Done.
| |
| 444 base::Bind(&SigninScreenHandler::HandleUserSelected, | |
| 445 base::Unretained(this))); | |
| 443 web_ui()->RegisterMessageCallback("removeUser", | 446 web_ui()->RegisterMessageCallback("removeUser", |
| 444 base::Bind(&SigninScreenHandler::HandleRemoveUser, | 447 base::Bind(&SigninScreenHandler::HandleRemoveUser, |
| 445 base::Unretained(this))); | 448 base::Unretained(this))); |
| 446 web_ui()->RegisterMessageCallback("toggleEnrollmentScreen", | 449 web_ui()->RegisterMessageCallback("toggleEnrollmentScreen", |
| 447 base::Bind(&SigninScreenHandler::HandleToggleEnrollmentScreen, | 450 base::Bind(&SigninScreenHandler::HandleToggleEnrollmentScreen, |
| 448 base::Unretained(this))); | 451 base::Unretained(this))); |
| 449 web_ui()->RegisterMessageCallback("launchHelpApp", | 452 web_ui()->RegisterMessageCallback("launchHelpApp", |
| 450 base::Bind(&SigninScreenHandler::HandleLaunchHelpApp, | 453 base::Bind(&SigninScreenHandler::HandleLaunchHelpApp, |
| 451 base::Unretained(this))); | 454 base::Unretained(this))); |
| 452 web_ui()->RegisterMessageCallback("createAccount", | 455 web_ui()->RegisterMessageCallback("createAccount", |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 747 | 750 |
| 748 void SigninScreenHandler::HandleShutdownSystem(const base::ListValue* args) { | 751 void SigninScreenHandler::HandleShutdownSystem(const base::ListValue* args) { |
| 749 #if defined(USE_AURA) | 752 #if defined(USE_AURA) |
| 750 // Display the shutdown animation before actually requesting shutdown. | 753 // Display the shutdown animation before actually requesting shutdown. |
| 751 ash::Shell::GetInstance()->power_button_controller()->RequestShutdown(); | 754 ash::Shell::GetInstance()->power_button_controller()->RequestShutdown(); |
| 752 #else | 755 #else |
| 753 DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown(); | 756 DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown(); |
| 754 #endif | 757 #endif |
| 755 } | 758 } |
| 756 | 759 |
| 760 void SigninScreenHandler::HandleUserSelected(const base::ListValue* args) { | |
| 761 if (!delegate_) | |
| 762 return; | |
| 763 | |
| 764 std::string email; | |
| 765 if (!args->GetString(0, &email)) { | |
| 766 NOTREACHED(); | |
| 767 return; | |
| 768 } | |
| 769 | |
| 770 delegate_->UserSelected(email); | |
| 771 } | |
| 772 | |
| 757 void SigninScreenHandler::HandleRemoveUser(const base::ListValue* args) { | 773 void SigninScreenHandler::HandleRemoveUser(const base::ListValue* args) { |
| 758 if (!delegate_) | 774 if (!delegate_) |
| 759 return; | 775 return; |
| 760 | 776 |
| 761 std::string email; | 777 std::string email; |
| 762 if (!args->GetString(0, &email)) { | 778 if (!args->GetString(0, &email)) { |
| 763 NOTREACHED(); | 779 NOTREACHED(); |
| 764 return; | 780 return; |
| 765 } | 781 } |
| 766 | 782 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1009 !dns_clear_task_running_ && | 1025 !dns_clear_task_running_ && |
| 1010 network_state_informer_->is_online()) { | 1026 network_state_informer_->is_online()) { |
| 1011 gaia_silent_load_ = true; | 1027 gaia_silent_load_ = true; |
| 1012 gaia_silent_load_network_ = | 1028 gaia_silent_load_network_ = |
| 1013 network_state_informer_->active_network_service_path(); | 1029 network_state_informer_->active_network_service_path(); |
| 1014 LoadAuthExtension(true, true, false); | 1030 LoadAuthExtension(true, true, false); |
| 1015 } | 1031 } |
| 1016 } | 1032 } |
| 1017 | 1033 |
| 1018 } // namespace chromeos | 1034 } // namespace chromeos |
| OLD | NEW |