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

Unified Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 2060623002: Implementation of Device End of Life Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hook EolNotification in UserSessionManager::FinalizePrepareProfile 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/session/user_session_manager.cc
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc
index 2ae53b8129c8a0e37568291cb58fc0339c33cd29..b1cfb22ac70ef93f75410a9d20dc5f8cf7f9fa42 100644
--- a/chrome/browser/chromeos/login/session/user_session_manager.cc
+++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -1210,6 +1210,16 @@ void UserSessionManager::FinalizePrepareProfile(Profile* profile) {
// resolved.
if (delegate_)
delegate_->OnProfilePrepared(profile, browser_launched);
+
+ // Check to see if this profile should show EndOfLife Notification and show
+ // the message accordingly.
+ if (!ShouldShowEolNotification(profile)) {
+ eol_notification_.reset();
+ return;
+ }
+ if (!eol_notification_)
+ eol_notification_.reset(new EolNotification(profile));
+ eol_notification_->CheckEolStatus();
}
void UserSessionManager::ActivateWizard(const std::string& screen_name) {
@@ -1851,4 +1861,25 @@ void UserSessionManager::CreateTokenUtilIfMissing() {
token_handle_util_.reset(new TokenHandleUtil());
}
+bool UserSessionManager::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 chromeos

Powered by Google App Engine
This is Rietveld 408576698