| 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_POLICY_CLOUD_POLICY_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_CLIENT_H_ |
| 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_CLIENT_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 public_key_version_valid_ = true; | 124 public_key_version_valid_ = true; |
| 125 } | 125 } |
| 126 | 126 |
| 127 void clear_public_key_version() { | 127 void clear_public_key_version() { |
| 128 public_key_version_valid_ = false; | 128 public_key_version_valid_ = false; |
| 129 } | 129 } |
| 130 | 130 |
| 131 // Whether the client is registered with the device management service. | 131 // Whether the client is registered with the device management service. |
| 132 bool is_registered() const { return !dm_token_.empty(); } | 132 bool is_registered() const { return !dm_token_.empty(); } |
| 133 | 133 |
| 134 const std::string& dm_token() const { return dm_token_; } |
| 135 |
| 136 // The device mode as received in the registration request. |
| 137 DeviceMode device_mode() const { return device_mode_; } |
| 138 |
| 134 // The policy response as obtained by the last request to the cloud. This | 139 // The policy response as obtained by the last request to the cloud. This |
| 135 // policy blob hasn't gone through verification, so its contents cannot be | 140 // policy blob hasn't gone through verification, so its contents cannot be |
| 136 // trusted. Use CloudPolicyStore::policy() and CloudPolicyStore::policy_map() | 141 // trusted. Use CloudPolicyStore::policy() and CloudPolicyStore::policy_map() |
| 137 // instead for making policy decisions. | 142 // instead for making policy decisions. |
| 138 const enterprise_management::PolicyFetchResponse* policy() const { | 143 const enterprise_management::PolicyFetchResponse* policy() const { |
| 139 return policy_.get(); | 144 return policy_.get(); |
| 140 } | 145 } |
| 141 | 146 |
| 142 DeviceManagementStatus status() const { | 147 DeviceManagementStatus status() const { |
| 143 return status_; | 148 return status_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 171 void NotifyRegistrationStateChanged(); | 176 void NotifyRegistrationStateChanged(); |
| 172 void NotifyClientError(); | 177 void NotifyClientError(); |
| 173 | 178 |
| 174 // Data necessary for constructing policy requests. | 179 // Data necessary for constructing policy requests. |
| 175 const std::string machine_id_; | 180 const std::string machine_id_; |
| 176 const std::string machine_model_; | 181 const std::string machine_model_; |
| 177 const UserAffiliation user_affiliation_; | 182 const UserAffiliation user_affiliation_; |
| 178 const PolicyScope scope_; | 183 const PolicyScope scope_; |
| 179 | 184 |
| 180 std::string dm_token_; | 185 std::string dm_token_; |
| 186 DeviceMode device_mode_; |
| 181 std::string client_id_; | 187 std::string client_id_; |
| 182 bool submit_machine_id_; | 188 bool submit_machine_id_; |
| 183 base::Time last_policy_timestamp_; | 189 base::Time last_policy_timestamp_; |
| 184 int public_key_version_; | 190 int public_key_version_; |
| 185 bool public_key_version_valid_; | 191 bool public_key_version_valid_; |
| 186 | 192 |
| 187 // Used for issuing requests to the cloud. | 193 // Used for issuing requests to the cloud. |
| 188 DeviceManagementService* service_; | 194 DeviceManagementService* service_; |
| 189 scoped_ptr<DeviceManagementRequestJob> request_job_; | 195 scoped_ptr<DeviceManagementRequestJob> request_job_; |
| 190 | 196 |
| 191 // Status upload data is produced by |status_provider_|. | 197 // Status upload data is produced by |status_provider_|. |
| 192 StatusProvider* status_provider_; | 198 StatusProvider* status_provider_; |
| 193 | 199 |
| 194 // The policy blob returned by the last policy fetch operation. | 200 // The policy blob returned by the last policy fetch operation. |
| 195 scoped_ptr<enterprise_management::PolicyFetchResponse> policy_; | 201 scoped_ptr<enterprise_management::PolicyFetchResponse> policy_; |
| 196 DeviceManagementStatus status_; | 202 DeviceManagementStatus status_; |
| 197 | 203 |
| 198 ObserverList<Observer, true> observers_; | 204 ObserverList<Observer, true> observers_; |
| 199 | 205 |
| 200 private: | 206 private: |
| 201 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); | 207 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); |
| 202 }; | 208 }; |
| 203 | 209 |
| 204 } // namespace policy | 210 } // namespace policy |
| 205 | 211 |
| 206 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CLIENT_H_ | 212 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CLIENT_H_ |
| OLD | NEW |