1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

formatting

This commit is contained in:
Kyle Spearrin
2019-08-22 10:18:21 -04:00
parent 318370b46c
commit 2cbaa52a40

View File

@@ -28,7 +28,7 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
webViewConfig.preferences.setValue(true, forKey: "developerExtrasEnabled") webViewConfig.preferences.setValue(true, forKey: "developerExtrasEnabled")
webViewConfig.userContentController.add(self, name: "bitwardenApp") webViewConfig.userContentController.add(self, name: "bitwardenApp")
webView = WKWebView(frame: CGRect(x: 0, y: 0, width: parentWidth, height: parentHeight), webView = WKWebView(frame: CGRect(x: 0, y: 0, width: parentWidth, height: parentHeight),
configuration: webViewConfig) configuration: webViewConfig)
webView.navigationDelegate = self webView.navigationDelegate = self
webView.allowsLinkPreview = false webView.allowsLinkPreview = false
webView.loadFileURL(url!, allowingReadAccessTo: bundleURL) webView.loadFileURL(url!, allowingReadAccessTo: bundleURL)
@@ -209,9 +209,9 @@ func processWindowsForTabs(wins: [SFSafariWindow], options: TabQueryOptions?, co
let windowIndex = wins.firstIndex(of: win) ?? -100 let windowIndex = wins.firstIndex(of: win) ?? -100
let tabIndex = allTabs.firstIndex(of: tab) ?? -1 let tabIndex = allTabs.firstIndex(of: tab) ?? -1
makeTabObject(tab: tab, activeTab: activeTab, windowIndex: windowIndex, makeTabObject(tab: tab, activeTab: activeTab, windowIndex: windowIndex,
tabIndex: tabIndex, complete: { t in tabIndex: tabIndex, complete: { t in
newTabs.append(t) newTabs.append(t)
tabGroup.leave() tabGroup.leave()
}) })
} else { } else {
tabGroup.leave() tabGroup.leave()
@@ -220,9 +220,9 @@ func processWindowsForTabs(wins: [SFSafariWindow], options: TabQueryOptions?, co
let windowIndex = wins.firstIndex(of: win) ?? -100 let windowIndex = wins.firstIndex(of: win) ?? -100
let tabIndex = allTabs.firstIndex(of: tab) ?? -1 let tabIndex = allTabs.firstIndex(of: tab) ?? -1
makeTabObject(tab: tab, activeTab: activeTab, windowIndex: windowIndex, makeTabObject(tab: tab, activeTab: activeTab, windowIndex: windowIndex,
tabIndex: tabIndex, complete: { t in tabIndex: tabIndex, complete: { t in
newTabs.append(t) newTabs.append(t)
tabGroup.leave() tabGroup.leave()
}) })
} }
} }
@@ -238,7 +238,7 @@ func processWindowsForTabs(wins: [SFSafariWindow], options: TabQueryOptions?, co
} }
func makeTabObject(tab: SFSafariTab, activeTab: SFSafariTab?, windowIndex: Int, tabIndex: Int, func makeTabObject(tab: SFSafariTab, activeTab: SFSafariTab?, windowIndex: Int, tabIndex: Int,
complete: @escaping (Tab) -> Void) { complete: @escaping (Tab) -> Void) {
let t = Tab() let t = Tab()
t.active = activeTab != nil && tab == activeTab t.active = activeTab != nil && tab == activeTab
t.windowId = windowIndex t.windowId = windowIndex