Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: chrome/browser/policy/cloud_policy_client.h

Issue 10928036: Implement Chrome OS device enrollment on the new cloud policy stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments, rebased. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 // The device mode as received in the registration request.
135 DeviceMode device_mode() const { return device_mode_; }
136
134 // The policy response as obtained by the last request to the cloud. This 137 // 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 138 // policy blob hasn't gone through verification, so its contents cannot be
136 // trusted. Use CloudPolicyStore::policy() and CloudPolicyStore::policy_map() 139 // trusted. Use CloudPolicyStore::policy() and CloudPolicyStore::policy_map()
137 // instead for making policy decisions. 140 // instead for making policy decisions.
138 const enterprise_management::PolicyFetchResponse* policy() const { 141 const enterprise_management::PolicyFetchResponse* policy() const {
139 return policy_.get(); 142 return policy_.get();
140 } 143 }
141 144
142 DeviceManagementStatus status() const { 145 DeviceManagementStatus status() const {
143 return status_; 146 return status_;
(...skipping 27 matching lines...) Expand all
171 void NotifyRegistrationStateChanged(); 174 void NotifyRegistrationStateChanged();
172 void NotifyClientError(); 175 void NotifyClientError();
173 176
174 // Data necessary for constructing policy requests. 177 // Data necessary for constructing policy requests.
175 const std::string machine_id_; 178 const std::string machine_id_;
176 const std::string machine_model_; 179 const std::string machine_model_;
177 const UserAffiliation user_affiliation_; 180 const UserAffiliation user_affiliation_;
178 const PolicyScope scope_; 181 const PolicyScope scope_;
179 182
180 std::string dm_token_; 183 std::string dm_token_;
184 DeviceMode device_mode_;
181 std::string client_id_; 185 std::string client_id_;
182 bool submit_machine_id_; 186 bool submit_machine_id_;
183 base::Time last_policy_timestamp_; 187 base::Time last_policy_timestamp_;
184 int public_key_version_; 188 int public_key_version_;
185 bool public_key_version_valid_; 189 bool public_key_version_valid_;
186 190
187 // Used for issuing requests to the cloud. 191 // Used for issuing requests to the cloud.
188 DeviceManagementService* service_; 192 DeviceManagementService* service_;
189 scoped_ptr<DeviceManagementRequestJob> request_job_; 193 scoped_ptr<DeviceManagementRequestJob> request_job_;
190 194
191 // Status upload data is produced by |status_provider_|. 195 // Status upload data is produced by |status_provider_|.
192 StatusProvider* status_provider_; 196 StatusProvider* status_provider_;
193 197
194 // The policy blob returned by the last policy fetch operation. 198 // The policy blob returned by the last policy fetch operation.
195 scoped_ptr<enterprise_management::PolicyFetchResponse> policy_; 199 scoped_ptr<enterprise_management::PolicyFetchResponse> policy_;
196 DeviceManagementStatus status_; 200 DeviceManagementStatus status_;
197 201
198 ObserverList<Observer, true> observers_; 202 ObserverList<Observer, true> observers_;
199 203
200 private: 204 private:
201 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); 205 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient);
202 }; 206 };
203 207
204 } // namespace policy 208 } // namespace policy
205 209
206 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CLIENT_H_ 210 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698