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

Side by Side Diff: chrome/browser/policy/cloud_policy_controller.cc

Issue 8920003: Add OS and firmware version to device status reports. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wrap #includes for ChromeOS. Created 9 years 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
« no previous file with comments | « no previous file | chrome/browser/policy/cloud_policy_data_store.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/policy/cloud_policy_controller.h" 5 #include "chrome/browser/policy/cloud_policy_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 if (!cache_->is_unmanaged() && 268 if (!cache_->is_unmanaged() &&
269 !cache_->last_policy_refresh_time().is_null()) { 269 !cache_->last_policy_refresh_time().is_null()) {
270 base::TimeDelta timestamp = 270 base::TimeDelta timestamp =
271 cache_->last_policy_refresh_time() - base::Time::UnixEpoch(); 271 cache_->last_policy_refresh_time() - base::Time::UnixEpoch();
272 fetch_request->set_timestamp(timestamp.InMilliseconds()); 272 fetch_request->set_timestamp(timestamp.InMilliseconds());
273 } 273 }
274 int key_version = 0; 274 int key_version = 0;
275 if (cache_->GetPublicKeyVersion(&key_version)) 275 if (cache_->GetPublicKeyVersion(&key_version))
276 fetch_request->set_public_key_version(key_version); 276 fetch_request->set_public_key_version(key_version);
277 277
278 #if defined(OS_CHROMEOS)
278 if (data_store_->device_status_collector()) 279 if (data_store_->device_status_collector())
279 data_store_->device_status_collector()->GetStatus(&device_status); 280 data_store_->device_status_collector()->GetStatus(&device_status);
281 #endif
280 282
281 backend_->ProcessPolicyRequest(data_store_->device_token(), 283 backend_->ProcessPolicyRequest(data_store_->device_token(),
282 data_store_->device_id(), 284 data_store_->device_id(),
283 data_store_->user_affiliation(), 285 data_store_->user_affiliation(),
284 policy_request, &device_status, this); 286 policy_request, &device_status, this);
285 } 287 }
286 288
287 void CloudPolicyController::DoWork() { 289 void CloudPolicyController::DoWork() {
288 switch (state_) { 290 switch (state_) {
289 case STATE_TOKEN_UNAVAILABLE: 291 case STATE_TOKEN_UNAVAILABLE:
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } 390 }
389 391
390 int64 CloudPolicyController::GetRefreshDelay() { 392 int64 CloudPolicyController::GetRefreshDelay() {
391 int64 deviation = (kPolicyRefreshDeviationFactorPercent * 393 int64 deviation = (kPolicyRefreshDeviationFactorPercent *
392 policy_refresh_rate_ms_) / 100; 394 policy_refresh_rate_ms_) / 100;
393 deviation = std::min(deviation, kPolicyRefreshDeviationMaxInMilliseconds); 395 deviation = std::min(deviation, kPolicyRefreshDeviationMaxInMilliseconds);
394 return policy_refresh_rate_ms_ - base::RandGenerator(deviation + 1); 396 return policy_refresh_rate_ms_ - base::RandGenerator(deviation + 1);
395 } 397 }
396 398
397 } // namespace policy 399 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/cloud_policy_data_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698