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

Side by Side Diff: components/user_manager/user_manager.cc

Issue 2661283002: cros: Clean up SessionStateDelegate refs in Chrome (Closed)
Patch Set: update browser_finder_chromeos_unittest Created 3 years, 9 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
« no previous file with comments | « components/user_manager/user_manager.h ('k') | components/user_manager/user_manager_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/user_manager/user_manager.h" 5 #include "components/user_manager/user_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "components/signin/core/account_id/account_id.h" 8 #include "components/signin/core/account_id/account_id.h"
9 9
10 namespace user_manager { 10 namespace user_manager {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 return UserManager::instance; 85 return UserManager::instance;
86 } 86 }
87 87
88 // static 88 // static
89 UserManager* UserManager::SetForTesting(UserManager* user_manager) { 89 UserManager* UserManager::SetForTesting(UserManager* user_manager) {
90 UserManager* previous_instance = UserManager::instance; 90 UserManager* previous_instance = UserManager::instance;
91 UserManager::instance = user_manager; 91 UserManager::instance = user_manager;
92 return previous_instance; 92 return previous_instance;
93 } 93 }
94 94
95 ScopedUserSessionStateObserver::ScopedUserSessionStateObserver(
96 UserManager::UserSessionStateObserver* observer)
97 : observer_(observer) {
98 if (UserManager::IsInitialized())
99 UserManager::Get()->AddSessionStateObserver(observer_);
100 }
101
102 ScopedUserSessionStateObserver::~ScopedUserSessionStateObserver() {
103 if (UserManager::IsInitialized())
104 UserManager::Get()->RemoveSessionStateObserver(observer_);
105 }
106
95 } // namespace user_manager 107 } // namespace user_manager
OLDNEW
« no previous file with comments | « components/user_manager/user_manager.h ('k') | components/user_manager/user_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698