Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 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_SETTINGS_DEVICE_SETTINGS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 scoped_refptr<ownership::OwnerKeyUtil> owner_key_util); | 104 scoped_refptr<ownership::OwnerKeyUtil> owner_key_util); |
| 105 | 105 |
| 106 // Prevents the service from making further calls to session_manager_client | 106 // Prevents the service from making further calls to session_manager_client |
| 107 // and stops any pending operations. | 107 // and stops any pending operations. |
| 108 void UnsetSessionManager(); | 108 void UnsetSessionManager(); |
| 109 | 109 |
| 110 // Must only be used with a |device_mode| that has been read and verified by | 110 // Must only be used with a |device_mode| that has been read and verified by |
| 111 // the InstallAttributes class. | 111 // the InstallAttributes class. |
| 112 void SetDeviceMode(policy::DeviceMode device_mode); | 112 void SetDeviceMode(policy::DeviceMode device_mode); |
| 113 | 113 |
| 114 const enterprise_management::PolicyData* policy_data() { | 114 const enterprise_management::PolicyData* policy_data() const { |
| 115 return policy_data_.get(); | 115 return policy_data_.get(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 // Returns the currently active device settings. Returns nullptr if the device | 118 // Returns the currently active device settings. Returns nullptr if the device |
| 119 // settings have not been retrieved from session_manager yet. | 119 // settings have not been retrieved from session_manager yet. |
| 120 const enterprise_management::ChromeDeviceSettingsProto* | 120 const enterprise_management::ChromeDeviceSettingsProto* |
| 121 device_settings() const { | 121 device_settings() const { |
| 122 return device_settings_.get(); | 122 return device_settings_.get(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Returns the currently used owner key. | 125 // Returns the currently used owner key. |
| 126 scoped_refptr<ownership::PublicKey> GetPublicKey(); | 126 scoped_refptr<ownership::PublicKey> GetPublicKey(); |
| 127 | 127 |
| 128 // Returns the status generated by the last operation. | 128 // Returns the status generated by the *last operation*. |
|
emaxx
2017/06/01 20:13:31
nit: What about also renaming this method so that
Thiemo Nagel
2017/06/02 11:25:39
I might do that in a follow-up CL. Ideally, the o
| |
| 129 Status status() { return store_status_; } | 129 // WARNING: It is not correct to take this method as an indication of whether |
| 130 // DeviceSettingsService contains valid device settings. In order to answer | |
| 131 // that question, simply check whether device_settings() is different from | |
| 132 // nullptr. | |
| 133 Status status() const { return store_status_; } | |
| 130 | 134 |
| 131 // Triggers an attempt to pull the public half of the owner key from disk and | 135 // Triggers an attempt to pull the public half of the owner key from disk and |
| 132 // load the device settings. | 136 // load the device settings. |
| 133 void Load(); | 137 void Load(); |
| 134 | 138 |
| 135 // Synchronously pulls the public key and loads the device settings. | 139 // Synchronously pulls the public key and loads the device settings. |
| 136 void LoadImmediately(); | 140 void LoadImmediately(); |
| 137 | 141 |
| 138 // Stores a policy blob to session_manager. The result of the operation is | 142 // Stores a policy blob to session_manager. The result of the operation is |
| 139 // reported through |callback|. If successful, the updated device settings are | 143 // reported through |callback|. If successful, the updated device settings are |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 ScopedTestDeviceSettingsService(); | 275 ScopedTestDeviceSettingsService(); |
| 272 ~ScopedTestDeviceSettingsService(); | 276 ~ScopedTestDeviceSettingsService(); |
| 273 | 277 |
| 274 private: | 278 private: |
| 275 DISALLOW_COPY_AND_ASSIGN(ScopedTestDeviceSettingsService); | 279 DISALLOW_COPY_AND_ASSIGN(ScopedTestDeviceSettingsService); |
| 276 }; | 280 }; |
| 277 | 281 |
| 278 } // namespace chromeos | 282 } // namespace chromeos |
| 279 | 283 |
| 280 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_SERVICE_H_ | 284 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_SERVICE_H_ |
| OLD | NEW |