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

Side by Side Diff: chrome/browser/policy/cloud/cloud_policy_core.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 #include "chrome/browser/policy/cloud/cloud_policy_core.h" 5 #include "chrome/browser/policy/cloud/cloud_policy_core.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 28 matching lines...) Expand all
39 void CloudPolicyCore::RefreshSoon() { 39 void CloudPolicyCore::RefreshSoon() {
40 if (refresh_scheduler_) 40 if (refresh_scheduler_)
41 refresh_scheduler_->RefreshSoon(); 41 refresh_scheduler_->RefreshSoon();
42 } 42 }
43 43
44 void CloudPolicyCore::StartRefreshScheduler() { 44 void CloudPolicyCore::StartRefreshScheduler() {
45 if (!refresh_scheduler_) { 45 if (!refresh_scheduler_) {
46 refresh_scheduler_.reset( 46 refresh_scheduler_.reset(
47 new CloudPolicyRefreshScheduler( 47 new CloudPolicyRefreshScheduler(
48 client_.get(), store_, 48 client_.get(), store_,
49 MessageLoop::current()->message_loop_proxy())); 49 base::MessageLoop::current()->message_loop_proxy()));
50 UpdateRefreshDelayFromPref(); 50 UpdateRefreshDelayFromPref();
51 } 51 }
52 } 52 }
53 53
54 void CloudPolicyCore::TrackRefreshDelayPref( 54 void CloudPolicyCore::TrackRefreshDelayPref(
55 PrefService* pref_service, 55 PrefService* pref_service,
56 const std::string& refresh_pref_name) { 56 const std::string& refresh_pref_name) {
57 refresh_delay_.reset(new IntegerPrefMember()); 57 refresh_delay_.reset(new IntegerPrefMember());
58 refresh_delay_->Init( 58 refresh_delay_->Init(
59 refresh_pref_name.c_str(), pref_service, 59 refresh_pref_name.c_str(), pref_service,
60 base::Bind(&CloudPolicyCore::UpdateRefreshDelayFromPref, 60 base::Bind(&CloudPolicyCore::UpdateRefreshDelayFromPref,
61 base::Unretained(this))); 61 base::Unretained(this)));
62 UpdateRefreshDelayFromPref(); 62 UpdateRefreshDelayFromPref();
63 } 63 }
64 64
65 void CloudPolicyCore::UpdateRefreshDelayFromPref() { 65 void CloudPolicyCore::UpdateRefreshDelayFromPref() {
66 if (refresh_scheduler_ && refresh_delay_) 66 if (refresh_scheduler_ && refresh_delay_)
67 refresh_scheduler_->SetRefreshDelay(refresh_delay_->GetValue()); 67 refresh_scheduler_->SetRefreshDelay(refresh_delay_->GetValue());
68 } 68 }
69 69
70 } // namespace policy 70 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/browser_policy_connector.cc ('k') | chrome/browser/policy/cloud/cloud_policy_core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698