| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 const content::NotificationDetails& details) OVERRIDE; | 64 const content::NotificationDetails& details) OVERRIDE; |
| 65 | 65 |
| 66 // TPMTokenLoader::Observer: | 66 // TPMTokenLoader::Observer: |
| 67 virtual void OnTPMTokenReady() OVERRIDE; | 67 virtual void OnTPMTokenReady() OVERRIDE; |
| 68 | 68 |
| 69 // SessionManagerClient::Observer: | 69 // SessionManagerClient::Observer: |
| 70 virtual void OwnerKeySet(bool success) OVERRIDE; | 70 virtual void OwnerKeySet(bool success) OVERRIDE; |
| 71 | 71 |
| 72 // Checks if the user is the device owner, without the user profile having to | 72 // Checks if the user is the device owner, without the user profile having to |
| 73 // been initialized. Should be used only if login state is in safe mode. | 73 // been initialized. Should be used only if login state is in safe mode. |
| 74 static void IsOwnerForSafeModeAsync(const std::string& user_id, | 74 static void IsOwnerForSafeModeAsync( |
| 75 const std::string& user_hash, | 75 const std::string& user_id, |
| 76 const IsOwnerCallback& callback); | 76 const std::string& user_hash, |
| 77 | 77 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util, |
| 78 static scoped_refptr<ownership::OwnerKeyUtil> MakeOwnerKeyUtil(); | 78 const IsOwnerCallback& callback); |
| 79 | |
| 80 static void SetOwnerKeyUtilForTesting( | |
| 81 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); | |
| 82 | 79 |
| 83 static void SetDeviceSettingsServiceForTesting( | 80 static void SetDeviceSettingsServiceForTesting( |
| 84 DeviceSettingsService* device_settings_service); | 81 DeviceSettingsService* device_settings_service); |
| 85 | 82 |
| 86 private: | 83 private: |
| 87 friend class OwnerSettingsServiceFactory; | 84 friend class OwnerSettingsServiceFactory; |
| 88 | 85 |
| 89 explicit OwnerSettingsService(Profile* profile); | 86 OwnerSettingsService( |
| 87 Profile* profile, |
| 88 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); |
| 90 | 89 |
| 91 // Reloads private key from profile's NSS slots. Responds via call | 90 // Reloads private key from profile's NSS slots. Responds via call |
| 92 // to OnPrivateKeyLoaded(). | 91 // to OnPrivateKeyLoaded(). |
| 93 void ReloadPrivateKey(); | 92 void ReloadPrivateKey(); |
| 94 | 93 |
| 95 // Called when ReloadPrivateKey() completes it's work. | 94 // Called when ReloadPrivateKey() completes it's work. |
| 96 void OnPrivateKeyLoaded(scoped_refptr<ownership::PublicKey> public_key, | 95 void OnPrivateKeyLoaded(scoped_refptr<ownership::PublicKey> public_key, |
| 97 scoped_refptr<ownership::PrivateKey> private_key); | 96 scoped_refptr<ownership::PrivateKey> private_key); |
| 98 | 97 |
| 99 // Puts request to perform sign-and-store operation in the queue. | 98 // Puts request to perform sign-and-store operation in the queue. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 base::ThreadChecker thread_checker_; | 149 base::ThreadChecker thread_checker_; |
| 151 | 150 |
| 152 base::WeakPtrFactory<OwnerSettingsService> weak_factory_; | 151 base::WeakPtrFactory<OwnerSettingsService> weak_factory_; |
| 153 | 152 |
| 154 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsService); | 153 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsService); |
| 155 }; | 154 }; |
| 156 | 155 |
| 157 } // namespace chromeos | 156 } // namespace chromeos |
| 158 | 157 |
| 159 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ | 158 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ |
| OLD | NEW |