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

Side by Side Diff: chrome/browser/chromeos/login/users/user_manager_impl.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 unified diff | Download patch | Annotate | Revision Log
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/users/user_manager_impl.h" 5 #include "chrome/browser/chromeos/login/users/user_manager_impl.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <set> 8 #include <set>
9 9
10 #include "ash/multi_profile_uma.h" 10 #include "ash/multi_profile_uma.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "chrome/common/chrome_constants.h" 52 #include "chrome/common/chrome_constants.h"
53 #include "chrome/common/chrome_paths.h" 53 #include "chrome/common/chrome_paths.h"
54 #include "chrome/common/chrome_switches.h" 54 #include "chrome/common/chrome_switches.h"
55 #include "chrome/common/crash_keys.h" 55 #include "chrome/common/crash_keys.h"
56 #include "chrome/common/pref_names.h" 56 #include "chrome/common/pref_names.h"
57 #include "chromeos/chromeos_switches.h" 57 #include "chromeos/chromeos_switches.h"
58 #include "chromeos/cryptohome/async_method_caller.h" 58 #include "chromeos/cryptohome/async_method_caller.h"
59 #include "chromeos/dbus/dbus_thread_manager.h" 59 #include "chromeos/dbus/dbus_thread_manager.h"
60 #include "chromeos/login/login_state.h" 60 #include "chromeos/login/login_state.h"
61 #include "chromeos/settings/cros_settings_names.h" 61 #include "chromeos/settings/cros_settings_names.h"
62 #include "components/session_manager/core/session_manager.h"
62 #include "components/user_manager/user_type.h" 63 #include "components/user_manager/user_type.h"
63 #include "content/public/browser/browser_thread.h" 64 #include "content/public/browser/browser_thread.h"
64 #include "content/public/browser/notification_service.h" 65 #include "content/public/browser/notification_service.h"
65 #include "google_apis/gaia/gaia_auth_util.h" 66 #include "google_apis/gaia/gaia_auth_util.h"
66 #include "google_apis/gaia/google_service_auth_error.h" 67 #include "google_apis/gaia/google_service_auth_error.h"
67 #include "policy/policy_constants.h" 68 #include "policy/policy_constants.h"
68 #include "ui/base/l10n/l10n_util.h" 69 #include "ui/base/l10n/l10n_util.h"
69 #include "ui/wm/core/wm_core_switches.h" 70 #include "ui/wm/core/wm_core_switches.h"
70 71
71 using content::BrowserThread; 72 using content::BrowserThread;
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 495
495 void UserManagerImpl::RestoreActiveSessions() { 496 void UserManagerImpl::RestoreActiveSessions() {
496 DBusThreadManager::Get()->GetSessionManagerClient()->RetrieveActiveSessions( 497 DBusThreadManager::Get()->GetSessionManagerClient()->RetrieveActiveSessions(
497 base::Bind(&UserManagerImpl::OnRestoreActiveSessions, 498 base::Bind(&UserManagerImpl::OnRestoreActiveSessions,
498 base::Unretained(this))); 499 base::Unretained(this)));
499 } 500 }
500 501
501 void UserManagerImpl::SessionStarted() { 502 void UserManagerImpl::SessionStarted() {
502 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 503 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
503 session_started_ = true; 504 session_started_ = true;
505
504 UpdateLoginState(); 506 UpdateLoginState();
507 g_browser_process->platform_part()->session_manager()->SetSessionState(
508 session_manager::SessionManager::SESSION_STATE_ACTIVE);
509
505 content::NotificationService::current()->Notify( 510 content::NotificationService::current()->Notify(
506 chrome::NOTIFICATION_SESSION_STARTED, 511 chrome::NOTIFICATION_SESSION_STARTED,
507 content::Source<UserManager>(this), 512 content::Source<UserManager>(this),
508 content::Details<const User>(active_user_)); 513 content::Details<const User>(active_user_));
509 if (is_current_user_new_) { 514 if (is_current_user_new_) {
510 // Make sure that the new user's data is persisted to Local State. 515 // Make sure that the new user's data is persisted to Local State.
511 g_browser_process->local_state()->CommitPendingWrite(); 516 g_browser_process->local_state()->CommitPendingWrite();
512 } 517 }
513 } 518 }
514 519
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 } 1880 }
1876 1881
1877 void UserManagerImpl::DeleteUser(User* user) { 1882 void UserManagerImpl::DeleteUser(User* user) {
1878 const bool is_active_user = (user == active_user_); 1883 const bool is_active_user = (user == active_user_);
1879 delete user; 1884 delete user;
1880 if (is_active_user) 1885 if (is_active_user)
1881 active_user_ = NULL; 1886 active_user_ = NULL;
1882 } 1887 }
1883 1888
1884 } // namespace chromeos 1889 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698