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

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

Issue 2760063002: Add support to previews/ for Server LoFi and LitePages (Closed)
Patch Set: rebase Created 3 years, 7 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 <string>
8 #include <utility> 9 #include <utility>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/time/time.h" 12 #include "base/time/time.h"
12 #include "net/nqe/effective_connection_type.h" 13 #include "net/nqe/effective_connection_type.h"
13 14
14 namespace previews { 15 namespace previews {
15 16
16 namespace params { 17 namespace params {
17 18
(...skipping 24 matching lines...) Expand all
42 43
43 // The amount of time after any opt out that no previews should be shown. 44 // The amount of time after any opt out that no previews should be shown.
44 base::TimeDelta SingleOptOutDuration(); 45 base::TimeDelta SingleOptOutDuration();
45 46
46 // 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
47 // shown as a preview. 48 // shown as a preview.
48 base::TimeDelta OfflinePreviewFreshnessDuration(); 49 base::TimeDelta OfflinePreviewFreshnessDuration();
49 50
50 // The threshold of EffectiveConnectionType above which offline previews should 51 // The threshold of EffectiveConnectionType above which offline previews should
51 // not be served. 52 // not be served.
52 net::EffectiveConnectionType EffectiveConnectionTypeThresholdForOffline(); 53 net::EffectiveConnectionType EffectiveConnectionTypeThreshold();
tbansal1 2017/05/05 20:34:39 why rename this? As per the comment above, seems l
RyanSturm 2017/05/05 20:51:35 Done.
53 54
54 // Whether offline previews are enabled. 55 // Whether offline previews are enabled.
55 bool IsOfflinePreviewsEnabled(); 56 bool IsOfflinePreviewsEnabled();
56 57
57 // The blacklist version for offline previews. 58 // The blacklist version for offline previews.
58 int OfflinePreviewsVersion(); 59 int OfflinePreviewsVersion();
59 60
60 // Whether Client LoFi previews are enabled. 61 // Whether Client LoFi previews are enabled.
61 bool IsClientLoFiEnabled(); 62 bool IsClientLoFiEnabled();
62 63
63 // The blacklist version for Client LoFi previews. 64 // The blacklist version for Client LoFi previews.
64 int ClientLoFiVersion(); 65 int ClientLoFiVersion();
65 66
66 // The threshold of EffectiveConnectionType above which Client LoFi previews 67 // The threshold of EffectiveConnectionType above which Client LoFi previews
67 // should not be served. 68 // should not be served.
68 net::EffectiveConnectionType EffectiveConnectionTypeThresholdForClientLoFi(); 69 net::EffectiveConnectionType EffectiveConnectionTypeThresholdForClientLoFi();
69 70
70 } // namespace params 71 } // namespace params
71 72
72 enum class PreviewsType { 73 enum class PreviewsType {
73 NONE = 0, 74 NONE = 0,
74 75
75 // The user is shown an offline page as a preview. 76 // The user is shown an offline page as a preview.
76 OFFLINE = 1, 77 OFFLINE = 1,
77 78
78 // Replace images with placeholders generated on the client. 79 // Replace images with placeholders.
79 CLIENT_LOFI = 2, 80 LOFI = 2,
81
82 // The user is shown a server lite page.
83 LITE_PAGE = 3,
80 84
81 // Insert new enum values here. Keep values sequential to allow looping 85 // Insert new enum values here. Keep values sequential to allow looping
82 // from NONE+1 to LAST-1. 86 // from NONE+1 to LAST-1.
83 LAST = 3, 87 LAST = 4,
84 }; 88 };
85 89
86 typedef std::vector<std::pair<PreviewsType, int>> PreviewsTypeList; 90 typedef std::vector<std::pair<PreviewsType, int>> PreviewsTypeList;
87 91
92 // Gets the string representation of |type|.
93 std::string GetStringNameForType(PreviewsType type);
94
88 } // namespace previews 95 } // namespace previews
89 96
90 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ 97 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698