OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
17 | 17 |
18 using content::BrowserThread; | 18 using content::BrowserThread; |
19 | 19 |
20 namespace chromeos { | 20 namespace chromeos { |
21 | 21 |
22 static base::LazyInstance<OwnershipService> g_ownership_service( | 22 static base::LazyInstance<OwnershipService> g_ownership_service = |
23 base::LINKER_INITIALIZED); | 23 LAZY_INSTANCE_INITIALIZER; |
24 | 24 |
25 // static | 25 // static |
26 OwnershipService* OwnershipService::GetSharedInstance() { | 26 OwnershipService* OwnershipService::GetSharedInstance() { |
27 return g_ownership_service.Pointer(); | 27 return g_ownership_service.Pointer(); |
28 } | 28 } |
29 | 29 |
30 OwnershipService::OwnershipService() | 30 OwnershipService::OwnershipService() |
31 : manager_(new OwnerManager), | 31 : manager_(new OwnerManager), |
32 utils_(OwnerKeyUtils::Create()), | 32 utils_(OwnerKeyUtils::Create()), |
33 policy_(NULL), | 33 policy_(NULL), |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 SetStatus(status); | 220 SetStatus(status); |
221 } | 221 } |
222 | 222 |
223 void OwnershipService::SetStatus(Status new_status) { | 223 void OwnershipService::SetStatus(Status new_status) { |
224 DCHECK(new_status == OWNERSHIP_TAKEN || new_status == OWNERSHIP_NONE); | 224 DCHECK(new_status == OWNERSHIP_TAKEN || new_status == OWNERSHIP_NONE); |
225 base::AutoLock lk(ownership_status_lock_); | 225 base::AutoLock lk(ownership_status_lock_); |
226 ownership_status_ = new_status; | 226 ownership_status_ = new_status; |
227 } | 227 } |
228 | 228 |
229 } // namespace chromeos | 229 } // namespace chromeos |
OLD | NEW |