| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_invalidator.h" | 5 #include "chrome/browser/policy/cloud/cloud_policy_invalidator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/hash.h" | 9 #include "base/hash.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 list.rbegin(); | 103 list.rbegin(); |
| 104 ++it; | 104 ++it; |
| 105 for ( ; it != list.rend(); ++it) { | 105 for ( ; it != list.rend(); ++it) { |
| 106 it->Acknowledge(); | 106 it->Acknowledge(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 // Handle the highest version invalidation. | 109 // Handle the highest version invalidation. |
| 110 HandleInvalidation(list.back()); | 110 HandleInvalidation(list.back()); |
| 111 } | 111 } |
| 112 | 112 |
| 113 std::string CloudPolicyInvalidator::GetOwnerName() const { return "Cloud"; } |
| 114 |
| 113 void CloudPolicyInvalidator::OnCoreConnected(CloudPolicyCore* core) {} | 115 void CloudPolicyInvalidator::OnCoreConnected(CloudPolicyCore* core) {} |
| 114 | 116 |
| 115 void CloudPolicyInvalidator::OnRefreshSchedulerStarted(CloudPolicyCore* core) { | 117 void CloudPolicyInvalidator::OnRefreshSchedulerStarted(CloudPolicyCore* core) { |
| 116 DCHECK(state_ == STOPPED); | 118 DCHECK(state_ == STOPPED); |
| 117 DCHECK(thread_checker_.CalledOnValidThread()); | 119 DCHECK(thread_checker_.CalledOnValidThread()); |
| 118 state_ = STARTED; | 120 state_ = STARTED; |
| 119 OnStoreLoaded(core_->store()); | 121 OnStoreLoaded(core_->store()); |
| 120 core_->store()->AddObserver(this); | 122 core_->store()->AddObserver(this); |
| 121 } | 123 } |
| 122 | 124 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 if (invalidations_enabled_) | 360 if (invalidations_enabled_) |
| 359 return METRIC_POLICY_REFRESH_CHANGED; | 361 return METRIC_POLICY_REFRESH_CHANGED; |
| 360 return METRIC_POLICY_REFRESH_CHANGED_NO_INVALIDATIONS; | 362 return METRIC_POLICY_REFRESH_CHANGED_NO_INVALIDATIONS; |
| 361 } | 363 } |
| 362 if (invalid_) | 364 if (invalid_) |
| 363 return METRIC_POLICY_REFRESH_INVALIDATED_UNCHANGED; | 365 return METRIC_POLICY_REFRESH_INVALIDATED_UNCHANGED; |
| 364 return METRIC_POLICY_REFRESH_UNCHANGED; | 366 return METRIC_POLICY_REFRESH_UNCHANGED; |
| 365 } | 367 } |
| 366 | 368 |
| 367 } // namespace policy | 369 } // namespace policy |
| OLD | NEW |