Skip to content

Commit

Permalink
Merge branch 'develop' into feature/brad/js-api-overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayterDev committed Dec 9, 2020
2 parents 1f82673 + 9218822 commit fd02e8a
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 43 deletions.
4 changes: 0 additions & 4 deletions Core/Pixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ public enum PixelName: String {
case autocompleteSelectedLocal = "m_au_l"
case autocompleteSelectedRemote = "m_au_r"

case homeRowOnboardingMovedToBackground = "m_o_h_b"

case feedbackPositive = "mfbs_positive_submit"
case feedbackNegativePrefix = "mfbs_negative_"

Expand Down Expand Up @@ -138,8 +136,6 @@ public enum PixelName: String {
case widgetNewSearch = "m_w_ns"
case widgetAddFavoriteLaunch = "m_w_af"

case defaultBrowserButtonPressedOnboarding = "m_db_o"
case defaultBroswerOnboardingDeclineOptionPressed = "m_db_o_d"
case defaultBrowserButtonPressedSettings = "m_db_s"
case defaultBrowserButtonPressedHome = "m_db_h"
case defaultBrowserHomeMessageShown = "m_db_h_s"
Expand Down
12 changes: 1 addition & 11 deletions Core/VariantManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public enum FeatureName: String {

// Used for unit tests
case dummy

// Onboarding
case onboardingHomeRow
case onboardingDefaultBrowser
case onboardingWidgets
}

public struct Variant {
Expand Down Expand Up @@ -62,12 +57,7 @@ public struct Variant {
// SERP testing
Variant(name: "sc", weight: doNotAllocate, isIncluded: When.inRequiredCountry, features: []),
Variant(name: "sd", weight: doNotAllocate, isIncluded: When.always, features: []),
Variant(name: "se", weight: doNotAllocate, isIncluded: When.inRequiredCountry, features: []),

// Onboarding
Variant(name: "mh", weight: 1, isIncluded: When.inEnglishAndIOS14, features: [ .onboardingHomeRow ]),
Variant(name: "md", weight: 1, isIncluded: When.inEnglishAndIOS14, features: [ .onboardingDefaultBrowser ]),
Variant(name: "mw", weight: 1, isIncluded: When.inEnglishAndIOS14, features: [ .onboardingWidgets ])
Variant(name: "se", weight: doNotAllocate, isIncluded: When.inRequiredCountry, features: [])
]

public let name: String
Expand Down
6 changes: 0 additions & 6 deletions DuckDuckGo/OnboardingDefaultBroswerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,9 @@ class OnboardingDefaultBroswerViewController: OnboardingContentViewController {
}

override func onContinuePressed(navigationHandler: @escaping () -> Void) {
Pixel.fire(pixel: .defaultBrowserButtonPressedOnboarding)
if let url = URL(string: UIApplication.openSettingsURLString) {
UIApplication.shared.open(url)
}
super.onContinuePressed(navigationHandler: navigationHandler)
}

override func onSkipPressed(navigationHandler: @escaping () -> Void) {
Pixel.fire(pixel: .defaultBroswerOnboardingDeclineOptionPressed)
super.onSkipPressed(navigationHandler: navigationHandler)
}
}
17 changes: 0 additions & 17 deletions DuckDuckGo/OnboardingHomeRowViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,9 @@ class OnboardingHomeRowViewController: OnboardingContentViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

NotificationCenter.default.addObserver(
self,
selector: #selector(didEnterBackground(notification:)),
name: UIApplication.didEnterBackgroundNotification,
object: nil)
startVideo()
}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
NotificationCenter.default.removeObserver(
self,
name: UIApplication.didEnterBackgroundNotification,
object: nil)
}

override var header: String {
return UserText.homeRowOnboardingHeader
}
Expand Down Expand Up @@ -106,10 +93,6 @@ class OnboardingHomeRowViewController: OnboardingContentViewController {
playButton.isHidden = false
}

@objc func didEnterBackground(notification: NSNotification) {
Pixel.fire(pixel: .homeRowOnboardingMovedToBackground)
}

deinit {
NotificationCenter.default.removeObserver(self)
}
Expand Down
6 changes: 1 addition & 5 deletions DuckDuckGo/OnboardingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ import Core
class OnboardingViewController: UIViewController, Onboarding {

private lazy var controllerNames: [String] = {
if variantManager.isSupported(feature: .onboardingHomeRow) {
return ["onboardingHomeRow"]
} else if variantManager.isSupported(feature: .onboardingDefaultBrowser) {
if #available(iOS 14, *) {
return ["onboardingDefaultBrowser"]
} else if variantManager.isSupported(feature: .onboardingWidgets) {
return ["onboardingWidget"]
} else {
return ["onboardingHomeRow"]
}
Expand Down

0 comments on commit fd02e8a

Please sign in to comment.