OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ntp_snippets/ntp_snippets_service.h" | 5 #include "components/ntp_snippets/ntp_snippets_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 const char kFetchingIntervalWifiParamName[] = | 61 const char kFetchingIntervalWifiParamName[] = |
62 "fetching_interval_wifi_seconds"; | 62 "fetching_interval_wifi_seconds"; |
63 const char kFetchingIntervalFallbackParamName[] = | 63 const char kFetchingIntervalFallbackParamName[] = |
64 "fetching_interval_fallback_seconds"; | 64 "fetching_interval_fallback_seconds"; |
65 | 65 |
66 // These define the times of day during which we will fetch via Wifi (without | 66 // These define the times of day during which we will fetch via Wifi (without |
67 // charging) - 6 AM to 10 PM. | 67 // charging) - 6 AM to 10 PM. |
68 const int kWifiFetchingHourMin = 6; | 68 const int kWifiFetchingHourMin = 6; |
69 const int kWifiFetchingHourMax = 22; | 69 const int kWifiFetchingHourMax = 22; |
70 | 70 |
71 const int kDefaultExpiryTimeMins = 24 * 60; | 71 const int kDefaultExpiryTimeMins = 3 * 24 * 60; |
72 | 72 |
73 base::TimeDelta GetFetchingInterval(const char* switch_name, | 73 base::TimeDelta GetFetchingInterval(const char* switch_name, |
74 const char* param_name, | 74 const char* param_name, |
75 int default_value_seconds) { | 75 int default_value_seconds) { |
76 int value_seconds = default_value_seconds; | 76 int value_seconds = default_value_seconds; |
77 | 77 |
78 // The default value can be overridden by a variation parameter. | 78 // The default value can be overridden by a variation parameter. |
79 // TODO(treib,jkrcal): Use GetVariationParamValueByFeature and get rid of | 79 // TODO(treib,jkrcal): Use GetVariationParamValueByFeature and get rid of |
80 // kStudyName, also in NTPSnippetsFetcher. | 80 // kStudyName, also in NTPSnippetsFetcher. |
81 std::string param_value_str = variations::GetVariationParamValue( | 81 std::string param_value_str = variations::GetVariationParamValue( |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 } | 1047 } |
1048 | 1048 |
1049 NTPSnippetsService::CategoryContent::CategoryContent() = default; | 1049 NTPSnippetsService::CategoryContent::CategoryContent() = default; |
1050 NTPSnippetsService::CategoryContent::CategoryContent(CategoryContent&&) = | 1050 NTPSnippetsService::CategoryContent::CategoryContent(CategoryContent&&) = |
1051 default; | 1051 default; |
1052 NTPSnippetsService::CategoryContent::~CategoryContent() = default; | 1052 NTPSnippetsService::CategoryContent::~CategoryContent() = default; |
1053 NTPSnippetsService::CategoryContent& NTPSnippetsService::CategoryContent:: | 1053 NTPSnippetsService::CategoryContent& NTPSnippetsService::CategoryContent:: |
1054 operator=(CategoryContent&&) = default; | 1054 operator=(CategoryContent&&) = default; |
1055 | 1055 |
1056 } // namespace ntp_snippets | 1056 } // namespace ntp_snippets |
OLD | NEW |