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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/session/user_session_manager.h" 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 ProfileHelper::Get()->FlushProfile(profile); 1203 ProfileHelper::Get()->FlushProfile(profile);
1204 1204
1205 // TODO(nkostylev): This pointer should probably never be NULL, but it looks 1205 // TODO(nkostylev): This pointer should probably never be NULL, but it looks
1206 // like OnProfileCreated() may be getting called before 1206 // like OnProfileCreated() may be getting called before
1207 // UserSessionManager::PrepareProfile() has set |delegate_| when Chrome is 1207 // UserSessionManager::PrepareProfile() has set |delegate_| when Chrome is
1208 // killed during shutdown in tests -- see http://crosbug.com/18269. Replace 1208 // killed during shutdown in tests -- see http://crosbug.com/18269. Replace
1209 // this 'if' statement with a CHECK(delegate_) once the underlying issue is 1209 // this 'if' statement with a CHECK(delegate_) once the underlying issue is
1210 // resolved. 1210 // resolved.
1211 if (delegate_) 1211 if (delegate_)
1212 delegate_->OnProfilePrepared(profile, browser_launched); 1212 delegate_->OnProfilePrepared(profile, browser_launched);
1213
1214 // Check to see if this profile should show EndOfLife Notification and show
1215 // the message accordingly.
1216 if (!ShouldShowEolNotification(profile)) {
1217 eol_notification_.reset();
1218 return;
1219 }
1220 if (!eol_notification_)
1221 eol_notification_.reset(new EolNotification(profile));
1222 eol_notification_->CheckEolStatus();
1213 } 1223 }
1214 1224
1215 void UserSessionManager::ActivateWizard(const std::string& screen_name) { 1225 void UserSessionManager::ActivateWizard(const std::string& screen_name) {
1216 LoginDisplayHost* host = LoginDisplayHost::default_host(); 1226 LoginDisplayHost* host = LoginDisplayHost::default_host();
1217 CHECK(host); 1227 CHECK(host);
1218 host->StartWizard(screen_name); 1228 host->StartWizard(screen_name);
1219 } 1229 }
1220 1230
1221 void UserSessionManager::InitializeStartUrls() const { 1231 void UserSessionManager::InitializeStartUrls() const {
1222 // Child account status should be known by the time of this call. 1232 // Child account status should be known by the time of this call.
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1844 token_handle_fetcher_.reset(); 1854 token_handle_fetcher_.reset();
1845 token_handle_util_.reset(); 1855 token_handle_util_.reset();
1846 first_run::GoodiesDisplayer::Delete(); 1856 first_run::GoodiesDisplayer::Delete();
1847 } 1857 }
1848 1858
1849 void UserSessionManager::CreateTokenUtilIfMissing() { 1859 void UserSessionManager::CreateTokenUtilIfMissing() {
1850 if (!token_handle_util_.get()) 1860 if (!token_handle_util_.get())
1851 token_handle_util_.reset(new TokenHandleUtil()); 1861 token_handle_util_.reset(new TokenHandleUtil());
1852 } 1862 }
1853 1863
1864 bool UserSessionManager::ShouldShowEolNotification(Profile* profile) {
1865 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
1866 chromeos::switches::kEnableEolNotification)) {
1867 return false;
1868 }
1869
1870 // Do not show end of life notification if this device is managed by
1871 // enterprise user.
1872 if (g_browser_process->platform_part()
1873 ->browser_policy_connector_chromeos()
1874 ->IsEnterpriseManaged()) {
1875 return false;
1876 }
1877
1878 // Do not show end of life notification if this is a guest session
1879 if (profile->IsGuestSession())
1880 return false;
1881
1882 return true;
1883 }
1884
1854 } // namespace chromeos 1885 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698