Chromium Code Reviews| 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..d57c8f9c5fc9a9a51da73b180c3d47af41d77f98 100644 |
| --- a/chrome/browser/chromeos/login/session/user_session_manager.cc |
| +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc |
| @@ -1210,6 +1210,12 @@ 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)) |
| + return; |
| + CheckEolStatus(profile); |
| } |
| void UserSessionManager::ActivateWizard(const std::string& screen_name) { |
| @@ -1669,6 +1675,19 @@ UserSessionManager::GetDefaultIMEState(Profile* profile) { |
| return state; |
| } |
| +void UserSessionManager::CheckEolStatus(Profile* profile) { |
| + std::map<Profile*, std::unique_ptr<EolNotification>, ProfileCompare>::iterator |
| + iter = eol_notification_handler_.find(profile); |
| + if (iter == eol_notification_handler_.end()) { |
| + iter = |
| + eol_notification_handler_ |
| + .insert(std::make_pair(profile, std::unique_ptr<EolNotification>( |
|
oshima
2016/06/17 23:54:58
auto notification = base::WrapUnique(new EolNotifi
xiaoyinh(OOO Sep 11-29)
2016/06/18 01:08:12
Hi, I tried to modify like this, but it didn't com
oshima
2016/06/18 01:23:25
what was the error? Maybe std::move was missing?
|
| + new EolNotification(profile)))) |
| + .first; |
| + } |
| + iter->second->CheckEolStatus(); |
| +} |
| + |
| EasyUnlockKeyManager* UserSessionManager::GetEasyUnlockKeyManager() { |
| if (!easy_unlock_key_manager_) |
| easy_unlock_key_manager_.reset(new EasyUnlockKeyManager); |
| @@ -1851,4 +1870,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; |
|
oshima
2016/06/17 23:54:58
just
return !profile->GeustSession();
xiaoyinh(OOO Sep 11-29)
2016/06/18 01:08:12
Done.
|
| + |
| + return true; |
| +} |
| + |
| } // namespace chromeos |