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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/hash.h" | 10 #include "base/hash.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram_macros.h" |
13 #include "base/rand_util.h" | 13 #include "base/rand_util.h" |
14 #include "base/sequenced_task_runner.h" | 14 #include "base/sequenced_task_runner.h" |
15 #include "base/time/clock.h" | 15 #include "base/time/clock.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "base/values.h" | 17 #include "base/values.h" |
18 #include "components/invalidation/public/invalidation_service.h" | 18 #include "components/invalidation/public/invalidation_service.h" |
19 #include "components/invalidation/public/object_id_invalidation_map.h" | 19 #include "components/invalidation/public/object_id_invalidation_map.h" |
20 #include "components/policy/core/common/cloud/cloud_policy_client.h" | 20 #include "components/policy/core/common/cloud/cloud_policy_client.h" |
21 #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h" | 21 #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h" |
22 #include "components/policy/core/common/cloud/enterprise_metrics.h" | 22 #include "components/policy/core/common/cloud/enterprise_metrics.h" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 bool CloudPolicyInvalidator::GetInvalidationsEnabled() { | 439 bool CloudPolicyInvalidator::GetInvalidationsEnabled() { |
440 if (!invalidations_enabled_) | 440 if (!invalidations_enabled_) |
441 return false; | 441 return false; |
442 // If invalidations have been enabled for less than the grace period, then | 442 // If invalidations have been enabled for less than the grace period, then |
443 // consider invalidations to be disabled for metrics reporting. | 443 // consider invalidations to be disabled for metrics reporting. |
444 base::TimeDelta elapsed = clock_->Now() - invalidations_enabled_time_; | 444 base::TimeDelta elapsed = clock_->Now() - invalidations_enabled_time_; |
445 return elapsed.InSeconds() >= kInvalidationGracePeriod; | 445 return elapsed.InSeconds() >= kInvalidationGracePeriod; |
446 } | 446 } |
447 | 447 |
448 } // namespace policy | 448 } // namespace policy |
OLD | NEW |