OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/metrics/daily_event.h" | 5 #include "components/metrics/daily_event.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "components/prefs/pref_registry_simple.h" | 10 #include "components/prefs/pref_registry_simple.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 OnInterval(now); | 89 OnInterval(now); |
90 } | 90 } |
91 } | 91 } |
92 | 92 |
93 void DailyEvent::OnInterval(base::Time now) { | 93 void DailyEvent::OnInterval(base::Time now) { |
94 DCHECK(!now.is_null()); | 94 DCHECK(!now.is_null()); |
95 last_fired_ = now; | 95 last_fired_ = now; |
96 pref_service_->SetInt64(pref_name_, last_fired_.ToInternalValue()); | 96 pref_service_->SetInt64(pref_name_, last_fired_.ToInternalValue()); |
97 | 97 |
98 // Notify all observers | 98 // Notify all observers |
99 for (ScopedVector<DailyEvent::Observer>::iterator it = observers_.begin(); | 99 for (auto it = observers_.begin(); it != observers_.end(); ++it) { |
100 it != observers_.end(); | |
101 ++it) { | |
102 (*it)->OnDailyEvent(); | 100 (*it)->OnDailyEvent(); |
103 } | 101 } |
104 } | 102 } |
105 | 103 |
106 } // namespace metrics | 104 } // namespace metrics |
OLD | NEW |