| 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 { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // The amount of time a host remains blacklisted due to opt outs. | 33 // The amount of time a host remains blacklisted due to opt outs. |
| 34 base::TimeDelta PerHostBlackListDuration(); | 34 base::TimeDelta PerHostBlackListDuration(); |
| 35 | 35 |
| 36 // The amount of time all previews navigations are disallowed due to opt outs. | 36 // The amount of time all previews navigations are disallowed due to opt outs. |
| 37 base::TimeDelta HostIndifferentBlackListPerHostDuration(); | 37 base::TimeDelta HostIndifferentBlackListPerHostDuration(); |
| 38 | 38 |
| 39 // The amount of time after any opt out that no previews should be shown. | 39 // The amount of time after any opt out that no previews should be shown. |
| 40 base::TimeDelta SingleOptOutDuration(); | 40 base::TimeDelta SingleOptOutDuration(); |
| 41 | 41 |
| 42 // The amount of time that an offline page is considered fresh enough to be |
| 43 // shown as a preview. |
| 44 base::TimeDelta OfflinePreviewFreshnessDuration(); |
| 45 |
| 42 } // namespace params | 46 } // namespace params |
| 43 | 47 |
| 44 enum class PreviewsType { | 48 enum class PreviewsType { |
| 45 NONE = 0, | 49 NONE = 0, |
| 46 OFFLINE = 1, | 50 OFFLINE = 1, |
| 47 LAST = 2, | 51 LAST = 2, |
| 48 }; | 52 }; |
| 49 | 53 |
| 50 // Returns true if any client-side previews experiment is active. | 54 // Returns true if any client-side previews experiment is active. |
| 51 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); | 55 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); |
| 52 | 56 |
| 53 // Returns true if the field trial that should enable previews for |type| for | 57 // Returns true if the field trial that should enable previews for |type| for |
| 54 // prohibitvely slow networks is active. | 58 // prohibitvely slow networks is active. |
| 55 bool IsPreviewsTypeEnabled(PreviewsType type); | 59 bool IsPreviewsTypeEnabled(PreviewsType type); |
| 56 | 60 |
| 57 // Sets the appropriate state for field trial and variations to imitate the | 61 // Sets the appropriate state for field trial and variations to imitate the |
| 58 // offline pages field trial. | 62 // offline pages field trial. |
| 59 bool EnableOfflinePreviewsForTesting(); | 63 bool EnableOfflinePreviewsForTesting(); |
| 60 | 64 |
| 61 } // namespace previews | 65 } // namespace previews |
| 62 | 66 |
| 63 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ | 67 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ |
| OLD | NEW |