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 #include "net/nqe/effective_connection_type.h" |
9 | 10 |
10 namespace previews { | 11 namespace previews { |
11 | 12 |
12 namespace params { | 13 namespace params { |
13 | 14 |
14 // The maximum number of recent previews navigations the black list looks at to | 15 // The maximum number of recent previews navigations the black list looks at to |
15 // determine if a host is blacklisted. | 16 // determine if a host is blacklisted. |
16 size_t MaxStoredHistoryLengthForPerHostBlackList(); | 17 size_t MaxStoredHistoryLengthForPerHostBlackList(); |
17 | 18 |
18 // The maximum number of recent previews navigations the black list looks at to | 19 // The maximum number of recent previews navigations the black list looks at to |
(...skipping 17 matching lines...) Expand all Loading... |
36 // The amount of time all previews navigations are disallowed due to opt outs. | 37 // The amount of time all previews navigations are disallowed due to opt outs. |
37 base::TimeDelta HostIndifferentBlackListPerHostDuration(); | 38 base::TimeDelta HostIndifferentBlackListPerHostDuration(); |
38 | 39 |
39 // The amount of time after any opt out that no previews should be shown. | 40 // The amount of time after any opt out that no previews should be shown. |
40 base::TimeDelta SingleOptOutDuration(); | 41 base::TimeDelta SingleOptOutDuration(); |
41 | 42 |
42 // The amount of time that an offline page is considered fresh enough to be | 43 // The amount of time that an offline page is considered fresh enough to be |
43 // shown as a preview. | 44 // shown as a preview. |
44 base::TimeDelta OfflinePreviewFreshnessDuration(); | 45 base::TimeDelta OfflinePreviewFreshnessDuration(); |
45 | 46 |
| 47 // The threshold of EffectiveConnectionType above which previews should not be |
| 48 // served. |
| 49 net::EffectiveConnectionType EffectiveConnectionTypeThreshold(); |
| 50 |
46 } // namespace params | 51 } // namespace params |
47 | 52 |
48 enum class PreviewsType { | 53 enum class PreviewsType { |
49 NONE = 0, | 54 NONE = 0, |
50 OFFLINE = 1, | 55 OFFLINE = 1, |
51 LAST = 2, | 56 LAST = 2, |
52 }; | 57 }; |
53 | 58 |
54 // Returns true if any client-side previews experiment is active. | 59 // Returns true if any client-side previews experiment is active. |
55 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); | 60 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); |
56 | 61 |
57 // Returns true if the field trial that should enable previews for |type| for | 62 // Returns true if the field trial that should enable previews for |type| for |
58 // prohibitvely slow networks is active. | 63 // prohibitvely slow networks is active. |
59 bool IsPreviewsTypeEnabled(PreviewsType type); | 64 bool IsPreviewsTypeEnabled(PreviewsType type); |
60 | 65 |
61 // Sets the appropriate state for field trial and variations to imitate the | 66 // Sets the appropriate state for field trial and variations to imitate the |
62 // offline pages field trial. | 67 // offline pages field trial. |
63 bool EnableOfflinePreviewsForTesting(); | 68 bool EnableOfflinePreviewsForTesting(); |
64 | 69 |
65 } // namespace previews | 70 } // namespace previews |
66 | 71 |
67 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ | 72 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ |
OLD | NEW |