| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/remote/remote_suggestions_scheduler_impl.h" | 5 #include "components/ntp_snippets/remote/remote_suggestions_scheduler_impl.h" |
| 6 | 6 |
| 7 #include <random> | 7 #include <random> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 SOFT_WIFI, | 50 SOFT_WIFI, |
| 51 COUNT | 51 COUNT |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 // The following arrays specify default values for remote suggestions fetch | 54 // The following arrays specify default values for remote suggestions fetch |
| 55 // intervals corresponding to individual user classes. The user classes are | 55 // intervals corresponding to individual user classes. The user classes are |
| 56 // defined by the user classifier. There must be an array for each user class. | 56 // defined by the user classifier. There must be an array for each user class. |
| 57 // The values of each array specify a default time interval for the intervals | 57 // The values of each array specify a default time interval for the intervals |
| 58 // defined by the enum FetchingInterval. The default time intervals defined in | 58 // defined by the enum FetchingInterval. The default time intervals defined in |
| 59 // the arrays can be overridden using different variation parameters. | 59 // the arrays can be overridden using different variation parameters. |
| 60 const double kDefaultFetchingIntervalHoursRareNtpUser[] = {48.0, 24.0, 12.0, | 60 const double kDefaultFetchingIntervalHoursRareNtpUser[] = {48.0, 24.0, 8.0, |
| 61 6.0}; | 61 4.0}; |
| 62 const double kDefaultFetchingIntervalHoursActiveNtpUser[] = {24.0, 6.0, 4.0, | 62 const double kDefaultFetchingIntervalHoursActiveNtpUser[] = {24.0, 8.0, 6.0, |
| 63 2.0}; | 63 3.0}; |
| 64 const double kDefaultFetchingIntervalHoursActiveSuggestionsConsumer[] = { | 64 const double kDefaultFetchingIntervalHoursActiveSuggestionsConsumer[] = { |
| 65 24.0, 6.0, 2.0, 1.0}; | 65 24.0, 6.0, 2.0, 1.0}; |
| 66 | 66 |
| 67 // Variation parameters than can be used to override the default fetching | 67 // Variation parameters than can be used to override the default fetching |
| 68 // intervals. | 68 // intervals. |
| 69 const char* kFetchingIntervalParamNameRareNtpUser[] = { | 69 const char* kFetchingIntervalParamNameRareNtpUser[] = { |
| 70 "fetching_interval_hours-fallback-rare_ntp_user", | 70 "fetching_interval_hours-fallback-rare_ntp_user", |
| 71 "fetching_interval_hours-wifi-rare_ntp_user", | 71 "fetching_interval_hours-wifi-rare_ntp_user", |
| 72 "soft_fetching_interval_hours-fallback-rare_ntp_user", | 72 "soft_fetching_interval_hours-fallback-rare_ntp_user", |
| 73 "soft_fetching_interval_hours-wifi-rare_ntp_user"}; | 73 "soft_fetching_interval_hours-wifi-rare_ntp_user"}; |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 | 570 |
| 571 // Add the enabled type represented by |token| into the result set. | 571 // Add the enabled type represented by |token| into the result set. |
| 572 enabled_types.insert( | 572 enabled_types.insert( |
| 573 static_cast<TriggerType>(it - std::begin(kTriggerTypeNames))); | 573 static_cast<TriggerType>(it - std::begin(kTriggerTypeNames))); |
| 574 } | 574 } |
| 575 return enabled_types; | 575 return enabled_types; |
| 576 } | 576 } |
| 577 | 577 |
| 578 std::set<RemoteSuggestionsSchedulerImpl::TriggerType> | 578 std::set<RemoteSuggestionsSchedulerImpl::TriggerType> |
| 579 RemoteSuggestionsSchedulerImpl::GetDefaultEnabledTriggerTypes() { | 579 RemoteSuggestionsSchedulerImpl::GetDefaultEnabledTriggerTypes() { |
| 580 return {TriggerType::PERSISTENT_SCHEDULER_WAKE_UP, TriggerType::NTP_OPENED, | 580 return {TriggerType::PERSISTENT_SCHEDULER_WAKE_UP, TriggerType::NTP_OPENED}; |
| 581 TriggerType::BROWSER_FOREGROUNDED}; | |
| 582 } | 581 } |
| 583 | 582 |
| 584 } // namespace ntp_snippets | 583 } // namespace ntp_snippets |
| OLD | NEW |