Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: components/previews/core/previews_experiments.h

Issue 2748033002: Revert of Moving previews code from components/ to chrome/ (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 base::TimeDelta SingleOptOutDuration(); 45 base::TimeDelta SingleOptOutDuration();
46 46
47 // The amount of time that an offline page is considered fresh enough to be 47 // The amount of time that an offline page is considered fresh enough to be
48 // shown as a preview. 48 // shown as a preview.
49 base::TimeDelta OfflinePreviewFreshnessDuration(); 49 base::TimeDelta OfflinePreviewFreshnessDuration();
50 50
51 // The threshold of EffectiveConnectionType above which previews should not be 51 // The threshold of EffectiveConnectionType above which previews should not be
52 // served. 52 // served.
53 net::EffectiveConnectionType EffectiveConnectionTypeThreshold(); 53 net::EffectiveConnectionType EffectiveConnectionTypeThreshold();
54 54
55 // Whether offline previews are enabled.
56 bool IsOfflinePreviewsEnabled();
57
58 // The blacklist version for offline previews.
59 int OfflinePreviewsVersion();
60
61 } // namespace params 55 } // namespace params
62 56
63 enum class PreviewsType { 57 enum class PreviewsType {
64 NONE = 0, 58 NONE = 0,
65 // The user is shown an offline page as a preview.
66 OFFLINE = 1, 59 OFFLINE = 1,
67 // Insert new enum values here. Keep values sequential to allow looping 60 // Insert new enum values here. Keep values sequential to allow looping
68 // from NONE+1 to LAST-1. 61 // from NONE+1 to LAST-1.
69 LAST = 2, 62 LAST = 2,
70 }; 63 };
71 64
72 typedef std::vector<std::pair<PreviewsType, int>> PreviewsTypeList; 65 typedef std::vector<std::pair<PreviewsType, int>> PreviewsTypeList;
73 66
74 // Returns true if any client-side previews experiment is active. 67 // Returns true if any client-side previews experiment is active.
75 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); 68 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial();
76 69
70 // Returns true if the field trial that should enable previews for |type| for
71 // prohibitvely slow networks is active.
72 bool IsPreviewsTypeEnabled(PreviewsType type);
73
74 // Returns the version of preview treatment |type|. Defaults to 0 if not
75 // specified in field trial config.
76 int GetPreviewsTypeVersion(PreviewsType type);
77
78 // Returns the enabled PreviewsTypes with their version.
79 std::unique_ptr<PreviewsTypeList> GetEnabledPreviews();
80
77 // Sets the appropriate state for field trial and variations to imitate the 81 // Sets the appropriate state for field trial and variations to imitate the
78 // offline pages field trial. 82 // offline pages field trial.
79 bool EnableOfflinePreviewsForTesting(); 83 bool EnableOfflinePreviewsForTesting();
80 84
81 } // namespace previews 85 } // namespace previews
82 86
83 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ 87 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_
OLDNEW
« no previous file with comments | « chrome/browser/previews/previews_service.cc ('k') | components/previews/core/previews_experiments.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698