@@ -71,12 +71,6 @@ public class NTPDataSource {
71
71
/// This is reset on each launch, so `3` can be shown again if app is removed from memory.
72
72
/// This number _must_ be less than the number of backgrounds!
73
73
private static let numberOfDuplicateAvoidance = 6
74
- /// The number of images in a sponsorship rotation.
75
- /// i.e. This number will be repeated before a new sponsorship is shown.
76
- /// If sposnored image is shown as Nth image, this number of normal images will be shown before Nth is reached again.
77
- private static let sponsorshipShowRate = 4
78
- /// On this value, a sponsored image will be shown.
79
- private static let sponsorshipShowValue = 2
80
74
81
75
/// The counter that indicates what background should be shown, this is used to determine when a new
82
76
/// sponsored image should be shown. (`1` means, first image in cycle N, should be shown).
@@ -133,7 +127,7 @@ public class NTPDataSource {
133
127
if let sponsor = service. sponsoredImageData {
134
128
let attemptSponsored =
135
129
Preferences . NewTabPage. backgroundSponsoredImages. value
136
- && backgroundRotationCounter == NTPDataSource . sponsorshipShowValue
130
+ && backgroundRotationCounter == service . initialCountToBrandedWallpaper
137
131
&& !privateBrowsingManager. isPrivateBrowsing
138
132
139
133
if attemptSponsored {
@@ -186,7 +180,7 @@ public class NTPDataSource {
186
180
} ( )
187
181
188
182
// Force back to `0` if at end
189
- backgroundRotationCounter %= NTPDataSource . sponsorshipShowRate
183
+ backgroundRotationCounter %= service . countToBrandedWallpaper
190
184
// Increment regardless, this is a counter, not an index, so smallest should be `1`
191
185
backgroundRotationCounter += 1
192
186
0 commit comments