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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 539273002: Added UI to enable debugging features on CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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) 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/chromeos/login/existing_user_controller.h" 5 #include "chrome/browser/chromeos/login/existing_user_controller.h"
6 6
7 #include <vector> 7 #include <vector>
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 void RecordPasswordLoginEvent(const UserContext& user_context) { 130 void RecordPasswordLoginEvent(const UserContext& user_context) {
131 EasyUnlockService* easy_unlock_service = 131 EasyUnlockService* easy_unlock_service =
132 EasyUnlockService::Get(ProfileHelper::GetSigninProfile()); 132 EasyUnlockService::Get(ProfileHelper::GetSigninProfile());
133 if (user_context.GetUserType() == user_manager::USER_TYPE_REGULAR && 133 if (user_context.GetUserType() == user_manager::USER_TYPE_REGULAR &&
134 user_context.GetAuthFlow() == UserContext::AUTH_FLOW_OFFLINE && 134 user_context.GetAuthFlow() == UserContext::AUTH_FLOW_OFFLINE &&
135 easy_unlock_service) { 135 easy_unlock_service) {
136 easy_unlock_service->RecordPasswordLoginEvent(user_context.GetUserID()); 136 easy_unlock_service->RecordPasswordLoginEvent(user_context.GetUserID());
137 } 137 }
138 } 138 }
139 139
140 bool CanShowDebuggingFeatures() {
141 // We need to be on the login screen and in dev mode to show this menu item.
142 return CommandLine::ForCurrentProcess()->HasSwitch(
143 chromeos::switches::kSystemDevMode) &&
144 CommandLine::ForCurrentProcess()->HasSwitch(
145 chromeos::switches::kLoginManager) &&
146 !user_manager::UserManager::Get()->IsSessionStarted();
147 }
148
140 } // namespace 149 } // namespace
141 150
142 // static 151 // static
143 ExistingUserController* ExistingUserController::current_controller_ = NULL; 152 ExistingUserController* ExistingUserController::current_controller_ = NULL;
144 153
145 //////////////////////////////////////////////////////////////////////////////// 154 ////////////////////////////////////////////////////////////////////////////////
146 // ExistingUserController, public: 155 // ExistingUserController, public:
147 156
148 ExistingUserController::ExistingUserController(LoginDisplayHost* host) 157 ExistingUserController::ExistingUserController(LoginDisplayHost* host)
149 : auth_status_consumer_(NULL), 158 : auth_status_consumer_(NULL),
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 LOG(WARNING) << "Enterprise enrollment is not available after kiosk auto " 656 LOG(WARNING) << "Enterprise enrollment is not available after kiosk auto "
648 "launch is set."; 657 "launch is set.";
649 return; 658 return;
650 } 659 }
651 660
652 DeviceSettingsService::Get()->GetOwnershipStatusAsync( 661 DeviceSettingsService::Get()->GetOwnershipStatusAsync(
653 base::Bind(&ExistingUserController::OnEnrollmentOwnershipCheckCompleted, 662 base::Bind(&ExistingUserController::OnEnrollmentOwnershipCheckCompleted,
654 weak_factory_.GetWeakPtr())); 663 weak_factory_.GetWeakPtr()));
655 } 664 }
656 665
666 void ExistingUserController::OnStartEnableDebuggingScreen() {
667 if (CanShowDebuggingFeatures())
668 ShowEnableDebuggingScreen();
669 }
670
657 void ExistingUserController::OnStartKioskEnableScreen() { 671 void ExistingUserController::OnStartKioskEnableScreen() {
658 KioskAppManager::Get()->GetConsumerKioskAutoLaunchStatus( 672 KioskAppManager::Get()->GetConsumerKioskAutoLaunchStatus(
659 base::Bind( 673 base::Bind(
660 &ExistingUserController::OnConsumerKioskAutoLaunchCheckCompleted, 674 &ExistingUserController::OnConsumerKioskAutoLaunchCheckCompleted,
661 weak_factory_.GetWeakPtr())); 675 weak_factory_.GetWeakPtr()));
662 } 676 }
663 677
664 void ExistingUserController::OnStartKioskAutolaunchScreen() { 678 void ExistingUserController::OnStartKioskAutolaunchScreen() {
665 ShowKioskAutolaunchScreen(); 679 ShowKioskAutolaunchScreen();
666 } 680 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 } 736 }
723 host_->StartWizard(WizardController::kEnrollmentScreenName, 737 host_->StartWizard(WizardController::kEnrollmentScreenName,
724 params.Pass()); 738 params.Pass());
725 } 739 }
726 740
727 void ExistingUserController::ShowResetScreen() { 741 void ExistingUserController::ShowResetScreen() {
728 scoped_ptr<base::DictionaryValue> params; 742 scoped_ptr<base::DictionaryValue> params;
729 host_->StartWizard(WizardController::kResetScreenName, params.Pass()); 743 host_->StartWizard(WizardController::kResetScreenName, params.Pass());
730 } 744 }
731 745
746 void ExistingUserController::ShowEnableDebuggingScreen() {
747 scoped_ptr<base::DictionaryValue> params;
748 host_->StartWizard(WizardController::kEnableDebuggingScreenName,
749 params.Pass());
750 }
751
732 void ExistingUserController::ShowKioskEnableScreen() { 752 void ExistingUserController::ShowKioskEnableScreen() {
733 scoped_ptr<base::DictionaryValue> params; 753 scoped_ptr<base::DictionaryValue> params;
734 host_->StartWizard(WizardController::kKioskEnableScreenName, params.Pass()); 754 host_->StartWizard(WizardController::kKioskEnableScreenName, params.Pass());
735 } 755 }
736 756
737 void ExistingUserController::ShowKioskAutolaunchScreen() { 757 void ExistingUserController::ShowKioskAutolaunchScreen() {
738 scoped_ptr<base::DictionaryValue> params; 758 scoped_ptr<base::DictionaryValue> params;
739 host_->StartWizard(WizardController::kKioskAutolaunchScreenName, 759 host_->StartWizard(WizardController::kKioskAutolaunchScreenName,
740 params.Pass()); 760 params.Pass());
741 } 761 }
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 is_login_in_progress_ = false; 1210 is_login_in_progress_ = false;
1191 1211
1192 // Reenable clicking on other windows and status area. 1212 // Reenable clicking on other windows and status area.
1193 login_display_->SetUIEnabled(true); 1213 login_display_->SetUIEnabled(true);
1194 1214
1195 if (start_public_session_timer) 1215 if (start_public_session_timer)
1196 StartPublicSessionAutoLoginTimer(); 1216 StartPublicSessionAutoLoginTimer();
1197 } 1217 }
1198 1218
1199 } // namespace chromeos 1219 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698