forked from qodo-benchmark/firefox-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeneralBrowserAction.swift
More file actions
100 lines (94 loc) · 2.93 KB
/
GeneralBrowserAction.swift
File metadata and controls
100 lines (94 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/
import Foundation
import Redux
import Common
import WebKit
import SummarizeKit
struct GeneralBrowserAction: Action {
let windowUUID: WindowUUID
let actionType: ActionType
let selectedTabURL: URL?
let isPrivateBrowsing: Bool?
let toastType: ToastType?
let showOverlay: Bool?
let buttonTapped: UIButton?
let isNativeErrorPage: Bool?
let frame: WKFrameInfo?
let summarizerConfig: SummarizerConfig?
init(selectedTabURL: URL? = nil,
isPrivateBrowsing: Bool? = nil,
toastType: ToastType? = nil,
showOverlay: Bool? = nil,
buttonTapped: UIButton? = nil,
isNativeErrorPage: Bool? = nil,
frame: WKFrameInfo? = nil,
summarizerConfig: SummarizerConfig? = nil,
windowUUID: WindowUUID,
actionType: ActionType) {
self.windowUUID = windowUUID
self.actionType = actionType
self.selectedTabURL = selectedTabURL
self.isPrivateBrowsing = isPrivateBrowsing
self.toastType = toastType
self.buttonTapped = buttonTapped
self.showOverlay = showOverlay
self.isNativeErrorPage = isNativeErrorPage
self.frame = frame
self.summarizerConfig = summarizerConfig
}
}
enum GeneralBrowserActionType: ActionType {
case showToast
case showOverlay
case leaveOverlay
case updateSelectedTab
case goToHomepage
case navigateBack
case navigateForward
case showTabTray
case showBackForwardList
case showTrackingProtectionDetails
case showTabsLongPressActions
case showReloadLongPressAction
case showMenu
case showLocationViewLongPressActionSheet
case showSummarizer
case stopLoadingWebsite
case reloadWebsite
case reloadWebsiteNoCache
case showShare
case showReaderMode
case startAtHome
case addNewTab
case showNewTabLongPressActions
case addToReadingListLongPressAction
case clearData
case showPasswordGenerator
case didSelectedTabChangeToHomepage
case enteredZeroSearchScreen
case didUnhideToolbar
case didCloseTabFromToolbar
case shakeMotionEnded
}
struct GeneralBrowserMiddlewareAction: Action {
let windowUUID: WindowUUID
let actionType: ActionType
let scrollOffset: CGPoint?
let toolbarPosition: SearchBarPosition?
init(scrollOffset: CGPoint? = nil,
toolbarPosition: SearchBarPosition? = nil,
windowUUID: WindowUUID,
actionType: ActionType) {
self.windowUUID = windowUUID
self.actionType = actionType
self.scrollOffset = scrollOffset
self.toolbarPosition = toolbarPosition
}
}
enum GeneralBrowserMiddlewareActionType: ActionType {
case browserDidLoad
case toolbarPositionChanged
case websiteDidScroll
}