| 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_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 public content::NotificationObserver, | 40 public content::NotificationObserver, |
| 41 public SessionManagerClient::Observer { | 41 public SessionManagerClient::Observer { |
| 42 public: | 42 public: |
| 43 virtual ~OwnerSettingsServiceChromeOS(); | 43 virtual ~OwnerSettingsServiceChromeOS(); |
| 44 | 44 |
| 45 void OnTPMTokenReady(bool tpm_token_enabled); | 45 void OnTPMTokenReady(bool tpm_token_enabled); |
| 46 | 46 |
| 47 // ownership::OwnerSettingsService implementation: | 47 // ownership::OwnerSettingsService implementation: |
| 48 virtual void SignAndStorePolicyAsync( | 48 virtual void SignAndStorePolicyAsync( |
| 49 scoped_ptr<enterprise_management::PolicyData> policy, | 49 scoped_ptr<enterprise_management::PolicyData> policy, |
| 50 const base::Closure& callback) OVERRIDE; | 50 const base::Closure& callback) override; |
| 51 | 51 |
| 52 // NotificationObserver implementation: | 52 // NotificationObserver implementation: |
| 53 virtual void Observe(int type, | 53 virtual void Observe(int type, |
| 54 const content::NotificationSource& source, | 54 const content::NotificationSource& source, |
| 55 const content::NotificationDetails& details) OVERRIDE; | 55 const content::NotificationDetails& details) override; |
| 56 | 56 |
| 57 // SessionManagerClient::Observer: | 57 // SessionManagerClient::Observer: |
| 58 virtual void OwnerKeySet(bool success) OVERRIDE; | 58 virtual void OwnerKeySet(bool success) override; |
| 59 | 59 |
| 60 // Checks if the user is the device owner, without the user profile having to | 60 // Checks if the user is the device owner, without the user profile having to |
| 61 // been initialized. Should be used only if login state is in safe mode. | 61 // been initialized. Should be used only if login state is in safe mode. |
| 62 static void IsOwnerForSafeModeAsync( | 62 static void IsOwnerForSafeModeAsync( |
| 63 const std::string& user_hash, | 63 const std::string& user_hash, |
| 64 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util, | 64 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util, |
| 65 const IsOwnerCallback& callback); | 65 const IsOwnerCallback& callback); |
| 66 | 66 |
| 67 static void SetDeviceSettingsServiceForTesting( | 67 static void SetDeviceSettingsServiceForTesting( |
| 68 DeviceSettingsService* device_settings_service); | 68 DeviceSettingsService* device_settings_service); |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 friend class OwnerSettingsServiceChromeOSFactory; | 71 friend class OwnerSettingsServiceChromeOSFactory; |
| 72 | 72 |
| 73 OwnerSettingsServiceChromeOS( | 73 OwnerSettingsServiceChromeOS( |
| 74 Profile* profile, | 74 Profile* profile, |
| 75 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); | 75 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); |
| 76 | 76 |
| 77 // OwnerSettingsService protected interface overrides: | 77 // OwnerSettingsService protected interface overrides: |
| 78 | 78 |
| 79 // Reloads private key from profile's NSS slots, responds via |callback|. | 79 // Reloads private key from profile's NSS slots, responds via |callback|. |
| 80 virtual void ReloadKeypairImpl(const base::Callback< | 80 virtual void ReloadKeypairImpl(const base::Callback< |
| 81 void(const scoped_refptr<ownership::PublicKey>& public_key, | 81 void(const scoped_refptr<ownership::PublicKey>& public_key, |
| 82 const scoped_refptr<ownership::PrivateKey>& private_key)>& callback) | 82 const scoped_refptr<ownership::PrivateKey>& private_key)>& callback) |
| 83 OVERRIDE; | 83 override; |
| 84 | 84 |
| 85 // Possibly notifies DeviceSettingsService that owner's keypair is loaded. | 85 // Possibly notifies DeviceSettingsService that owner's keypair is loaded. |
| 86 virtual void OnPostKeypairLoadedActions() OVERRIDE; | 86 virtual void OnPostKeypairLoadedActions() override; |
| 87 | 87 |
| 88 // Performs next operation in the queue. | 88 // Performs next operation in the queue. |
| 89 void StartNextOperation(); | 89 void StartNextOperation(); |
| 90 | 90 |
| 91 // Called when sign-and-store operation completes it's work. | 91 // Called when sign-and-store operation completes it's work. |
| 92 void HandleCompletedOperation(const base::Closure& callback, | 92 void HandleCompletedOperation(const base::Closure& callback, |
| 93 SessionManagerOperation* operation, | 93 SessionManagerOperation* operation, |
| 94 DeviceSettingsService::Status status); | 94 DeviceSettingsService::Status status); |
| 95 | 95 |
| 96 // Profile this service instance belongs to. | 96 // Profile this service instance belongs to. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 112 content::NotificationRegistrar registrar_; | 112 content::NotificationRegistrar registrar_; |
| 113 | 113 |
| 114 base::WeakPtrFactory<OwnerSettingsServiceChromeOS> weak_factory_; | 114 base::WeakPtrFactory<OwnerSettingsServiceChromeOS> weak_factory_; |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceChromeOS); | 116 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceChromeOS); |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace chromeos | 119 } // namespace chromeos |
| 120 | 120 |
| 121 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_H_ | 121 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_H_ |
| OLD | NEW |