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

Side by Side Diff: chrome/browser/chromeos/login/ownership_service.cc

Issue 5734002: Continuation of CL 5685007, rename the singleton accessor method in more files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/ownership_service.h" 5 #include "chrome/browser/chromeos/login/ownership_service.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/lazy_instance.h"
9 #include "chrome/browser/browser_thread.h" 10 #include "chrome/browser/browser_thread.h"
10 11
11 namespace chromeos { 12 namespace chromeos {
12 13
14 static base::LazyInstance<OwnershipService> g_ownership_service(
15 base::LINKER_INITIALIZED);
16
13 // static 17 // static
14 OwnershipService* OwnershipService::GetSharedInstance() { 18 OwnershipService* OwnershipService::GetSharedInstance() {
15 return Singleton<OwnershipService>::get(); 19 return g_ownership_service.Pointer();
16 } 20 }
17 21
18 OwnershipService::OwnershipService() 22 OwnershipService::OwnershipService()
19 : manager_(new OwnerManager), 23 : manager_(new OwnerManager),
20 utils_(OwnerKeyUtils::Create()) { 24 utils_(OwnerKeyUtils::Create()) {
21 } 25 }
22 26
23 OwnershipService::~OwnershipService() {} 27 OwnershipService::~OwnershipService() {}
24 28
25 29
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 return; 95 return;
92 } 96 }
93 97
94 bool OwnershipService::CurrentUserIsOwner() { 98 bool OwnershipService::CurrentUserIsOwner() {
95 // If this user has the private key associated with the owner's 99 // If this user has the private key associated with the owner's
96 // public key, this user is the owner. 100 // public key, this user is the owner.
97 return IsAlreadyOwned() && manager_->EnsurePrivateKey(); 101 return IsAlreadyOwned() && manager_->EnsurePrivateKey();
98 } 102 }
99 103
100 } // namespace chromeos 104 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698