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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/existing_user_controller.cc
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index 3a1848ca433b42cfb2a545e7efc63465d9e94d33..4cb495998441f99a3b835896dc4eabd9b48d8bdc 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -159,6 +159,27 @@ void RecordPasswordChangeFlow(LoginPasswordChangeFlow flow) {
LOGIN_PASSWORD_CHANGE_FLOW_COUNT);
}
+bool ShouldShowEolNotification(Profile* profile) {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kEnableEolNotification)) {
+ return false;
+ }
+
+ // Do not show end of life notification if this device is managed by
+ // enterprise user.
+ if (g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->IsEnterpriseManaged()) {
+ return false;
+ }
+
+ // Do not show end of life notification if this is a guest session
+ if (profile->IsGuestSession())
+ return false;
+
+ return true;
+}
+
} // namespace
// static
@@ -709,6 +730,15 @@ void ExistingUserController::OnProfilePrepared(Profile* profile,
auth_status_consumer_->OnAuthSuccess(
UserContext(last_login_attempt_account_id_));
}
+
+ if (!ShouldShowEolNotification(profile)) {
+ eol_notification_.reset();
+ return;
+ }
+
+ if (!eol_notification_)
+ eol_notification_.reset(new EolNotification(profile));
+ eol_notification_->GetEolStatus();
}
void ExistingUserController::OnOffTheRecordAuthSuccess() {

Powered by Google App Engine
This is Rietveld 408576698