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

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

Powered by Google App Engine
This is Rietveld 408576698