OLD | NEW |
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 Loading... |
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 return; | |
1218 CheckEolStatus(profile); | |
1219 } | 1213 } |
1220 | 1214 |
1221 void UserSessionManager::ActivateWizard(const std::string& screen_name) { | 1215 void UserSessionManager::ActivateWizard(const std::string& screen_name) { |
1222 LoginDisplayHost* host = LoginDisplayHost::default_host(); | 1216 LoginDisplayHost* host = LoginDisplayHost::default_host(); |
1223 CHECK(host); | 1217 CHECK(host); |
1224 host->StartWizard(screen_name); | 1218 host->StartWizard(screen_name); |
1225 } | 1219 } |
1226 | 1220 |
1227 void UserSessionManager::InitializeStartUrls() const { | 1221 void UserSessionManager::InitializeStartUrls() const { |
1228 // Child account status should be known by the time of this call. | 1222 // Child account status should be known by the time of this call. |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 hats_notification_controller_ = new HatsNotificationController(profile); | 1741 hats_notification_controller_ = new HatsNotificationController(profile); |
1748 | 1742 |
1749 // Mark login host for deletion after browser starts. This | 1743 // Mark login host for deletion after browser starts. This |
1750 // guarantees that the message loop will be referenced by the | 1744 // guarantees that the message loop will be referenced by the |
1751 // browser before it is dereferenced by the login host. | 1745 // browser before it is dereferenced by the login host. |
1752 if (login_host) | 1746 if (login_host) |
1753 login_host->Finalize(); | 1747 login_host->Finalize(); |
1754 user_manager::UserManager::Get()->SessionStarted(); | 1748 user_manager::UserManager::Get()->SessionStarted(); |
1755 chromeos::BootTimesRecorder::Get()->LoginDone( | 1749 chromeos::BootTimesRecorder::Get()->LoginDone( |
1756 user_manager::UserManager::Get()->IsCurrentUserNew()); | 1750 user_manager::UserManager::Get()->IsCurrentUserNew()); |
| 1751 |
| 1752 // Check to see if this profile should show EndOfLife Notification and show |
| 1753 // the message accordingly. |
| 1754 if (!ShouldShowEolNotification(profile)) |
| 1755 return; |
| 1756 CheckEolStatus(profile); |
1757 } | 1757 } |
1758 | 1758 |
1759 void UserSessionManager::RespectLocalePreferenceWrapper( | 1759 void UserSessionManager::RespectLocalePreferenceWrapper( |
1760 Profile* profile, | 1760 Profile* profile, |
1761 const base::Closure& callback) { | 1761 const base::Closure& callback) { |
1762 if (browser_shutdown::IsTryingToQuit()) | 1762 if (browser_shutdown::IsTryingToQuit()) |
1763 return; | 1763 return; |
1764 | 1764 |
1765 // InputEventsBlocker is not available in Mash | 1765 // InputEventsBlocker is not available in Mash |
1766 if (chrome::IsRunningInMash()) { | 1766 if (chrome::IsRunningInMash()) { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 token_handle_util_.reset(); | 1866 token_handle_util_.reset(); |
1867 first_run::GoodiesDisplayer::Delete(); | 1867 first_run::GoodiesDisplayer::Delete(); |
1868 } | 1868 } |
1869 | 1869 |
1870 void UserSessionManager::CreateTokenUtilIfMissing() { | 1870 void UserSessionManager::CreateTokenUtilIfMissing() { |
1871 if (!token_handle_util_.get()) | 1871 if (!token_handle_util_.get()) |
1872 token_handle_util_.reset(new TokenHandleUtil()); | 1872 token_handle_util_.reset(new TokenHandleUtil()); |
1873 } | 1873 } |
1874 | 1874 |
1875 bool UserSessionManager::ShouldShowEolNotification(Profile* profile) { | 1875 bool UserSessionManager::ShouldShowEolNotification(Profile* profile) { |
1876 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 1876 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1877 chromeos::switches::kEnableEolNotification)) { | 1877 chromeos::switches::kDisableEolNotification)) { |
1878 return false; | 1878 return false; |
1879 } | 1879 } |
1880 | 1880 |
1881 // Do not show end of life notification if this device is managed by | 1881 // Do not show end of life notification if this device is managed by |
1882 // enterprise user. | 1882 // enterprise user. |
1883 if (g_browser_process->platform_part() | 1883 if (g_browser_process->platform_part() |
1884 ->browser_policy_connector_chromeos() | 1884 ->browser_policy_connector_chromeos() |
1885 ->IsEnterpriseManaged()) { | 1885 ->IsEnterpriseManaged()) { |
1886 return false; | 1886 return false; |
1887 } | 1887 } |
1888 | 1888 |
1889 // Do not show end of life notification if this is a guest session | 1889 // Do not show end of life notification if this is a guest session |
1890 return !profile->IsGuestSession(); | 1890 return !profile->IsGuestSession(); |
1891 } | 1891 } |
1892 | 1892 |
1893 } // namespace chromeos | 1893 } // namespace chromeos |
OLD | NEW |