OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/metrics/variations/variations_request_scheduler.h" | 5 #include "chrome/browser/metrics/variations/variations_request_scheduler.h" |
6 | 6 |
7 namespace chrome_variations { | 7 namespace chrome_variations { |
8 | 8 |
9 VariationsRequestScheduler::VariationsRequestScheduler( | 9 VariationsRequestScheduler::VariationsRequestScheduler( |
10 const base::Closure& task) : task_(task) { | 10 const base::Closure& task) : task_(task) { |
(...skipping 18 matching lines...) Expand all Loading... |
29 void VariationsRequestScheduler::ScheduleFetchShortly() { | 29 void VariationsRequestScheduler::ScheduleFetchShortly() { |
30 // Reset the regular timer to avoid it triggering soon after. | 30 // Reset the regular timer to avoid it triggering soon after. |
31 Reset(); | 31 Reset(); |
32 // The delay before attempting a fetch shortly, in minutes. | 32 // The delay before attempting a fetch shortly, in minutes. |
33 const int kFetchShortlyDelayMinutes = 5; | 33 const int kFetchShortlyDelayMinutes = 5; |
34 one_shot_timer_.Start(FROM_HERE, | 34 one_shot_timer_.Start(FROM_HERE, |
35 base::TimeDelta::FromMinutes(kFetchShortlyDelayMinutes), | 35 base::TimeDelta::FromMinutes(kFetchShortlyDelayMinutes), |
36 task_); | 36 task_); |
37 } | 37 } |
38 | 38 |
| 39 void VariationsRequestScheduler::OnAppEnterForeground() { |
| 40 NOTREACHED() << "Attempted to OnAppEnterForeground on non-mobile device"; |
| 41 } |
| 42 |
39 base::Closure VariationsRequestScheduler::task() const { | 43 base::Closure VariationsRequestScheduler::task() const { |
40 return task_; | 44 return task_; |
41 } | 45 } |
42 | 46 |
43 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 47 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
44 // static | 48 // static |
45 VariationsRequestScheduler* VariationsRequestScheduler::Create( | 49 VariationsRequestScheduler* VariationsRequestScheduler::Create( |
46 const base::Closure& task, | 50 const base::Closure& task, |
47 PrefService* local_state) { | 51 PrefService* local_state) { |
48 return new VariationsRequestScheduler(task); | 52 return new VariationsRequestScheduler(task); |
49 } | 53 } |
50 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 54 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
51 | 55 |
52 } // namespace chrome_variations | 56 } // namespace chrome_variations |
OLD | NEW |