| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(const std::string& user_id, |
| 75 const std::string& user_hash, | 75 const std::string& user_hash, |
| 76 const IsOwnerCallback& callback); | 76 const IsOwnerCallback& callback); |
| 77 | 77 |
| 78 static scoped_refptr<ownership::OwnerKeyUtil> MakeOwnerKeyUtil(); | |
| 79 | |
| 80 static void SetOwnerKeyUtilForTesting( | |
| 81 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); | |
| 82 | |
| 83 static void SetDeviceSettingsServiceForTesting( | 78 static void SetDeviceSettingsServiceForTesting( |
| 84 DeviceSettingsService* device_settings_service); | 79 DeviceSettingsService* device_settings_service); |
| 85 | 80 |
| 86 private: | 81 private: |
| 87 friend class OwnerSettingsServiceFactory; | 82 friend class OwnerSettingsServiceFactory; |
| 88 | 83 |
| 89 explicit OwnerSettingsService(Profile* profile); | 84 OwnerSettingsService( |
| 85 Profile* profile, |
| 86 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); |
| 90 | 87 |
| 91 // Reloads private key from profile's NSS slots. Responds via call | 88 // Reloads private key from profile's NSS slots. Responds via call |
| 92 // to OnPrivateKeyLoaded(). | 89 // to OnPrivateKeyLoaded(). |
| 93 void ReloadPrivateKey(); | 90 void ReloadPrivateKey(); |
| 94 | 91 |
| 95 // Called when ReloadPrivateKey() completes it's work. | 92 // Called when ReloadPrivateKey() completes it's work. |
| 96 void OnPrivateKeyLoaded(scoped_refptr<ownership::PublicKey> public_key, | 93 void OnPrivateKeyLoaded(scoped_refptr<ownership::PublicKey> public_key, |
| 97 scoped_refptr<ownership::PrivateKey> private_key); | 94 scoped_refptr<ownership::PrivateKey> private_key); |
| 98 | 95 |
| 99 // Puts request to perform sign-and-store operation in the queue. | 96 // 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_; | 147 base::ThreadChecker thread_checker_; |
| 151 | 148 |
| 152 base::WeakPtrFactory<OwnerSettingsService> weak_factory_; | 149 base::WeakPtrFactory<OwnerSettingsService> weak_factory_; |
| 153 | 150 |
| 154 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsService); | 151 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsService); |
| 155 }; | 152 }; |
| 156 | 153 |
| 157 } // namespace chromeos | 154 } // namespace chromeos |
| 158 | 155 |
| 159 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ | 156 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ |
| OLD | NEW |