Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FXIOS-868 ⁃ #7069: Top Sites and Open Tabs Widget #7283

Merged
merged 6 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 90 additions & 2 deletions Client.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@
0BF8F8DA1AEFF1C900E90BC2 /* noTitle.html in Resources */ = {isa = PBXBuildFile; fileRef = 0BF8F8D91AEFF1C900E90BC2 /* noTitle.html */; };
19DE1F671EC13B6400428B8C /* LeanplumIntegration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19DE1F661EC13B6400428B8C /* LeanplumIntegration.swift */; };
2386E4E624F8358E0072EF17 /* DefaultBrowserCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2386E4E524F8358E0072EF17 /* DefaultBrowserCard.swift */; };
1D06AE6624FEE4D5000B092B /* TopSitesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D06AE6524FEE4D5000B092B /* TopSitesProvider.swift */; };
1D06AE6A24FEE8D6000B092B /* TabProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D06AE6924FEE8D6000B092B /* TabProvider.swift */; };
1D06AE6B24FEE992000B092B /* FaviconFetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = E65075561E37F714006961AC /* FaviconFetcher.swift */; };
1D06AE6F24FEEA52000B092B /* photon-colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C49854D206173C800893DAE /* photon-colors.swift */; };
1D0BA05C24F46A0400D731B5 /* TopSitesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D0BA05B24F46A0400D731B5 /* TopSitesManager.swift */; };
1D0BA05E24F48B1800D731B5 /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = D34DC84D1A16C40C00D49B7B /* Profile.swift */; };
1D0BA05F24F48B2E00D731B5 /* SearchEngines.swift in Sources */ = {isa = PBXBuildFile; fileRef = D308E4E31A5306F500842685 /* SearchEngines.swift */; };
1D0BA06024F48B3A00D731B5 /* PanelDataObservers.swift in Sources */ = {isa = PBXBuildFile; fileRef = E68F36971EA694000048CF44 /* PanelDataObservers.swift */; };
1D0BA06124F48B4100D731B5 /* SyncStatusResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = E60D03171D511398002FE3F6 /* SyncStatusResolver.swift */; };
1D0BA06224F48B9800D731B5 /* OpenSearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3FA77831A43B2CE0010CD32 /* OpenSearch.swift */; };
1D0BA06324F48BA200D731B5 /* DefaultSearchPrefs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA24A341FD84D620098F159 /* DefaultSearchPrefs.swift */; };
1D49F7EC24F6DF190075C4D3 /* TopSitesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D0BA05B24F46A0400D731B5 /* TopSitesManager.swift */; };
1D49F7F024F6F2170075C4D3 /* libSync.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2827315E1ABC9BE600AA1954 /* libSync.a */; };
1D9E1FE524FEF56C006E561D /* TopSites in Resources */ = {isa = PBXBuildFile; fileRef = 3BC659481E5BA4AE006D560F /* TopSites */; };
1DA3CE5D24EEE73100422BB2 /* OpenTabsWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA3CE5C24EEE73100422BB2 /* OpenTabsWidget.swift */; };
1DA3CE5F24EEE7C600422BB2 /* TabArchiver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA3CE5E24EEE7C600422BB2 /* TabArchiver.swift */; };
1DA3CE6024EEE7C600422BB2 /* TabArchiver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA3CE5E24EEE7C600422BB2 /* TabArchiver.swift */; };
1DA3CE6124EEE7F000422BB2 /* SessionData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C027441B2A348C001B1E88 /* SessionData.swift */; };
1DA3CE6324EEE83200422BB2 /* SavedTab+ConfigureExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA3CE6224EEE83200422BB2 /* SavedTab+ConfigureExtension.swift */; };
1DA3CE6524EEE84800422BB2 /* SavedTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63306D3821103EAE00F25400 /* SavedTab.swift */; };
1DA3CE6724EEE86C00422BB2 /* AppInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = E65075641E37F7AB006961AC /* AppInfo.swift */; };
1DDAD13E24F0651C007623C8 /* TopSitesWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DDAD13C24F064F7007623C8 /* TopSitesWidget.swift */; };
1FCF5C2524351CB4003AB95D /* Glean.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FCF5C2324351CB4003AB95D /* Glean.framework */; };
274A36C9239EB94000A21587 /* LibraryPanelButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274A36C8239EB94000A21587 /* LibraryPanelButton.swift */; };
274A36CC239EB99400A21587 /* LibraryPanelContextMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274A36CB239EB99400A21587 /* LibraryPanelContextMenu.swift */; };
274A36CE239EB9EC00A21587 /* LibraryViewController+LibraryPanelDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274A36CD239EB9EC00A21587 /* LibraryViewController+LibraryPanelDelegate.swift */; };
Expand Down Expand Up @@ -632,7 +655,6 @@
DA9FD88624E213CD00168D1E /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA9FD88524E213CC00168D1E /* Helpers.swift */; };
DA9FD88824E213DD00168D1E /* QuickLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA9FD88724E213DC00168D1E /* QuickLink.swift */; };
DA9FD88924E213E500168D1E /* QuickLinkSelection.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = DA9FD88124E213B400168D1E /* QuickLinkSelection.intentdefinition */; settings = {ATTRIBUTES = (no_codegen, ); }; };
DA9FD88A24E2153A00168D1E /* libShared.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 288A2D861AB8B3260023ABC3 /* libShared.a */; };
DABDA4AD20DA0FB900FBB0BD /* ObjcExceptionBridging.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DABDA4AC20DA0FB800FBB0BD /* ObjcExceptionBridging.framework */; };
DACDE996225E537900C8F37F /* VersionSettingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DACDE995225E537900C8F37F /* VersionSettingTests.swift */; };
DADC62DA226E3297003AFF8B /* ReopenLastTabTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DADC62D9226E3297003AFF8B /* ReopenLastTabTests.swift */; };
Expand Down Expand Up @@ -872,6 +894,13 @@
remoteGlobalIDString = 047F9B2624E1FE1C00CD7DF7;
remoteInfo = WidgetKitExtension;
};
1D49F7EE24F6EAD70075C4D3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F84B21B61A090F8100AAB793 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 2827315D1ABC9BE600AA1954;
remoteInfo = Sync;
};
2827316A1ABC9BE700AA1954 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F84B21B61A090F8100AAB793 /* Project object */;
Expand Down Expand Up @@ -1257,6 +1286,13 @@
0BF42D4E1A7CD09600889E28 /* TestFavicons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestFavicons.swift; sourceTree = "<group>"; };
0BF8F8D91AEFF1C900E90BC2 /* noTitle.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = noTitle.html; sourceTree = "<group>"; };
19DE1F661EC13B6400428B8C /* LeanplumIntegration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LeanplumIntegration.swift; sourceTree = "<group>"; };
1D06AE6524FEE4D5000B092B /* TopSitesProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopSitesProvider.swift; sourceTree = "<group>"; };
1D06AE6924FEE8D6000B092B /* TabProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabProvider.swift; sourceTree = "<group>"; };
1D0BA05B24F46A0400D731B5 /* TopSitesManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopSitesManager.swift; sourceTree = "<group>"; };
1DA3CE5C24EEE73100422BB2 /* OpenTabsWidget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenTabsWidget.swift; sourceTree = "<group>"; };
1DA3CE5E24EEE7C600422BB2 /* TabArchiver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabArchiver.swift; sourceTree = "<group>"; };
1DA3CE6224EEE83200422BB2 /* SavedTab+ConfigureExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SavedTab+ConfigureExtension.swift"; sourceTree = "<group>"; };
1DDAD13C24F064F7007623C8 /* TopSitesWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopSitesWidget.swift; sourceTree = "<group>"; };
1FCF5C2324351CB4003AB95D /* Glean.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Glean.framework; path = Carthage/Build/iOS/Glean.framework; sourceTree = "<group>"; };
2386E4E524F8358E0072EF17 /* DefaultBrowserCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultBrowserCard.swift; sourceTree = "<group>"; };
274A36C8239EB94000A21587 /* LibraryPanelButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryPanelButton.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2099,8 +2135,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1D49F7F024F6F2170075C4D3 /* libSync.a in Frameworks */,
047F9B2924E1FE1C00CD7DF7 /* SwiftUI.framework in Frameworks */,
DA9FD88A24E2153A00168D1E /* libShared.a in Frameworks */,
047F9B2824E1FE1C00CD7DF7 /* WidgetKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -2295,6 +2332,8 @@
047F9B2A24E1FE1C00CD7DF7 /* WidgetKit */ = {
isa = PBXGroup;
children = (
1DDAD13B24F064E6007623C8 /* TopSites */,
1DA3CE5B24EEE71B00422BB2 /* OpenTabs */,
DA9FD88724E213DC00168D1E /* QuickLink.swift */,
DA9FD88024E213B400168D1E /* SearchQuickLinksSmall */,
047F9B3924E1FED200CD7DF7 /* SearchQuickLinksMedium */,
Expand Down Expand Up @@ -2325,6 +2364,24 @@
path = ThirdParty/UIImageViewAligned;
sourceTree = "<group>";
};
1DA3CE5B24EEE71B00422BB2 /* OpenTabs */ = {
isa = PBXGroup;
children = (
1DA3CE5C24EEE73100422BB2 /* OpenTabsWidget.swift */,
1D06AE6924FEE8D6000B092B /* TabProvider.swift */,
);
path = OpenTabs;
sourceTree = "<group>";
};
1DDAD13B24F064E6007623C8 /* TopSites */ = {
isa = PBXGroup;
children = (
1DDAD13C24F064F7007623C8 /* TopSitesWidget.swift */,
1D06AE6524FEE4D5000B092B /* TopSitesProvider.swift */,
);
path = TopSites;
sourceTree = "<group>";
};
274A36D1239EBAD600A21587 /* LibraryViewController */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3390,7 +3447,10 @@
0BF0DB931A8545800039F300 /* URLBarView.swift */,
D0FCF7F41FE45842004A7995 /* UserScriptManager.swift */,
63306D3821103EAE00F25400 /* SavedTab.swift */,
1DA3CE6224EEE83200422BB2 /* SavedTab+ConfigureExtension.swift */,
63306D422110B3CD00F25400 /* TabManagerStore.swift */,
1DA3CE5E24EEE7C600422BB2 /* TabArchiver.swift */,
1D0BA05B24F46A0400D731B5 /* TopSitesManager.swift */,
);
path = Browser;
sourceTree = "<group>";
Expand Down Expand Up @@ -4218,6 +4278,7 @@
buildRules = (
);
dependencies = (
1D49F7EF24F6EAD70075C4D3 /* PBXTargetDependency */,
);
name = WidgetKitExtension;
productName = WidgetKitExtension;
Expand Down Expand Up @@ -4844,6 +4905,7 @@
buildActionMask = 2147483647;
files = (
047F9B2E24E1FE1F00CD7DF7 /* Assets.xcassets in Resources */,
1D9E1FE524FEF56C006E561D /* TopSites in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -5176,12 +5238,29 @@
buildActionMask = 2147483647;
files = (
047F9B3E24E1FF4000CD7DF7 /* SearchQuickLinks.swift in Sources */,
1D0BA05E24F48B1800D731B5 /* Profile.swift in Sources */,
1D0BA06124F48B4100D731B5 /* SyncStatusResolver.swift in Sources */,
DA9FD88624E213CD00168D1E /* Helpers.swift in Sources */,
1D06AE6B24FEE992000B092B /* FaviconFetcher.swift in Sources */,
1D06AE6A24FEE8D6000B092B /* TabProvider.swift in Sources */,
DA9FD88424E213B500168D1E /* SmallQuickLink.swift in Sources */,
1D06AE6624FEE4D5000B092B /* TopSitesProvider.swift in Sources */,
1D0BA06024F48B3A00D731B5 /* PanelDataObservers.swift in Sources */,
1D49F7EC24F6DF190075C4D3 /* TopSitesManager.swift in Sources */,
1DDAD13E24F0651C007623C8 /* TopSitesWidget.swift in Sources */,
047F9B4224E1FF4000CD7DF7 /* ImageButtonWithLabel.swift in Sources */,
047F9B2C24E1FE1C00CD7DF7 /* WidgetKit.swift in Sources */,
1DA3CE6724EEE86C00422BB2 /* AppInfo.swift in Sources */,
1D0BA06324F48BA200D731B5 /* DefaultSearchPrefs.swift in Sources */,
1DA3CE6024EEE7C600422BB2 /* TabArchiver.swift in Sources */,
1DA3CE6124EEE7F000422BB2 /* SessionData.swift in Sources */,
DA9FD88824E213DD00168D1E /* QuickLink.swift in Sources */,
1D0BA06224F48B9800D731B5 /* OpenSearch.swift in Sources */,
1DA3CE6524EEE84800422BB2 /* SavedTab.swift in Sources */,
1D0BA05F24F48B2E00D731B5 /* SearchEngines.swift in Sources */,
1D06AE6F24FEEA52000B092B /* photon-colors.swift in Sources */,
DA9FD88324E213B500168D1E /* QuickLinkSelection.intentdefinition in Sources */,
1DA3CE5D24EEE73100422BB2 /* OpenTabsWidget.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -5644,6 +5723,7 @@
745DAB301CDAAFAA00D44181 /* RecentlyClosedTabsPanel.swift in Sources */,
D0B9483D22A18B78002F4AA1 /* TextFieldTableViewCell.swift in Sources */,
C45F44691D087DB600CB7EF0 /* TopTabsViewController.swift in Sources */,
1D0BA05C24F46A0400D731B5 /* TopSitesManager.swift in Sources */,
0BF0DB941A8545800039F300 /* URLBarView.swift in Sources */,
C8FB0C782321523D00031088 /* PageActionMenu.swift in Sources */,
D01017F5219CB6BD009CBB5A /* DownloadContentScript.swift in Sources */,
Expand Down Expand Up @@ -5704,6 +5784,7 @@
0BB5B30B1AC0AD1F0052877D /* LoginsHelper.swift in Sources */,
C86E4F712493BA8E0087BFD9 /* Metrics.swift in Sources */,
E69E06C91C76198000D0F926 /* AuthenticationManagerConstants.swift in Sources */,
1DA3CE6324EEE83200422BB2 /* SavedTab+ConfigureExtension.swift in Sources */,
392ED7E61D0AEFEF009D9B62 /* HomePageAccessors.swift in Sources */,
7BA8D1C71BA037F500C8AE9E /* OpenInHelper.swift in Sources */,
CA90753824929B22005B794D /* NoLoginsView.swift in Sources */,
Expand Down Expand Up @@ -5787,6 +5868,7 @@
63306D3921103EAE00F25400 /* SavedTab.swift in Sources */,
2F44FCCB1A9E972E00FD20CC /* SearchEnginePicker.swift in Sources */,
E68E7ACB1CAC1D4500FDCA76 /* PagingPasscodeViewController.swift in Sources */,
1DA3CE5F24EEE7C600422BB2 /* TabArchiver.swift in Sources */,
D04D1B92209790B60074B35F /* Toast.swift in Sources */,
D34DC8531A16C40C00D49B7B /* Profile.swift in Sources */,
274A36CE239EB9EC00A21587 /* LibraryViewController+LibraryPanelDelegate.swift in Sources */,
Expand Down Expand Up @@ -5941,6 +6023,11 @@
target = 047F9B2624E1FE1C00CD7DF7 /* WidgetKitExtension */;
targetProxy = 047F9B3024E1FE1F00CD7DF7 /* PBXContainerItemProxy */;
};
1D49F7EF24F6EAD70075C4D3 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 2827315D1ABC9BE600AA1954 /* Sync */;
targetProxy = 1D49F7EE24F6EAD70075C4D3 /* PBXContainerItemProxy */;
};
2827316B1ABC9BE700AA1954 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 2827315D1ABC9BE600AA1954 /* Sync */;
Expand Down Expand Up @@ -7034,6 +7121,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon_Developer;
DEVELOPMENT_TEAM = 43AQ936H96;
PRODUCT_BUNDLE_IDENTIFIER = "$(MOZ_BUNDLE_ID)";
PRODUCT_MODULE_NAME = Client;
PRODUCT_NAME = Client;
Expand Down
5 changes: 5 additions & 0 deletions Client/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Sync
import CoreSpotlight
import UserNotifications
import Account
import WidgetKit

