| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/browser_shutdown.h" | 17 #include "chrome/browser/browser_shutdown.h" |
| 18 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 18 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 19 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 19 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 20 #include "chrome/browser/chromeos/cros/cros_library.h" | 20 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 21 #include "chrome/browser/chromeos/cros/network_library.h" | 21 #include "chrome/browser/chromeos/cros/network_library.h" |
| 22 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 22 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
| 23 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 23 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 24 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 24 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
| 25 #include "chrome/browser/chromeos/login/base_login_display_host.h" | |
| 26 #include "chrome/browser/chromeos/login/hwid_checker.h" | 25 #include "chrome/browser/chromeos/login/hwid_checker.h" |
| 26 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
| 27 #include "chrome/browser/chromeos/login/screen_locker.h" | 27 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 28 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" | 28 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" |
| 29 #include "chrome/browser/chromeos/login/user.h" | 29 #include "chrome/browser/chromeos/login/user.h" |
| 30 #include "chrome/browser/chromeos/login/webui_login_display.h" | 30 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 31 #include "chrome/browser/chromeos/login/wizard_controller.h" | 31 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 32 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 32 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
| 33 #include "chrome/browser/chromeos/settings/cros_settings.h" | 33 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 34 #include "chrome/browser/io_thread.h" | 34 #include "chrome/browser/io_thread.h" |
| 35 #include "chrome/browser/policy/browser_policy_connector.h" | 35 #include "chrome/browser/policy/browser_policy_connector.h" |
| 36 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 | 1087 |
| 1088 void SigninScreenHandler::HandleLaunchIncognito() { | 1088 void SigninScreenHandler::HandleLaunchIncognito() { |
| 1089 if (delegate_) | 1089 if (delegate_) |
| 1090 delegate_->LoginAsGuest(); | 1090 delegate_->LoginAsGuest(); |
| 1091 } | 1091 } |
| 1092 | 1092 |
| 1093 void SigninScreenHandler::HandleShowLocallyManagedUserCreationScreen() { | 1093 void SigninScreenHandler::HandleShowLocallyManagedUserCreationScreen() { |
| 1094 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1094 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 1095 if (!command_line->HasSwitch(::switches::kEnableManagedUsers)) | 1095 if (!command_line->HasSwitch(::switches::kEnableManagedUsers)) |
| 1096 return; | 1096 return; |
| 1097 BaseLoginDisplayHost::default_host()-> | 1097 LoginDisplayHostImpl::default_host()-> |
| 1098 StartWizard(WizardController::kLocallyManagedUserCreationScreenName, | 1098 StartWizard(WizardController::kLocallyManagedUserCreationScreenName, |
| 1099 NULL); | 1099 NULL); |
| 1100 } | 1100 } |
| 1101 | 1101 |
| 1102 void SigninScreenHandler::HandleLaunchPublicAccount( | 1102 void SigninScreenHandler::HandleLaunchPublicAccount( |
| 1103 const std::string& username) { | 1103 const std::string& username) { |
| 1104 if (delegate_) | 1104 if (delegate_) |
| 1105 delegate_->LoginAsPublicAccount(username); | 1105 delegate_->LoginAsPublicAccount(username); |
| 1106 } | 1106 } |
| 1107 | 1107 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 size_t non_owner_count = 0; | 1218 size_t non_owner_count = 0; |
| 1219 | 1219 |
| 1220 ListValue users_list; | 1220 ListValue users_list; |
| 1221 const UserList& users = delegate_->GetUsers(); | 1221 const UserList& users = delegate_->GetUsers(); |
| 1222 | 1222 |
| 1223 // TODO(nkostylev): Show optional intro dialog about multi-profiles feature | 1223 // TODO(nkostylev): Show optional intro dialog about multi-profiles feature |
| 1224 // based on user preferences. http://crbug.com/230862 | 1224 // based on user preferences. http://crbug.com/230862 |
| 1225 | 1225 |
| 1226 // TODO(nkostylev): Move to a separate method in UserManager. | 1226 // TODO(nkostylev): Move to a separate method in UserManager. |
| 1227 // http://crbug.com/230852 | 1227 // http://crbug.com/230852 |
| 1228 bool is_signin_to_add = BaseLoginDisplayHost::default_host() && | 1228 bool is_signin_to_add = LoginDisplayHostImpl::default_host() && |
| 1229 UserManager::Get()->IsUserLoggedIn(); | 1229 UserManager::Get()->IsUserLoggedIn(); |
| 1230 | 1230 |
| 1231 bool single_user = users.size() == 1; | 1231 bool single_user = users.size() == 1; |
| 1232 for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) { | 1232 for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) { |
| 1233 const std::string& email = (*it)->email(); | 1233 const std::string& email = (*it)->email(); |
| 1234 if (is_signin_to_add && (*it)->is_logged_in()) { | 1234 if (is_signin_to_add && (*it)->is_logged_in()) { |
| 1235 // Skip all users that are already signed in. | 1235 // Skip all users that are already signed in. |
| 1236 continue; | 1236 continue; |
| 1237 } | 1237 } |
| 1238 | 1238 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1367 content::NotificationService::AllSources(), | 1367 content::NotificationService::AllSources(), |
| 1368 content::NotificationService::NoDetails()); | 1368 content::NotificationService::NoDetails()); |
| 1369 } | 1369 } |
| 1370 | 1370 |
| 1371 void SigninScreenHandler::HandleCreateAccount() { | 1371 void SigninScreenHandler::HandleCreateAccount() { |
| 1372 if (delegate_) | 1372 if (delegate_) |
| 1373 delegate_->CreateAccount(); | 1373 delegate_->CreateAccount(); |
| 1374 } | 1374 } |
| 1375 | 1375 |
| 1376 void SigninScreenHandler::HandleOpenProxySettings() { | 1376 void SigninScreenHandler::HandleOpenProxySettings() { |
| 1377 BaseLoginDisplayHost::default_host()->OpenProxySettings(); | 1377 LoginDisplayHostImpl::default_host()->OpenProxySettings(); |
| 1378 } | 1378 } |
| 1379 | 1379 |
| 1380 void SigninScreenHandler::HandleLoginVisible(const std::string& source) { | 1380 void SigninScreenHandler::HandleLoginVisible(const std::string& source) { |
| 1381 LOG(INFO) << "Login WebUI >> LoginVisible, source: " << source << ", " | 1381 LOG(INFO) << "Login WebUI >> LoginVisible, source: " << source << ", " |
| 1382 << "webui_visible_: " << webui_visible_; | 1382 << "webui_visible_: " << webui_visible_; |
| 1383 if (!webui_visible_) { | 1383 if (!webui_visible_) { |
| 1384 // There might be multiple messages from OOBE UI so send notifications after | 1384 // There might be multiple messages from OOBE UI so send notifications after |
| 1385 // the first one only. | 1385 // the first one only. |
| 1386 content::NotificationService::current()->Notify( | 1386 content::NotificationService::current()->Notify( |
| 1387 chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE, | 1387 chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE, |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 if (!cros_settings) | 1572 if (!cros_settings) |
| 1573 return false; | 1573 return false; |
| 1574 | 1574 |
| 1575 // Offline login is allowed only when user pods are hidden. | 1575 // Offline login is allowed only when user pods are hidden. |
| 1576 bool show_pods; | 1576 bool show_pods; |
| 1577 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); | 1577 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); |
| 1578 return !show_pods; | 1578 return !show_pods; |
| 1579 } | 1579 } |
| 1580 | 1580 |
| 1581 } // namespace chromeos | 1581 } // namespace chromeos |
| OLD | NEW |