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

Side by Side Diff: chrome/browser/chromeos/ownership/owner_settings_service_factory.cc

Issue 375413002: Replace chromeos::UserManager::Get() with chromeos::GetUserManager(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test 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/ownership/owner_settings_service_factory.h" 5 #include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h"
6 6
7 #include "chrome/browser/chromeos/login/users/user.h" 7 #include "chrome/browser/chromeos/login/users/user.h"
8 #include "chrome/browser/chromeos/login/users/user_manager.h" 8 #include "chrome/browser/chromeos/login/users/user_manager.h"
9 #include "chrome/browser/chromeos/ownership/owner_settings_service.h" 9 #include "chrome/browser/chromeos/ownership/owner_settings_service.h"
10 #include "chrome/browser/chromeos/profiles/profile_helper.h" 10 #include "chrome/browser/chromeos/profiles/profile_helper.h"
(...skipping 20 matching lines...) Expand all
31 31
32 // static 32 // static
33 OwnerSettingsServiceFactory* OwnerSettingsServiceFactory::GetInstance() { 33 OwnerSettingsServiceFactory* OwnerSettingsServiceFactory::GetInstance() {
34 return Singleton<OwnerSettingsServiceFactory>::get(); 34 return Singleton<OwnerSettingsServiceFactory>::get();
35 } 35 }
36 36
37 void OwnerSettingsServiceFactory::SetUsername(const std::string& username) { 37 void OwnerSettingsServiceFactory::SetUsername(const std::string& username) {
38 username_ = username; 38 username_ = username;
39 if (!UserManager::IsInitialized()) 39 if (!UserManager::IsInitialized())
40 return; 40 return;
41 const User* user = UserManager::Get()->FindUser(username_); 41 const User* user = GetUserManager()->FindUser(username_);
42 if (!user || !user->is_profile_created()) 42 if (!user || !user->is_profile_created())
43 return; 43 return;
44 Profile* profile = ProfileHelper::Get()->GetProfileByUser(user); 44 Profile* profile = ProfileHelper::Get()->GetProfileByUser(user);
45 if (!profile) 45 if (!profile)
46 return; 46 return;
47 OwnerSettingsService* service = GetForProfile(profile); 47 OwnerSettingsService* service = GetForProfile(profile);
48 48
49 // It's safe to call ReloadPrivateKey() here, as profile is fully created 49 // It's safe to call ReloadPrivateKey() here, as profile is fully created
50 // at this time. 50 // at this time.
51 if (service) 51 if (service)
(...skipping 16 matching lines...) Expand all
68 bool OwnerSettingsServiceFactory::ServiceIsCreatedWithBrowserContext() const { 68 bool OwnerSettingsServiceFactory::ServiceIsCreatedWithBrowserContext() const {
69 return true; 69 return true;
70 } 70 }
71 71
72 KeyedService* OwnerSettingsServiceFactory::BuildServiceInstanceFor( 72 KeyedService* OwnerSettingsServiceFactory::BuildServiceInstanceFor(
73 content::BrowserContext* context) const { 73 content::BrowserContext* context) const {
74 return BuildInstanceFor(context); 74 return BuildInstanceFor(context);
75 } 75 }
76 76
77 } // namespace chromeos 77 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/net/onc_utils.cc ('k') | chrome/browser/chromeos/policy/device_local_account_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698