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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_OWNERSHIP_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_OWNERSHIP_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_OWNERSHIP_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_OWNERSHIP_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // This method can be run either on FILE or UI threads. If |blocking| flag | 96 // This method can be run either on FILE or UI threads. If |blocking| flag |
97 // is specified then it is guaranteed to return either OWNERSHIP_NONE or | 97 // is specified then it is guaranteed to return either OWNERSHIP_NONE or |
98 // OWNERSHIP_TAKEN (and not OWNERSHIP_UNKNOWN), however in this case it may | 98 // OWNERSHIP_TAKEN (and not OWNERSHIP_UNKNOWN), however in this case it may |
99 // occasionally block doing i/o. | 99 // occasionally block doing i/o. |
100 virtual Status GetStatus(bool blocking); | 100 virtual Status GetStatus(bool blocking); |
101 | 101 |
102 protected: | 102 protected: |
103 OwnershipService(); | 103 OwnershipService(); |
104 | 104 |
105 // NotificationObserver implementation. | 105 // NotificationObserver implementation. |
106 virtual void Observe(NotificationType type, | 106 virtual void Observe(int type, |
107 const NotificationSource& source, | 107 const NotificationSource& source, |
108 const NotificationDetails& details); | 108 const NotificationDetails& details); |
109 | 109 |
110 private: | 110 private: |
111 friend struct base::DefaultLazyInstanceTraits<OwnershipService>; | 111 friend struct base::DefaultLazyInstanceTraits<OwnershipService>; |
112 friend class OwnershipServiceTest; | 112 friend class OwnershipServiceTest; |
113 | 113 |
114 // Task posted on FILE thread on startup to prefetch ownership status. | 114 // Task posted on FILE thread on startup to prefetch ownership status. |
115 void FetchStatus(); | 115 void FetchStatus(); |
116 | 116 |
(...skipping 22 matching lines...) Expand all Loading... |
139 scoped_refptr<OwnerKeyUtils> utils_; | 139 scoped_refptr<OwnerKeyUtils> utils_; |
140 scoped_ptr<em::PolicyData> policy_; | 140 scoped_ptr<em::PolicyData> policy_; |
141 NotificationRegistrar notification_registrar_; | 141 NotificationRegistrar notification_registrar_; |
142 volatile Status ownership_status_; | 142 volatile Status ownership_status_; |
143 base::Lock ownership_status_lock_; | 143 base::Lock ownership_status_lock_; |
144 }; | 144 }; |
145 | 145 |
146 } // namespace chromeos | 146 } // namespace chromeos |
147 | 147 |
148 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OWNERSHIP_SERVICE_H_ | 148 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OWNERSHIP_SERVICE_H_ |
OLD | NEW |