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

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

Issue 363613004: [cros] Define session_manager component with SessionManager base class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 07bfdbd19efa59d77e00b2f4e27486649a138248..f829bdb08658bc6ff031c2def7987cf85cd59b1f 100644
--- a/chrome/browser/chromeos/login/session/user_session_manager.cc
+++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -55,6 +55,7 @@
#include "chromeos/ime/input_method_manager.h"
#include "chromeos/network/portal_detector/network_portal_detector.h"
#include "chromeos/network/portal_detector/network_portal_detector_strategy.h"
+#include "components/session_manager/core/session_manager.h"
#include "components/signin/core/browser/signin_manager_base.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
@@ -466,11 +467,15 @@ void UserSessionManager::OnNewRefreshTokenAvaiable(Profile* user_profile) {
void UserSessionManager::OnConnectionTypeChanged(
net::NetworkChangeNotifier::ConnectionType type) {
+ bool is_running_test =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ ::switches::kTestName) ||
+ base::CommandLine::ForCurrentProcess()->HasSwitch(::switches::kTestType);
UserManager* user_manager = UserManager::Get();
if (type == net::NetworkChangeNotifier::CONNECTION_NONE ||
!user_manager->IsUserLoggedIn() ||
!user_manager->IsLoggedInAsRegularUser() ||
- user_manager->IsLoggedInAsStub()) {
+ user_manager->IsLoggedInAsStub() || is_running_test) {
return;
}
@@ -682,6 +687,9 @@ void UserSessionManager::FinalizePrepareProfile(Profile* profile) {
profile->OnLogin();
+ g_browser_process->platform_part()->SessionManager()->SetSessionState(
+ session_manager::SESSION_STATE_LOGGED_IN_NOT_ACTIVE);
+
// Send the notification before creating the browser so additional objects
// that need the profile (e.g. the launcher) can be created first.
content::NotificationService::current()->Notify(

Powered by Google App Engine
This is Rietveld 408576698