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

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

Issue 7810025: Pass user_affiliation request parameter on user cloud policy requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Mac build breakage. Created 9 years, 3 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) 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 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 base::TimeDelta timestamp = 250 base::TimeDelta timestamp =
251 cache_->last_policy_refresh_time() - base::Time::UnixEpoch(); 251 cache_->last_policy_refresh_time() - base::Time::UnixEpoch();
252 fetch_request->set_timestamp(timestamp.InMilliseconds()); 252 fetch_request->set_timestamp(timestamp.InMilliseconds());
253 } 253 }
254 int key_version = 0; 254 int key_version = 0;
255 if (cache_->GetPublicKeyVersion(&key_version)) 255 if (cache_->GetPublicKeyVersion(&key_version))
256 fetch_request->set_public_key_version(key_version); 256 fetch_request->set_public_key_version(key_version);
257 257
258 backend_->ProcessPolicyRequest(data_store_->device_token(), 258 backend_->ProcessPolicyRequest(data_store_->device_token(),
259 data_store_->device_id(), 259 data_store_->device_id(),
260 data_store_->user_affiliation(),
260 policy_request, this); 261 policy_request, this);
261 } 262 }
262 263
263 void CloudPolicyController::DoWork() { 264 void CloudPolicyController::DoWork() {
264 switch (state_) { 265 switch (state_) {
265 case STATE_TOKEN_UNAVAILABLE: 266 case STATE_TOKEN_UNAVAILABLE:
266 case STATE_TOKEN_ERROR: 267 case STATE_TOKEN_ERROR:
267 FetchToken(); 268 FetchToken();
268 return; 269 return;
269 case STATE_TOKEN_VALID: 270 case STATE_TOKEN_VALID:
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 360 }
360 361
361 int64 CloudPolicyController::GetRefreshDelay() { 362 int64 CloudPolicyController::GetRefreshDelay() {
362 int64 deviation = (kPolicyRefreshDeviationFactorPercent * 363 int64 deviation = (kPolicyRefreshDeviationFactorPercent *
363 policy_refresh_rate_ms_) / 100; 364 policy_refresh_rate_ms_) / 100;
364 deviation = std::min(deviation, kPolicyRefreshDeviationMaxInMilliseconds); 365 deviation = std::min(deviation, kPolicyRefreshDeviationMaxInMilliseconds);
365 return policy_refresh_rate_ms_ - base::RandGenerator(deviation + 1); 366 return policy_refresh_rate_ms_ - base::RandGenerator(deviation + 1);
366 } 367 }
367 368
368 } // namespace policy 369 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/browser_policy_connector.cc ('k') | chrome/browser/policy/cloud_policy_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698