Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 2700303002: cros: Unify oobe View/Actor naming to just View. (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 25 matching lines...) Expand all
36 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 36 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
37 #include "chrome/browser/chromeos/input_method/input_method_util.h" 37 #include "chrome/browser/chromeos/input_method/input_method_util.h"
38 #include "chrome/browser/chromeos/language_preferences.h" 38 #include "chrome/browser/chromeos/language_preferences.h"
39 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" 39 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h"
40 #include "chrome/browser/chromeos/login/hwid_checker.h" 40 #include "chrome/browser/chromeos/login/hwid_checker.h"
41 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 41 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
42 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h" 42 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h"
43 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h" 43 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h"
44 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.h" 44 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.h"
45 #include "chrome/browser/chromeos/login/reauth_stats.h" 45 #include "chrome/browser/chromeos/login/reauth_stats.h"
46 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" 46 #include "chrome/browser/chromeos/login/screens/core_oobe_view.h"
47 #include "chrome/browser/chromeos/login/screens/network_error.h" 47 #include "chrome/browser/chromeos/login/screens/network_error.h"
48 #include "chrome/browser/chromeos/login/startup_utils.h" 48 #include "chrome/browser/chromeos/login/startup_utils.h"
49 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 49 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
50 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 50 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
51 #include "chrome/browser/chromeos/login/ui/login_feedback.h" 51 #include "chrome/browser/chromeos/login/ui/login_feedback.h"
52 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" 52 #include "chrome/browser/chromeos/login/ui/webui_login_display.h"
53 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" 53 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h"
54 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 54 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
55 #include "chrome/browser/chromeos/login/wizard_controller.h" 55 #include "chrome/browser/chromeos/login/wizard_controller.h"
56 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 56 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 284
285 void LoginScreenContext::Init() { 285 void LoginScreenContext::Init() {
286 oobe_ui_ = false; 286 oobe_ui_ = false;
287 } 287 }
288 288
289 // SigninScreenHandler implementation ------------------------------------------ 289 // SigninScreenHandler implementation ------------------------------------------
290 290
291 SigninScreenHandler::SigninScreenHandler( 291 SigninScreenHandler::SigninScreenHandler(
292 const scoped_refptr<NetworkStateInformer>& network_state_informer, 292 const scoped_refptr<NetworkStateInformer>& network_state_informer,
293 ErrorScreen* error_screen, 293 ErrorScreen* error_screen,
294 CoreOobeActor* core_oobe_actor, 294 CoreOobeView* core_oobe_view,
295 GaiaScreenHandler* gaia_screen_handler) 295 GaiaScreenHandler* gaia_screen_handler)
296 : network_state_informer_(network_state_informer), 296 : network_state_informer_(network_state_informer),
297 error_screen_(error_screen), 297 error_screen_(error_screen),
298 core_oobe_actor_(core_oobe_actor), 298 core_oobe_view_(core_oobe_view),
299 caps_lock_enabled_(chromeos::input_method::InputMethodManager::Get() 299 caps_lock_enabled_(chromeos::input_method::InputMethodManager::Get()
300 ->GetImeKeyboard() 300 ->GetImeKeyboard()
301 ->CapsLockIsEnabled()), 301 ->CapsLockIsEnabled()),
302 proxy_auth_dialog_reload_times_(kMaxGaiaReloadForProxyAuthDialog), 302 proxy_auth_dialog_reload_times_(kMaxGaiaReloadForProxyAuthDialog),
303 gaia_screen_handler_(gaia_screen_handler), 303 gaia_screen_handler_(gaia_screen_handler),
304 touch_view_binding_(this), 304 touch_view_binding_(this),
305 histogram_helper_(new ErrorScreensHistogramHelper("Signin")), 305 histogram_helper_(new ErrorScreensHistogramHelper("Signin")),
306 weak_factory_(this) { 306 weak_factory_(this) {
307 DCHECK(network_state_informer_.get()); 307 DCHECK(network_state_informer_.get());
308 DCHECK(error_screen_); 308 DCHECK(error_screen_);
309 DCHECK(core_oobe_actor_); 309 DCHECK(core_oobe_view_);
310 gaia_screen_handler_->set_signin_screen_handler(this); 310 gaia_screen_handler_->set_signin_screen_handler(this);
311 network_state_informer_->AddObserver(this); 311 network_state_informer_->AddObserver(this);
312 312
313 registrar_.Add(this, 313 registrar_.Add(this,
314 chrome::NOTIFICATION_AUTH_NEEDED, 314 chrome::NOTIFICATION_AUTH_NEEDED,
315 content::NotificationService::AllSources()); 315 content::NotificationService::AllSources());
316 registrar_.Add(this, 316 registrar_.Add(this,
317 chrome::NOTIFICATION_AUTH_SUPPLIED, 317 chrome::NOTIFICATION_AUTH_SUPPLIED,
318 content::NotificationService::AllSources()); 318 content::NotificationService::AllSources());
319 registrar_.Add(this, 319 registrar_.Add(this,
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 977
978 void SigninScreenHandler::OnCurrentScreenChanged(OobeScreen current_screen, 978 void SigninScreenHandler::OnCurrentScreenChanged(OobeScreen current_screen,
979 OobeScreen new_screen) { 979 OobeScreen new_screen) {
980 if (new_screen == OobeScreen::SCREEN_ACCOUNT_PICKER) { 980 if (new_screen == OobeScreen::SCREEN_ACCOUNT_PICKER) {
981 // Restore active IME state if returning to user pod row screen. 981 // Restore active IME state if returning to user pod row screen.
982 input_method::InputMethodManager::Get()->SetState(ime_state_); 982 input_method::InputMethodManager::Get()->SetState(ime_state_);
983 } 983 }
984 } 984 }
985 985
986 void SigninScreenHandler::ClearAndEnablePassword() { 986 void SigninScreenHandler::ClearAndEnablePassword() {
987 core_oobe_actor_->ResetSignInUI(false); 987 core_oobe_view_->ResetSignInUI(false);
988 } 988 }
989 989
990 void SigninScreenHandler::ClearUserPodPassword() { 990 void SigninScreenHandler::ClearUserPodPassword() {
991 core_oobe_actor_->ClearUserPodPassword(); 991 core_oobe_view_->ClearUserPodPassword();
992 } 992 }
993 993
994 void SigninScreenHandler::RefocusCurrentPod() { 994 void SigninScreenHandler::RefocusCurrentPod() {
995 core_oobe_actor_->RefocusCurrentPod(); 995 core_oobe_view_->RefocusCurrentPod();
996 } 996 }
997 997
998 void SigninScreenHandler::HidePinKeyboardIfNeeded(const AccountId& account_id) { 998 void SigninScreenHandler::HidePinKeyboardIfNeeded(const AccountId& account_id) {
999 chromeos::quick_unlock::PinStorage* pin_storage = 999 chromeos::quick_unlock::PinStorage* pin_storage =
1000 chromeos::quick_unlock::PinStorageFactory::GetForAccountId(account_id); 1000 chromeos::quick_unlock::PinStorageFactory::GetForAccountId(account_id);
1001 if (pin_storage && !pin_storage->IsPinAuthenticationAvailable()) 1001 if (pin_storage && !pin_storage->IsPinAuthenticationAvailable())
1002 CallJS("login.AccountPickerScreen.disablePinKeyboardForUser", account_id); 1002 CallJS("login.AccountPickerScreen.disablePinKeyboardForUser", account_id);
1003 } 1003 }
1004 1004
1005 void SigninScreenHandler::OnUserRemoved(const AccountId& account_id, 1005 void SigninScreenHandler::OnUserRemoved(const AccountId& account_id,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 } 1048 }
1049 1049
1050 void SigninScreenHandler::ResetSigninScreenHandlerDelegate() { 1050 void SigninScreenHandler::ResetSigninScreenHandlerDelegate() {
1051 SetDelegate(nullptr); 1051 SetDelegate(nullptr);
1052 } 1052 }
1053 1053
1054 void SigninScreenHandler::ShowError(int login_attempts, 1054 void SigninScreenHandler::ShowError(int login_attempts,
1055 const std::string& error_text, 1055 const std::string& error_text,
1056 const std::string& help_link_text, 1056 const std::string& help_link_text,
1057 HelpAppLauncher::HelpTopic help_topic_id) { 1057 HelpAppLauncher::HelpTopic help_topic_id) {
1058 core_oobe_actor_->ShowSignInError(login_attempts, error_text, help_link_text, 1058 core_oobe_view_->ShowSignInError(login_attempts, error_text, help_link_text,
1059 help_topic_id); 1059 help_topic_id);
1060 } 1060 }
1061 1061
1062 void SigninScreenHandler::ShowErrorScreen(LoginDisplay::SigninError error_id) { 1062 void SigninScreenHandler::ShowErrorScreen(LoginDisplay::SigninError error_id) {
1063 switch (error_id) { 1063 switch (error_id) {
1064 case LoginDisplay::TPM_ERROR: 1064 case LoginDisplay::TPM_ERROR:
1065 core_oobe_actor_->ShowTpmError(); 1065 core_oobe_view_->ShowTpmError();
1066 break; 1066 break;
1067 default: 1067 default:
1068 NOTREACHED() << "Unknown sign in error"; 1068 NOTREACHED() << "Unknown sign in error";
1069 break; 1069 break;
1070 } 1070 }
1071 } 1071 }
1072 1072
1073 void SigninScreenHandler::ShowSigninUI(const std::string& email) { 1073 void SigninScreenHandler::ShowSigninUI(const std::string& email) {
1074 core_oobe_actor_->ShowSignInUI(email); 1074 core_oobe_view_->ShowSignInUI(email);
1075 } 1075 }
1076 1076
1077 void SigninScreenHandler::ShowPasswordChangedDialog(bool show_password_error, 1077 void SigninScreenHandler::ShowPasswordChangedDialog(bool show_password_error,
1078 const std::string& email) { 1078 const std::string& email) {
1079 core_oobe_actor_->ShowPasswordChangedScreen(show_password_error, email); 1079 core_oobe_view_->ShowPasswordChangedScreen(show_password_error, email);
1080 } 1080 }
1081 1081
1082 void SigninScreenHandler::ShowSigninScreenForCreds( 1082 void SigninScreenHandler::ShowSigninScreenForCreds(
1083 const std::string& username, 1083 const std::string& username,
1084 const std::string& password) { 1084 const std::string& password) {
1085 gaia_screen_handler_->ShowSigninScreenForTest(username, password); 1085 gaia_screen_handler_->ShowSigninScreenForTest(username, password);
1086 } 1086 }
1087 1087
1088 void SigninScreenHandler::ShowWhitelistCheckFailedError() { 1088 void SigninScreenHandler::ShowWhitelistCheckFailedError() {
1089 gaia_screen_handler_->ShowWhitelistCheckFailedError(); 1089 gaia_screen_handler_->ShowWhitelistCheckFailedError();
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 1301
1302 if (delegate_ && !ScreenLocker::default_screen_locker() && 1302 if (delegate_ && !ScreenLocker::default_screen_locker() &&
1303 !chromeos::IsMachineHWIDCorrect() && 1303 !chromeos::IsMachineHWIDCorrect() &&
1304 !oobe_ui_) { 1304 !oobe_ui_) {
1305 delegate_->ShowWrongHWIDScreen(); 1305 delegate_->ShowWrongHWIDScreen();
1306 return; 1306 return;
1307 } 1307 }
1308 1308
1309 PrefService* prefs = g_browser_process->local_state(); 1309 PrefService* prefs = g_browser_process->local_state();
1310 if (prefs->GetBoolean(prefs::kFactoryResetRequested)) { 1310 if (prefs->GetBoolean(prefs::kFactoryResetRequested)) {
1311 if (core_oobe_actor_) 1311 if (core_oobe_view_)
1312 core_oobe_actor_->ShowDeviceResetScreen(); 1312 core_oobe_view_->ShowDeviceResetScreen();
1313 1313
1314 return; 1314 return;
1315 } else if (prefs->GetBoolean(prefs::kDebuggingFeaturesRequested)) { 1315 } else if (prefs->GetBoolean(prefs::kDebuggingFeaturesRequested)) {
1316 if (core_oobe_actor_) 1316 if (core_oobe_view_)
1317 core_oobe_actor_->ShowEnableDebuggingScreen(); 1317 core_oobe_view_->ShowEnableDebuggingScreen();
1318 1318
1319 return; 1319 return;
1320 } 1320 }
1321 1321
1322 is_account_picker_showing_first_time_ = true; 1322 is_account_picker_showing_first_time_ = true;
1323 1323
1324 if (delegate_) 1324 if (delegate_)
1325 delegate_->OnSigninScreenReady(); 1325 delegate_->OnSigninScreenReady();
1326 } 1326 }
1327 1327
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 rate.initial_delay_in_ms = auto_repeat_delay; 1637 rate.initial_delay_in_ms = auto_repeat_delay;
1638 rate.repeat_interval_in_ms = auto_repeat_interval; 1638 rate.repeat_interval_in_ms = auto_repeat_interval;
1639 input_method::InputMethodManager::Get() 1639 input_method::InputMethodManager::Get()
1640 ->GetImeKeyboard() 1640 ->GetImeKeyboard()
1641 ->SetAutoRepeatEnabled(true); 1641 ->SetAutoRepeatEnabled(true);
1642 input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate( 1642 input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate(
1643 rate); 1643 rate);
1644 } 1644 }
1645 1645
1646 } // namespace chromeos 1646 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698