| 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" |
| 11 #include "base/command_line.h" | |
| 12 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 13 #include "base/location.h" | 12 #include "base/location.h" |
| 14 #include "base/logging.h" | 13 #include "base/logging.h" |
| 15 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 16 #include "base/prefs/pref_registry_simple.h" | 15 #include "base/prefs/pref_registry_simple.h" |
| 17 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.h" |
| 18 #include "base/prefs/scoped_user_pref_update.h" | 17 #include "base/prefs/scoped_user_pref_update.h" |
| 19 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
| 20 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
| 21 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 45 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 44 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 46 #include "chrome/browser/chromeos/settings/cros_settings.h" | 45 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 47 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" | 46 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" |
| 48 #include "chrome/browser/io_thread.h" | 47 #include "chrome/browser/io_thread.h" |
| 49 #include "chrome/browser/profiles/profile.h" | 48 #include "chrome/browser/profiles/profile.h" |
| 50 #include "chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retrie
ver.h" | 49 #include "chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retrie
ver.h" |
| 51 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" | 50 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" |
| 52 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" | 51 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" |
| 53 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 52 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 54 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 53 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 55 #include "chrome/common/chrome_switches.h" | |
| 56 #include "chrome/common/pref_names.h" | 54 #include "chrome/common/pref_names.h" |
| 57 #include "chrome/common/url_constants.h" | 55 #include "chrome/common/url_constants.h" |
| 58 #include "chromeos/chromeos_switches.h" | |
| 59 #include "chromeos/dbus/dbus_thread_manager.h" | 56 #include "chromeos/dbus/dbus_thread_manager.h" |
| 60 #include "chromeos/dbus/power_manager_client.h" | 57 #include "chromeos/dbus/power_manager_client.h" |
| 61 #include "chromeos/ime/ime_keyboard.h" | 58 #include "chromeos/ime/ime_keyboard.h" |
| 62 #include "chromeos/ime/input_method_manager.h" | 59 #include "chromeos/ime/input_method_manager.h" |
| 63 #include "chromeos/network/network_state.h" | 60 #include "chromeos/network/network_state.h" |
| 64 #include "chromeos/network/network_state_handler.h" | 61 #include "chromeos/network/network_state_handler.h" |
| 65 #include "chromeos/network/portal_detector/network_portal_detector.h" | 62 #include "chromeos/network/portal_detector/network_portal_detector.h" |
| 66 #include "content/public/browser/render_frame_host.h" | 63 #include "content/public/browser/render_frame_host.h" |
| 67 #include "content/public/browser/web_contents.h" | 64 #include "content/public/browser/web_contents.h" |
| 68 #include "google_apis/gaia/gaia_auth_util.h" | 65 #include "google_apis/gaia/gaia_auth_util.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 builder->Add("easyUnlockTooltip", | 379 builder->Add("easyUnlockTooltip", |
| 383 IDS_LOGIN_EASY_UNLOCK_TOOLTIP); | 380 IDS_LOGIN_EASY_UNLOCK_TOOLTIP); |
| 384 | 381 |
| 385 builder->Add("fatalEnrollmentError", | 382 builder->Add("fatalEnrollmentError", |
| 386 IDS_ENTERPRISE_ENROLLMENT_AUTH_FATAL_ERROR); | 383 IDS_ENTERPRISE_ENROLLMENT_AUTH_FATAL_ERROR); |
| 387 builder->Add("insecureURLEnrollmentError", | 384 builder->Add("insecureURLEnrollmentError", |
| 388 IDS_ENTERPRISE_ENROLLMENT_AUTH_INSECURE_URL_ERROR); | 385 IDS_ENTERPRISE_ENROLLMENT_AUTH_INSECURE_URL_ERROR); |
| 389 | 386 |
| 390 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) | 387 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) |
| 391 builder->Add("demoLoginMessage", IDS_KIOSK_MODE_LOGIN_MESSAGE); | 388 builder->Add("demoLoginMessage", IDS_KIOSK_MODE_LOGIN_MESSAGE); |
| 392 | |
| 393 builder->Add("runType", CommandLine::ForCurrentProcess()->HasSwitch( | |
| 394 switches::kFirstExecAfterBoot) ? "firstExecAfterBoot" : | |
| 395 "notFirstExecAfterBoot"); | |
| 396 } | 389 } |
| 397 | 390 |
| 398 void SigninScreenHandler::Show(const LoginScreenContext& context) { | 391 void SigninScreenHandler::Show(const LoginScreenContext& context) { |
| 399 CHECK(delegate_); | 392 CHECK(delegate_); |
| 400 | 393 |
| 401 // Just initialize internal fields from context and call ShowImpl(). | 394 // Just initialize internal fields from context and call ShowImpl(). |
| 402 oobe_ui_ = context.oobe_ui(); | 395 oobe_ui_ = context.oobe_ui(); |
| 403 gaia_screen_handler_->PopulateEmail(context.email()); | 396 gaia_screen_handler_->PopulateEmail(context.email()); |
| 404 ShowImpl(); | 397 ShowImpl(); |
| 405 } | 398 } |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 } | 1097 } |
| 1105 | 1098 |
| 1106 void SigninScreenHandler::HandleToggleKioskAutolaunchScreen() { | 1099 void SigninScreenHandler::HandleToggleKioskAutolaunchScreen() { |
| 1107 policy::BrowserPolicyConnectorChromeOS* connector = | 1100 policy::BrowserPolicyConnectorChromeOS* connector = |
| 1108 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 1101 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 1109 if (delegate_ && !connector->IsEnterpriseManaged()) | 1102 if (delegate_ && !connector->IsEnterpriseManaged()) |
| 1110 delegate_->ShowKioskAutolaunchScreen(); | 1103 delegate_->ShowKioskAutolaunchScreen(); |
| 1111 } | 1104 } |
| 1112 | 1105 |
| 1113 void SigninScreenHandler::LoadUsers(const base::ListValue& users_list, | 1106 void SigninScreenHandler::LoadUsers(const base::ListValue& users_list, |
| 1114 bool animated, | |
| 1115 bool showGuest) { | 1107 bool showGuest) { |
| 1116 CallJS("login.AccountPickerScreen.loadUsers", | 1108 CallJS("login.AccountPickerScreen.loadUsers", |
| 1117 users_list, | 1109 users_list, |
| 1118 animated, | |
| 1119 delegate_->IsShowGuest()); | 1110 delegate_->IsShowGuest()); |
| 1120 } | 1111 } |
| 1121 | 1112 |
| 1122 void SigninScreenHandler::HandleAccountPickerReady() { | 1113 void SigninScreenHandler::HandleAccountPickerReady() { |
| 1123 VLOG(0) << "Login WebUI >> AccountPickerReady"; | 1114 VLOG(0) << "Login WebUI >> AccountPickerReady"; |
| 1124 | 1115 |
| 1125 if (delegate_ && !ScreenLocker::default_screen_locker() && | 1116 if (delegate_ && !ScreenLocker::default_screen_locker() && |
| 1126 !chromeos::IsMachineHWIDCorrect() && | 1117 !chromeos::IsMachineHWIDCorrect() && |
| 1127 !oobe_ui_) { | 1118 !oobe_ui_) { |
| 1128 delegate_->ShowWrongHWIDScreen(); | 1119 delegate_->ShowWrongHWIDScreen(); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1393 return gaia_screen_handler_->frame_error(); | 1384 return gaia_screen_handler_->frame_error(); |
| 1394 } | 1385 } |
| 1395 | 1386 |
| 1396 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { | 1387 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { |
| 1397 caps_lock_enabled_ = enabled; | 1388 caps_lock_enabled_ = enabled; |
| 1398 if (page_is_ready()) | 1389 if (page_is_ready()) |
| 1399 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); | 1390 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); |
| 1400 } | 1391 } |
| 1401 | 1392 |
| 1402 } // namespace chromeos | 1393 } // namespace chromeos |
| OLD | NEW |