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

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

Issue 2060623002: Implementation of Device End of Life Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modify browsertest Created 4 years, 6 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) 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 <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 base::CommandLine::ForCurrentProcess()->HasSwitch( 152 base::CommandLine::ForCurrentProcess()->HasSwitch(
153 chromeos::switches::kLoginManager) && 153 chromeos::switches::kLoginManager) &&
154 !user_manager::UserManager::Get()->IsSessionStarted(); 154 !user_manager::UserManager::Get()->IsSessionStarted();
155 } 155 }
156 156
157 void RecordPasswordChangeFlow(LoginPasswordChangeFlow flow) { 157 void RecordPasswordChangeFlow(LoginPasswordChangeFlow flow) {
158 UMA_HISTOGRAM_ENUMERATION("Login.PasswordChangeFlow", flow, 158 UMA_HISTOGRAM_ENUMERATION("Login.PasswordChangeFlow", flow,
159 LOGIN_PASSWORD_CHANGE_FLOW_COUNT); 159 LOGIN_PASSWORD_CHANGE_FLOW_COUNT);
160 } 160 }
161 161
162 bool ShouldShowEolNotification(Profile* profile) {
163 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
164 chromeos::switches::kEnableEolNotification)) {
165 return false;
166 }
167
168 // Do not show end of life notification if this device is managed by
169 // enterprise user.
170 if (g_browser_process->platform_part()
171 ->browser_policy_connector_chromeos()
172 ->IsEnterpriseManaged()) {
173 return false;
174 }
175
176 // Do not show end of life notification if this is a guest session
177 if (profile->IsGuestSession())
178 return false;
179
180 return true;
181 }
182
162 } // namespace 183 } // namespace
163 184
164 // static 185 // static
165 ExistingUserController* ExistingUserController::current_controller_ = nullptr; 186 ExistingUserController* ExistingUserController::current_controller_ = nullptr;
166 187
167 //////////////////////////////////////////////////////////////////////////////// 188 ////////////////////////////////////////////////////////////////////////////////
168 // ExistingUserController, public: 189 // ExistingUserController, public:
169 190
170 ExistingUserController::ExistingUserController(LoginDisplayHost* host) 191 ExistingUserController::ExistingUserController(LoginDisplayHost* host)
171 : host_(host), 192 : host_(host),
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 723
703 if (browser_launched) 724 if (browser_launched)
704 host_ = nullptr; 725 host_ = nullptr;
705 726
706 // Inform |auth_status_consumer_| about successful login. 727 // Inform |auth_status_consumer_| about successful login.
707 // TODO(nkostylev): Pass UserContext back crbug.com/424550 728 // TODO(nkostylev): Pass UserContext back crbug.com/424550
708 if (auth_status_consumer_) { 729 if (auth_status_consumer_) {
709 auth_status_consumer_->OnAuthSuccess( 730 auth_status_consumer_->OnAuthSuccess(
710 UserContext(last_login_attempt_account_id_)); 731 UserContext(last_login_attempt_account_id_));
711 } 732 }
733
734 if (!ShouldShowEolNotification(profile)) {
735 eol_notification_.reset();
736 return;
737 }
738
739 if (!eol_notification_)
740 eol_notification_.reset(new EolNotification(profile));
741 eol_notification_->GetEolStatus();
712 } 742 }
713 743
714 void ExistingUserController::OnOffTheRecordAuthSuccess() { 744 void ExistingUserController::OnOffTheRecordAuthSuccess() {
715 is_login_in_progress_ = false; 745 is_login_in_progress_ = false;
716 746
717 // Mark the device as registered., i.e. the second part of OOBE as completed. 747 // Mark the device as registered., i.e. the second part of OOBE as completed.
718 if (!StartupUtils::IsDeviceRegistered()) 748 if (!StartupUtils::IsDeviceRegistered())
719 StartupUtils::MarkDeviceRegistered(base::Closure()); 749 StartupUtils::MarkDeviceRegistered(base::Closure());
720 750
721 UserSessionManager::GetInstance()->CompleteGuestSessionLogin(guest_mode_url_); 751 UserSessionManager::GetInstance()->CompleteGuestSessionLogin(guest_mode_url_);
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 } 1303 }
1274 1304
1275 // Otherwise, show the unrecoverable cryptohome error UI and ask user's 1305 // Otherwise, show the unrecoverable cryptohome error UI and ask user's
1276 // permission to collect a feedback. 1306 // permission to collect a feedback.
1277 RecordPasswordChangeFlow(LOGIN_PASSWORD_CHANGE_FLOW_CRYPTOHOME_FAILURE); 1307 RecordPasswordChangeFlow(LOGIN_PASSWORD_CHANGE_FLOW_CRYPTOHOME_FAILURE);
1278 VLOG(1) << "Show unrecoverable cryptohome error dialog."; 1308 VLOG(1) << "Show unrecoverable cryptohome error dialog.";
1279 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); 1309 login_display_->ShowUnrecoverableCrypthomeErrorDialog();
1280 } 1310 }
1281 1311
1282 } // namespace chromeos 1312 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698