Skip to content

Commit

Permalink
[MOB-3028] Move Analytics and dependencies to Ecosia framework
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaschifino committed Nov 15, 2024
1 parent 613218a commit e5bca0a
Show file tree
Hide file tree
Showing 50 changed files with 213 additions and 143 deletions.
138 changes: 86 additions & 52 deletions Client.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Client/Coordinators/Browser/BrowserCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Redux
import TabDataStore
// Ecosia: Import Core
import Core
import Ecosia

class BrowserCoordinator: BaseCoordinator,
LaunchCoordinatorDelegate,
Expand Down
1 change: 1 addition & 0 deletions Client/Coordinators/Launch/LaunchCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import Common
import Foundation
import Ecosia

protocol LaunchCoordinatorDelegate: AnyObject {
func didFinishLaunch(from coordinator: LaunchCoordinator)
Expand Down
1 change: 1 addition & 0 deletions Client/Coordinators/Router/RouteBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Foundation
import CoreSpotlight
import Shared
import Ecosia

final class RouteBuilder {
private var isPrivate = false
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/Bookmarks/BookmarksExchange.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Foundation
import Core
import Shared
import Storage
import Ecosia

protocol BookmarksExchangable {
func export(bookmarks: [Core.BookmarkItem], in viewController: UIViewController, barButtonItem: UIBarButtonItem) async throws
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import Foundation
import Core
import Ecosia

struct SeedCounterNTPExperiment {
private enum Variant: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Common
import UIKit
import Shared
import Ecosia

extension AppSettingsTableViewController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import UIKit
import Core
import Shared
import Ecosia

extension BrowserViewController: HomepageViewControllerDelegate {
func homeDidTapSearchButton(_ home: HomepageViewController) {
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/Settings/EcosiaDebugSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import UIKit
import Core
import Shared
import Common
import Ecosia

final class PushBackInstallation: HiddenSetting {
override var title: NSAttributedString? {
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/Settings/EcosiaSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Foundation
import Core
import Shared
import Common
import Ecosia

var ecosiaDisclosureIndicator: UIImageView {
let config = UIImage.SymbolConfiguration(pointSize: 16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Foundation
import Shared
import Common
import Ecosia

final class NTPCustomizationSettingsViewController: SettingsTableViewController {
init() {
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/EmptyBookmarksView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import UIKit
import Common
import Ecosia

final class EmptyBookmarksView: UIView, Themeable {

Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/LoadingScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import UIKit
import Core
import Ecosia

final class LoadingScreen: UIViewController {
private weak var profile: Profile!
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/MarketsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Core
import UIKit
import Common
import Ecosia

final class Markets {
private(set) static var all: [Market] = {
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/MultiplyImpact/MultiplyImpact.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import UniformTypeIdentifiers
import MobileCoreServices
import LinkPresentation
import Common
import Ecosia

final class MultiplyImpact: UIViewController, Themeable {

Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/NTP/AboutEcosia/AboutEcosiaSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import Foundation
import Core
import Ecosia

enum AboutEcosiaSection: Int, CaseIterable {
case
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/NTP/AboutEcosia/NTPAboutEcosiaCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import Foundation
import Common
import Ecosia

final class NTPAboutEcosiaCell: UICollectionViewCell, ReusableCell {
struct UX {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import Foundation
import Core
import Ecosia

enum CustomizableNTPSettingConfig: CaseIterable {
case topSites
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/NTP/DefaultBrowser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import UIKit
import Common
import Ecosia

@available(iOS 14, *)
protocol DefaultBrowserDelegate: AnyObject {
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/NTP/Library/NTPLibraryCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Shared
import UIKit
import Common
import Ecosia

class NTPLibraryCell: UICollectionViewCell, Themeable, ReusableCell {

Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/NTP/News/NTPNewsCellViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Foundation
import Shared
import Core
import Common
import Ecosia

protocol NTPNewsCellDelegate: AnyObject {
func openSeeAllNews()
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/NTP/News/NewsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Core
import UIKit
import Common
import Ecosia

final class NewsController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource,
UICollectionViewDelegateFlowLayout, Themeable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/

import Foundation
import Ecosia

final class NTPNewsletterCardViewModel: NTPConfigurableNudgeCardCellViewModel {
override var title: String {
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/Onboarding/Welcome.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import UIKit
import Core
import Common
import Ecosia

protocol WelcomeDelegate: AnyObject {
func welcomeDidFinish(_ welcome: Welcome)
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/Onboarding/WelcomeTour.Step.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import UIKit
import Core
import Ecosia

extension WelcomeTour {

Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/Onboarding/WelcomeTour.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import UIKit
import Core
import Common
import Ecosia

protocol WelcomeTourDelegate: AnyObject {
func welcomeTourDidFinish(_ tour: WelcomeTour)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Foundation
import Shared
import Core
import Common
import Ecosia

/// A local data provider for fetching What's New items based on app version updates.
final class WhatsNewLocalDataProvider: WhatsNewDataProvider {
Expand Down
1 change: 1 addition & 0 deletions Client/Frontend/Browser/MainMenuActionHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Common
import Core
// Ecosia: Need SafariServices to enable "open in safari" action
import SafariServices
import Ecosia

protocol ToolBarActionMenuDelegate: AnyObject {
func updateToolbarState()
Expand Down
1 change: 1 addition & 0 deletions Client/Frontend/Home/HomepageViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Common
import MozillaAppServices
import Shared
import Core
import Ecosia

protocol HomepageViewModelDelegate: AnyObject {
func reloadView()
Expand Down
1 change: 1 addition & 0 deletions Client/Frontend/Home/TopSites/TopSitesViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Shared
import Storage
// Ecosia: importing Core
import Core
import Ecosia

class TopSitesViewModel {
struct UX {
Expand Down
1 change: 1 addition & 0 deletions Client/Frontend/Library/Bookmarks/BookmarksPanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Storage
import Shared
import SiteImageView
import Core
import Ecosia

let LocalizedRootBookmarkFolderStrings = [
BookmarkRoots.MenuFolderGUID: String.BookmarksFolderTitleMenu,
Expand Down
1 change: 1 addition & 0 deletions Client/Frontend/Settings/Main/DefaultBrowserSetting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Common
import Foundation
import Shared
import Ecosia

class DefaultBrowserSetting: Setting {
override var accessibilityIdentifier: String? { return "DefaultBrowserSettings" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Common
import Foundation
import Shared
import Ecosia

enum SearchBarPosition: String, FlaggableFeatureOptions {
case bottom
Expand Down
1 change: 1 addition & 0 deletions Client/TabManagement/TabManagerImplementation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import TabDataStore
import Storage
import Common
import Shared
import Ecosia

// This class subclasses the legacy tab manager temporarily so we can
// gradually migrate to the new system
Expand Down
1 change: 1 addition & 0 deletions Client/TabManagement/TabMigrationUtility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Common
import Shared
import TabDataStore
import Ecosia

protocol TabMigrationUtility {
var shouldRunMigration: Bool { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ extension Analytics {
/// Checks if a day has passed since the last check for a specific event.
/// - Parameter identifier: A unique identifier used to store and retrieve the last check date from `UserDefaults`.
/// - Returns: A Boolean value indicating whether a day has passed since the last check. If no previous check exists, returns `true` and records the current date.
static func hasDayPassedSinceLastCheck(for identifier: String) -> Bool {
public static func hasDayPassedSinceLastCheck(for identifier: String) -> Bool {
let now = Date()
let defaults = UserDefaults.standard

Expand Down
Loading

0 comments on commit e5bca0a

Please sign in to comment.