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

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

Issue 10828345: Extract PrefServiceBase into chrome/browser/api. Use in api and autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head Created 8 years, 4 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
« no previous file with comments | « chrome/browser/plugin_prefs.h ('k') | chrome/browser/prefs/pref_service.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) 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 #include "chrome/browser/policy/cloud_policy_refresh_scheduler.h" 5 #include "chrome/browser/policy/cloud_policy_refresh_scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/task_runner.h" 9 #include "base/task_runner.h"
10 #include "chrome/browser/policy/cloud_policy_constants.h" 10 #include "chrome/browser/policy/cloud_policy_constants.h"
11 #include "chrome/browser/prefs/pref_service.h"
11 #include "chrome/common/chrome_notification_types.h" 12 #include "chrome/common/chrome_notification_types.h"
12 #include "content/public/browser/notification_details.h" 13 #include "content/public/browser/notification_details.h"
13 14
14 namespace policy { 15 namespace policy {
15 16
16 const int64 CloudPolicyRefreshScheduler::kUnmanagedRefreshDelayMs = 17 const int64 CloudPolicyRefreshScheduler::kUnmanagedRefreshDelayMs =
17 24 * 60 * 60 * 1000; // 1 day. 18 24 * 60 * 60 * 1000; // 1 day.
18 const int64 CloudPolicyRefreshScheduler::kInitialErrorRetryDelayMs = 19 const int64 CloudPolicyRefreshScheduler::kInitialErrorRetryDelayMs =
19 5 * 60 * 1000; // 5 minutes. 20 5 * 60 * 1000; // 5 minutes.
20 const int64 CloudPolicyRefreshScheduler::kRefreshDelayMinMs = 21 const int64 CloudPolicyRefreshScheduler::kRefreshDelayMinMs =
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 task_runner_->PostDelayedTask(FROM_HERE, refresh_callback_.callback(), delay); 197 task_runner_->PostDelayedTask(FROM_HERE, refresh_callback_.callback(), delay);
197 } 198 }
198 199
199 int64 CloudPolicyRefreshScheduler::GetRefreshDelay() { 200 int64 CloudPolicyRefreshScheduler::GetRefreshDelay() {
200 return std::min(std::max<int64>(refresh_delay_.GetValue(), 201 return std::min(std::max<int64>(refresh_delay_.GetValue(),
201 kRefreshDelayMinMs), 202 kRefreshDelayMinMs),
202 kRefreshDelayMaxMs); 203 kRefreshDelayMaxMs);
203 } 204 }
204 205
205 } // namespace policy 206 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/plugin_prefs.h ('k') | chrome/browser/prefs/pref_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698