OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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> |
11 | 11 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // |public_key_|. When the attempt is completed, an appropriate KeyOpCode | 69 // |public_key_|. When the attempt is completed, an appropriate KeyOpCode |
70 // will be passed to d->OnKeyOpComplete(). | 70 // will be passed to d->OnKeyOpComplete(). |
71 // | 71 // |
72 // If you call this on a well-known thread, you'll be called back on that | 72 // If you call this on a well-known thread, you'll be called back on that |
73 // thread. Otherwise, you'll get called back on the UI thread. | 73 // thread. Otherwise, you'll get called back on the UI thread. |
74 virtual void StartVerifyAttempt(const std::string& data, | 74 virtual void StartVerifyAttempt(const std::string& data, |
75 const std::vector<uint8>& signature, | 75 const std::vector<uint8>& signature, |
76 OwnerManager::Delegate* d); | 76 OwnerManager::Delegate* d); |
77 | 77 |
78 // This method must be run on the FILE thread. | 78 // This method must be run on the FILE thread. |
79 virtual bool CurrentUserIsOwner(); | 79 virtual bool IsCurrentUserOwner(); |
80 | 80 |
81 // This method should be run on FILE thread. | 81 // This method should be run on FILE thread. |
82 // Note: not static, for better mocking. | 82 // Note: not static, for better mocking. |
83 virtual bool IsAlreadyOwned(); | 83 virtual bool IsAlreadyOwned(); |
84 | 84 |
85 // This method can be run either on FILE or UI threads. If |blocking| flag | 85 // This method can be run either on FILE or UI threads. If |blocking| flag |
86 // is specified then it is guaranteed to return either OWNERSHIP_NONE or | 86 // is specified then it is guaranteed to return either OWNERSHIP_NONE or |
87 // OWNERSHIP_TAKEN (and not OWNERSHIP_UNKNOWN), however in this case it may | 87 // OWNERSHIP_TAKEN (and not OWNERSHIP_UNKNOWN), however in this case it may |
88 // occasionally block doing i/o. | 88 // occasionally block doing i/o. |
89 virtual Status GetStatus(bool blocking); | 89 virtual Status GetStatus(bool blocking); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 volatile Status ownership_status_; | 130 volatile Status ownership_status_; |
131 base::Lock ownership_status_lock_; | 131 base::Lock ownership_status_lock_; |
132 | 132 |
133 // If true, current user is regarded as owner (for testing only). | 133 // If true, current user is regarded as owner (for testing only). |
134 bool force_ownership_; | 134 bool force_ownership_; |
135 }; | 135 }; |
136 | 136 |
137 } // namespace chromeos | 137 } // namespace chromeos |
138 | 138 |
139 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OWNERSHIP_SERVICE_H_ | 139 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OWNERSHIP_SERVICE_H_ |
OLD | NEW |