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 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 if (RestartToApplyPerSessionFlagsIfNeed(profile, false)) | 1745 if (RestartToApplyPerSessionFlagsIfNeed(profile, false)) |
1746 return; | 1746 return; |
1747 | 1747 |
1748 if (login_host) { | 1748 if (login_host) { |
1749 login_host->SetStatusAreaVisible(true); | 1749 login_host->SetStatusAreaVisible(true); |
1750 login_host->BeforeSessionStart(); | 1750 login_host->BeforeSessionStart(); |
1751 } | 1751 } |
1752 | 1752 |
1753 BootTimesRecorder::Get()->AddLoginTimeMarker("BrowserLaunched", false); | 1753 BootTimesRecorder::Get()->AddLoginTimeMarker("BrowserLaunched", false); |
1754 | 1754 |
| 1755 // Mark user session as started before creating browser window. Otherwise, |
| 1756 // ash would not activate the created browser window because it thinks |
| 1757 // user session is blocked. |
| 1758 session_manager::SessionManager::Get()->SessionStarted(); |
| 1759 |
1755 VLOG(1) << "Launching browser..."; | 1760 VLOG(1) << "Launching browser..."; |
1756 TRACE_EVENT0("login", "LaunchBrowser"); | 1761 TRACE_EVENT0("login", "LaunchBrowser"); |
1757 | 1762 |
1758 if (should_launch_browser_) { | 1763 if (should_launch_browser_) { |
1759 StartupBrowserCreator browser_creator; | 1764 StartupBrowserCreator browser_creator; |
1760 chrome::startup::IsFirstRun first_run = | 1765 chrome::startup::IsFirstRun first_run = |
1761 ::first_run::IsChromeFirstRun() ? chrome::startup::IS_FIRST_RUN | 1766 ::first_run::IsChromeFirstRun() ? chrome::startup::IS_FIRST_RUN |
1762 : chrome::startup::IS_NOT_FIRST_RUN; | 1767 : chrome::startup::IS_NOT_FIRST_RUN; |
1763 | 1768 |
1764 browser_creator.LaunchBrowser( | 1769 browser_creator.LaunchBrowser( |
(...skipping 26 matching lines...) Expand all Loading... |
1791 quick_unlock::QuickUnlockNotificationController::CreateForPin(profile); | 1796 quick_unlock::QuickUnlockNotificationController::CreateForPin(profile); |
1792 quick_unlock_notification_handler_.insert( | 1797 quick_unlock_notification_handler_.insert( |
1793 std::make_pair(profile, qu_feature_notification_controller)); | 1798 std::make_pair(profile, qu_feature_notification_controller)); |
1794 } | 1799 } |
1795 | 1800 |
1796 // Mark login host for deletion after browser starts. This | 1801 // Mark login host for deletion after browser starts. This |
1797 // guarantees that the message loop will be referenced by the | 1802 // guarantees that the message loop will be referenced by the |
1798 // browser before it is dereferenced by the login host. | 1803 // browser before it is dereferenced by the login host. |
1799 if (login_host) | 1804 if (login_host) |
1800 login_host->Finalize(); | 1805 login_host->Finalize(); |
1801 session_manager::SessionManager::Get()->SessionStarted(); | |
1802 chromeos::BootTimesRecorder::Get()->LoginDone( | 1806 chromeos::BootTimesRecorder::Get()->LoginDone( |
1803 user_manager::UserManager::Get()->IsCurrentUserNew()); | 1807 user_manager::UserManager::Get()->IsCurrentUserNew()); |
1804 | 1808 |
1805 // Check to see if this profile should show EndOfLife Notification and show | 1809 // Check to see if this profile should show EndOfLife Notification and show |
1806 // the message accordingly. | 1810 // the message accordingly. |
1807 if (ShouldShowEolNotification(profile)) | 1811 if (ShouldShowEolNotification(profile)) |
1808 CheckEolStatus(profile); | 1812 CheckEolStatus(profile); |
1809 } | 1813 } |
1810 | 1814 |
1811 void UserSessionManager::RespectLocalePreferenceWrapper( | 1815 void UserSessionManager::RespectLocalePreferenceWrapper( |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1924 ->browser_policy_connector_chromeos() | 1928 ->browser_policy_connector_chromeos() |
1925 ->IsEnterpriseManaged()) { | 1929 ->IsEnterpriseManaged()) { |
1926 return false; | 1930 return false; |
1927 } | 1931 } |
1928 | 1932 |
1929 // Do not show end of life notification if this is a guest session | 1933 // Do not show end of life notification if this is a guest session |
1930 return !profile->IsGuestSession(); | 1934 return !profile->IsGuestSession(); |
1931 } | 1935 } |
1932 | 1936 |
1933 } // namespace chromeos | 1937 } // namespace chromeos |
OLD | NEW |