#if canImport(BackgroundTasks)
import BackgroundTasks
Expand Down Expand Up @@ -376,6 +377,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati
} else {
syncOnDidEnterBackground(application: application)
}

tabManager.preserveTabs()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spacing

WidgetCenter.shared.reloadAllTimelines()
}

fileprivate func syncOnDidEnterBackground(application: UIApplication) {
Expand Down
10 changes: 1 addition & 9 deletions Client/Frontend/Browser/FaviconHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import Storage
import SDWebImage

class FaviconHandler {
static let MaximumFaviconSize = 1 * 1024 * 1024 // 1 MiB file size limit

private let backgroundQueue = OperationQueue()

init() {
Expand All @@ -30,7 +28,7 @@ class FaviconHandler {
var fetch: SDWebImageOperation?

let onProgress: SDWebImageDownloaderProgressBlock = { (receivedSize, expectedSize, _) -> Void in
if receivedSize > FaviconHandler.MaximumFaviconSize || expectedSize > FaviconHandler.MaximumFaviconSize {
if receivedSize > FaviconFetcher.MaximumFaviconSize || expectedSize > FaviconFetcher.MaximumFaviconSize {
fetch?.cancel()
}
}
Expand Down Expand Up @@ -108,9 +106,3 @@ extension FaviconHandler: TabEventHandler {
tab.favicons.removeAll(keepingCapacity: false)
}
}

class FaviconError: MaybeErrorType {
internal var description: String {
return "No Image Loaded"
}
}
59 changes: 59 additions & 0 deletions Client/Frontend/Browser/SavedTab+ConfigureExtension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* 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 WebKit
import Storage
import Shared

// This cannot be easily imported into extension targets, so we break it out here.
extension SavedTab {
convenience init?(tab: Tab, isSelected: Bool) {
assert(Thread.isMainThread)

var sessionData = tab.sessionData
if sessionData == nil {
let currentItem: WKBackForwardListItem! = tab.webView?.backForwardList.currentItem

// Freshly created web views won't have any history entries at all.
// If we have no history, abort.
if currentItem != nil {
// The back & forward list keep track of the users history within the session
let backList = tab.webView?.backForwardList.backList ?? []
let forwardList = tab.webView?.backForwardList.forwardList ?? []
let urls = (backList + [currentItem] + forwardList).map { $0.url }
let currentPage = -forwardList.count
sessionData = SessionData(currentPage: currentPage, urls: urls, lastUsedTime: tab.lastExecutedTime ?? Date.now())
}
}

self.init(screenshotUUID: tab.screenshotUUID, isSelected: isSelected, title: tab.title ?? tab.lastTitle, isPrivate: tab.isPrivate, faviconURL: tab.displayFavicon?.url, url: tab.url, sessionData: sessionData)
}

func configureSavedTabUsing(_ tab: Tab, imageStore: DiskImageStore? = nil) -> Tab {
// Since this is a restored tab, reset the URL to be loaded as that will be handled by the SessionRestoreHandler
tab.url = nil

if let faviconURL = faviconURL {
let icon = Favicon(url: faviconURL, date: Date())
icon.width = 1
tab.favicons.append(icon)
}

if let screenshotUUID = screenshotUUID,
let imageStore = imageStore {
tab.screenshotUUID = screenshotUUID
imageStore.get(screenshotUUID.uuidString) >>== { screenshot in
if tab.screenshotUUID == screenshotUUID {
tab.setScreenshot(screenshot, revUUID: false)
}
}
}

tab.sessionData = sessionData
tab.lastTitle = title

return tab
}
}
Loading