| 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 #ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ | 5 #ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ |
| 6 #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ | 6 #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 | 9 |
| 10 namespace previews { | 10 namespace previews { |
| 11 | 11 |
| 12 namespace params { | 12 namespace params { |
| 13 | 13 |
| 14 // The maximum number of recent previews navigations the black list looks at to | 14 // The maximum number of recent previews navigations the black list looks at to |
| 15 // determine if a host is blacklisted. | 15 // determine if a host is blacklisted. |
| 16 size_t MaxStoredHistoryLengthForBlackList(); | 16 size_t MaxStoredHistoryLengthForBlackList(); |
| 17 | 17 |
| 18 // The maximum number of hosts allowed in the in memory black list. | 18 // The maximum number of hosts allowed in the in memory black list. |
| 19 size_t MaxInMemoryHostsInBlackList(); | 19 size_t MaxInMemoryHostsInBlackList(); |
| 20 | 20 |
| 21 // The number of recent navigations that were opted out of that would trigger | 21 // The number of recent navigations that were opted out of that would trigger |
| 22 // the host to be blacklisted. | 22 // the host to be blacklisted. |
| 23 int BlackListOptOutThreshold(); | 23 int BlackListOptOutThreshold(); |
| 24 | 24 |
| 25 // The amount of time a host remains blacklisted due to opt outs. | 25 // The amount of time a host remains blacklisted due to opt outs. |
| 26 base::TimeDelta BlackListDuration(); | 26 base::TimeDelta BlackListDuration(); |
| 27 | 27 |
| 28 // The amount of time after any opt out that no previews should be shown. |
| 29 base::TimeDelta SingleOptOutDuration(); |
| 30 |
| 28 } // namespace params | 31 } // namespace params |
| 29 | 32 |
| 30 enum class PreviewsType { | 33 enum class PreviewsType { |
| 31 NONE = 0, | 34 NONE = 0, |
| 32 OFFLINE = 1, | 35 OFFLINE = 1, |
| 33 LAST = 2, | 36 LAST = 2, |
| 34 }; | 37 }; |
| 35 | 38 |
| 36 // Returns true if any client-side previews experiment is active. | 39 // Returns true if any client-side previews experiment is active. |
| 37 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); | 40 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); |
| 38 | 41 |
| 39 // Returns true if the field trial that should enable previews for |type| for | 42 // Returns true if the field trial that should enable previews for |type| for |
| 40 // prohibitvely slow networks is active. | 43 // prohibitvely slow networks is active. |
| 41 bool IsPreviewsTypeEnabled(PreviewsType type); | 44 bool IsPreviewsTypeEnabled(PreviewsType type); |
| 42 | 45 |
| 43 // Sets the appropriate state for field trial and variations to imitate the | 46 // Sets the appropriate state for field trial and variations to imitate the |
| 44 // offline pages field trial. | 47 // offline pages field trial. |
| 45 bool EnableOfflinePreviewsForTesting(); | 48 bool EnableOfflinePreviewsForTesting(); |
| 46 | 49 |
| 47 } // namespace previews | 50 } // namespace previews |
| 48 | 51 |
| 49 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ | 52 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ |
| OLD | NEW |