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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 33 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
34 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" | 34 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" |
35 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 35 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
36 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 36 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
37 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 37 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
38 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 38 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
39 #include "chrome/browser/chromeos/login/users/user_manager.h" | 39 #include "chrome/browser/chromeos/login/users/user_manager.h" |
40 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 40 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
41 #include "chrome/browser/chromeos/login/wizard_controller.h" | 41 #include "chrome/browser/chromeos/login/wizard_controller.h" |
42 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 42 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
43 #include "chrome/browser/chromeos/policy/consumer_management_service.h" | |
43 #include "chrome/browser/chromeos/policy/device_local_account.h" | 44 #include "chrome/browser/chromeos/policy/device_local_account.h" |
44 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 45 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
45 #include "chrome/browser/chromeos/settings/cros_settings.h" | 46 #include "chrome/browser/chromeos/settings/cros_settings.h" |
46 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap i.h" | 47 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap i.h" |
47 #include "chrome/browser/io_thread.h" | 48 #include "chrome/browser/io_thread.h" |
48 #include "chrome/browser/profiles/profile.h" | 49 #include "chrome/browser/profiles/profile.h" |
49 #include "chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retrie ver.h" | 50 #include "chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retrie ver.h" |
50 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" | 51 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" |
51 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 52 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
52 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" | 53 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 registrar_.Add(this, | 294 registrar_.Add(this, |
294 chrome::NOTIFICATION_AUTH_CANCELLED, | 295 chrome::NOTIFICATION_AUTH_CANCELLED, |
295 content::NotificationService::AllSources()); | 296 content::NotificationService::AllSources()); |
296 | 297 |
297 chromeos::input_method::ImeKeyboard* keyboard = | 298 chromeos::input_method::ImeKeyboard* keyboard = |
298 chromeos::input_method::InputMethodManager::Get()->GetImeKeyboard(); | 299 chromeos::input_method::InputMethodManager::Get()->GetImeKeyboard(); |
299 if (keyboard) | 300 if (keyboard) |
300 keyboard->AddObserver(this); | 301 keyboard->AddObserver(this); |
301 | 302 |
302 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 303 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
303 PrefService* prefs = g_browser_process->local_state(); | 304 policy::BrowserPolicyConnectorChromeOS* connector = |
305 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | |
304 is_enrolling_consumer_management_ = | 306 is_enrolling_consumer_management_ = |
305 command_line->HasSwitch(chromeos::switches::kEnableConsumerManagement) && | 307 command_line->HasSwitch(chromeos::switches::kEnableConsumerManagement) && |
306 prefs->GetBoolean(prefs::kConsumerManagementEnrollmentRequested); | 308 connector->GetConsumerManagementService()->GetEnrollState() == |
bartfab (slow)
2014/08/04 18:44:56
Nit: Indent two more spaces.
davidyu
2014/08/05 07:27:00
Done.
| |
307 | 309 policy::ConsumerManagementService::ENROLL_ENROLLING; |
bartfab (slow)
2014/08/04 18:44:56
Nit: Indent two more spaces.
davidyu
2014/08/05 07:27:01
Done.
| |
308 } | 310 } |
309 | 311 |
310 SigninScreenHandler::~SigninScreenHandler() { | 312 SigninScreenHandler::~SigninScreenHandler() { |
311 chromeos::input_method::ImeKeyboard* keyboard = | 313 chromeos::input_method::ImeKeyboard* keyboard = |
312 chromeos::input_method::InputMethodManager::Get()->GetImeKeyboard(); | 314 chromeos::input_method::InputMethodManager::Get()->GetImeKeyboard(); |
313 if (keyboard) | 315 if (keyboard) |
314 keyboard->RemoveObserver(this); | 316 keyboard->RemoveObserver(this); |
315 weak_factory_.InvalidateWeakPtrs(); | 317 weak_factory_.InvalidateWeakPtrs(); |
316 if (delegate_) | 318 if (delegate_) |
317 delegate_->SetWebUIHandler(NULL); | 319 delegate_->SetWebUIHandler(NULL); |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1338 void SigninScreenHandler::HandleLaunchKioskApp(const std::string& app_id, | 1340 void SigninScreenHandler::HandleLaunchKioskApp(const std::string& app_id, |
1339 bool diagnostic_mode) { | 1341 bool diagnostic_mode) { |
1340 UserContext context(user_manager::USER_TYPE_KIOSK_APP, app_id); | 1342 UserContext context(user_manager::USER_TYPE_KIOSK_APP, app_id); |
1341 SigninSpecifics specifics; | 1343 SigninSpecifics specifics; |
1342 specifics.kiosk_diagnostic_mode = diagnostic_mode; | 1344 specifics.kiosk_diagnostic_mode = diagnostic_mode; |
1343 if (delegate_) | 1345 if (delegate_) |
1344 delegate_->Login(context, specifics); | 1346 delegate_->Login(context, specifics); |
1345 } | 1347 } |
1346 | 1348 |
1347 void SigninScreenHandler::HandleCancelConsumerManagementEnrollment() { | 1349 void SigninScreenHandler::HandleCancelConsumerManagementEnrollment() { |
1348 PrefService* prefs = g_browser_process->local_state(); | 1350 policy::BrowserPolicyConnectorChromeOS* connector = |
1349 prefs->SetBoolean(prefs::kConsumerManagementEnrollmentRequested, false); | 1351 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
1352 connector->GetConsumerManagementService()->SetEnrollState( | |
1353 policy::ConsumerManagementService::ENROLL_CANCELED); | |
1350 is_enrolling_consumer_management_ = false; | 1354 is_enrolling_consumer_management_ = false; |
1351 ShowImpl(); | 1355 ShowImpl(); |
1352 } | 1356 } |
1353 | 1357 |
1354 bool SigninScreenHandler::AllWhitelistedUsersPresent() { | 1358 bool SigninScreenHandler::AllWhitelistedUsersPresent() { |
1355 CrosSettings* cros_settings = CrosSettings::Get(); | 1359 CrosSettings* cros_settings = CrosSettings::Get(); |
1356 bool allow_new_user = false; | 1360 bool allow_new_user = false; |
1357 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 1361 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
1358 if (allow_new_user) | 1362 if (allow_new_user) |
1359 return false; | 1363 return false; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1469 return gaia_screen_handler_->frame_error(); | 1473 return gaia_screen_handler_->frame_error(); |
1470 } | 1474 } |
1471 | 1475 |
1472 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { | 1476 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { |
1473 caps_lock_enabled_ = enabled; | 1477 caps_lock_enabled_ = enabled; |
1474 if (page_is_ready()) | 1478 if (page_is_ready()) |
1475 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); | 1479 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); |
1476 } | 1480 } |
1477 | 1481 |
1478 } // namespace chromeos | 1482 } // namespace chromeos |
OLD | NEW |