upgrade to gecko 149.0
This commit is contained in:
+1
@@ -1513,6 +1513,7 @@ class _SendToDeviceExpansion extends ConsumerWidget {
|
|||||||
deviceId: device.deviceId,
|
deviceId: device.deviceId,
|
||||||
title: title,
|
title: title,
|
||||||
url: tabState.url.toString(),
|
url: tabState.url.toString(),
|
||||||
|
private: tabState.tabMode == TabMode.private,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
|
|||||||
+2
@@ -32,6 +32,7 @@ import 'package:weblibre/features/geckoview/domain/providers/tab_state.dart';
|
|||||||
import 'package:weblibre/features/geckoview/features/browser/presentation/dialogs/content_selection_dialog.dart';
|
import 'package:weblibre/features/geckoview/features/browser/presentation/dialogs/content_selection_dialog.dart';
|
||||||
import 'package:weblibre/features/geckoview/features/browser/presentation/dialogs/qr_code.dart';
|
import 'package:weblibre/features/geckoview/features/browser/presentation/dialogs/qr_code.dart';
|
||||||
import 'package:weblibre/features/geckoview/features/tabs/data/database/definitions.drift.dart';
|
import 'package:weblibre/features/geckoview/features/tabs/data/database/definitions.drift.dart';
|
||||||
|
import 'package:weblibre/features/geckoview/features/tabs/data/entities/tab_mode.dart';
|
||||||
import 'package:weblibre/features/geckoview/features/tabs/domain/repositories/tab.dart';
|
import 'package:weblibre/features/geckoview/features/tabs/domain/repositories/tab.dart';
|
||||||
import 'package:weblibre/features/sync/domain/repositories/sync.dart';
|
import 'package:weblibre/features/sync/domain/repositories/sync.dart';
|
||||||
import 'package:weblibre/presentation/hooks/cached_future.dart';
|
import 'package:weblibre/presentation/hooks/cached_future.dart';
|
||||||
@@ -377,6 +378,7 @@ class SendTabToDeviceMenuItemButton extends HookConsumerWidget {
|
|||||||
deviceId: device.deviceId,
|
deviceId: device.deviceId,
|
||||||
title: title,
|
title: title,
|
||||||
url: tabState.url.toString(),
|
url: tabState.url.toString(),
|
||||||
|
private: tabState.tabMode == TabMode.private,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
|
|||||||
+2
@@ -36,6 +36,7 @@ import 'package:weblibre/features/geckoview/features/open_link_tools/domain/enti
|
|||||||
import 'package:weblibre/features/geckoview/features/open_link_tools/domain/services/url_cleaner_catalog_service.dart';
|
import 'package:weblibre/features/geckoview/features/open_link_tools/domain/services/url_cleaner_catalog_service.dart';
|
||||||
import 'package:weblibre/features/geckoview/features/open_link_tools/presentation/dialogs/tracking_details_dialog.dart';
|
import 'package:weblibre/features/geckoview/features/open_link_tools/presentation/dialogs/tracking_details_dialog.dart';
|
||||||
import 'package:weblibre/features/geckoview/features/open_link_tools/presentation/hooks/url_cleaner_controller.dart';
|
import 'package:weblibre/features/geckoview/features/open_link_tools/presentation/hooks/url_cleaner_controller.dart';
|
||||||
|
import 'package:weblibre/features/geckoview/features/tabs/data/entities/tab_mode.dart';
|
||||||
import 'package:weblibre/features/sync/domain/repositories/sync.dart';
|
import 'package:weblibre/features/sync/domain/repositories/sync.dart';
|
||||||
import 'package:weblibre/features/user/domain/repositories/general_settings.dart';
|
import 'package:weblibre/features/user/domain/repositories/general_settings.dart';
|
||||||
import 'package:weblibre/presentation/hooks/cached_future.dart';
|
import 'package:weblibre/presentation/hooks/cached_future.dart';
|
||||||
@@ -426,6 +427,7 @@ class _SendToDeviceTile extends ConsumerWidget {
|
|||||||
deviceId: device.deviceId,
|
deviceId: device.deviceId,
|
||||||
title: title,
|
title: title,
|
||||||
url: tabState.url.toString(),
|
url: tabState.url.toString(),
|
||||||
|
private: tabState.tabMode == TabMode.private,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
|
|||||||
@@ -247,8 +247,9 @@ class SyncRepository extends _$SyncRepository {
|
|||||||
required String deviceId,
|
required String deviceId,
|
||||||
required String title,
|
required String title,
|
||||||
required String url,
|
required String url,
|
||||||
|
required bool private,
|
||||||
}) {
|
}) {
|
||||||
return _service.sendTabToDevice(deviceId, title, url);
|
return _service.sendTabToDevice(deviceId, title, url, private);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> setDeviceName(String newName) async {
|
Future<bool> setDeviceName(String newName) async {
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ final class SyncRepositoryProvider
|
|||||||
SyncRepository create() => SyncRepository();
|
SyncRepository create() => SyncRepository();
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$syncRepositoryHash() => r'c2765421a6cea9620e752aa9cbb37f79baf5b1c3';
|
String _$syncRepositoryHash() => r'fa3067cf8f48c7b32ffa3e0f25ebfb990695730c';
|
||||||
|
|
||||||
abstract class _$SyncRepository extends $AsyncNotifier<SyncRepositoryState> {
|
abstract class _$SyncRepository extends $AsyncNotifier<SyncRepositoryState> {
|
||||||
FutureOr<SyncRepositoryState> build();
|
FutureOr<SyncRepositoryState> build();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ version = "1.0-SNAPSHOT"
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = "2.3.10"
|
ext.kotlin_version = "2.3.10"
|
||||||
ext.mozillaComponentsVersion = '148.0.2'
|
ext.mozillaComponentsVersion = '149.0'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
|
|||||||
+2
-2
@@ -25,13 +25,13 @@ import eu.weblibre.flutter_mozilla_components.pigeons.GeckoTabContentEvents
|
|||||||
import eu.weblibre.flutter_mozilla_components.pigeons.ReaderViewController
|
import eu.weblibre.flutter_mozilla_components.pigeons.ReaderViewController
|
||||||
import mozilla.components.concept.engine.EngineView
|
import mozilla.components.concept.engine.EngineView
|
||||||
import mozilla.components.concept.engine.selection.SelectionActionDelegate
|
import mozilla.components.concept.engine.selection.SelectionActionDelegate
|
||||||
import mozilla.components.feature.downloads.DateTimeProvider
|
|
||||||
import mozilla.components.feature.downloads.DefaultDateTimeProvider
|
|
||||||
import mozilla.components.feature.downloads.DefaultFileSizeFormatter
|
import mozilla.components.feature.downloads.DefaultFileSizeFormatter
|
||||||
import mozilla.components.feature.downloads.DownloadEstimator
|
import mozilla.components.feature.downloads.DownloadEstimator
|
||||||
import mozilla.components.feature.downloads.FileSizeFormatter
|
import mozilla.components.feature.downloads.FileSizeFormatter
|
||||||
import mozilla.components.support.base.android.NotificationsDelegate
|
import mozilla.components.support.base.android.NotificationsDelegate
|
||||||
import mozilla.components.support.base.log.Log
|
import mozilla.components.support.base.log.Log
|
||||||
|
import mozilla.components.support.utils.DateTimeProvider
|
||||||
|
import mozilla.components.support.utils.DefaultDateTimeProvider
|
||||||
|
|
||||||
class Components(val profileApplicationContext: ProfileContext,
|
class Components(val profileApplicationContext: ProfileContext,
|
||||||
val flutterEvents: GeckoStateEvents,
|
val flutterEvents: GeckoStateEvents,
|
||||||
|
|||||||
+1
@@ -119,6 +119,7 @@ object GlobalComponents {
|
|||||||
// first full setup. We restore the tab list, but let startup open in
|
// first full setup. We restore the tab list, but let startup open in
|
||||||
// its neutral/default state instead of jumping back into prior content.
|
// its neutral/default state instead of jumping back into prior content.
|
||||||
selectedTabId = null,
|
selectedTabId = null,
|
||||||
|
tabPartitions = restoredState.tabPartitions
|
||||||
),
|
),
|
||||||
restoreLocation = TabListAction.RestoreAction.RestoreLocation.BEGINNING,
|
restoreLocation = TabListAction.RestoreAction.RestoreLocation.BEGINNING,
|
||||||
)
|
)
|
||||||
|
|||||||
+2
-1
@@ -25,6 +25,7 @@ import mozilla.components.support.base.feature.LifecycleAwareFeature
|
|||||||
import mozilla.components.support.ktx.android.content.appVersionName
|
import mozilla.components.support.ktx.android.content.appVersionName
|
||||||
import mozilla.components.ui.widgets.withCenterAlignedButtons
|
import mozilla.components.ui.widgets.withCenterAlignedButtons
|
||||||
import eu.weblibre.flutter_mozilla_components.R
|
import eu.weblibre.flutter_mozilla_components.R
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
import mozilla.components.feature.addons.R as MozComp
|
import mozilla.components.feature.addons.R as MozComp
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,7 +48,7 @@ class WebExtensionPromptFeature(
|
|||||||
* and opens / closes tabs as needed.
|
* and opens / closes tabs as needed.
|
||||||
*/
|
*/
|
||||||
override fun start() {
|
override fun start() {
|
||||||
scope = store.flowScoped { flow ->
|
scope = store.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.mapNotNull { state ->
|
flow.mapNotNull { state ->
|
||||||
state.webExtensionPromptRequest
|
state.webExtensionPromptRequest
|
||||||
}.distinctUntilChanged().collect { promptRequest ->
|
}.distinctUntilChanged().collect { promptRequest ->
|
||||||
|
|||||||
+4
-1
@@ -17,6 +17,7 @@ import kotlinx.coroutines.launch
|
|||||||
import mozilla.components.concept.sync.DeviceCapability
|
import mozilla.components.concept.sync.DeviceCapability
|
||||||
import mozilla.components.concept.sync.DeviceCommandOutgoing
|
import mozilla.components.concept.sync.DeviceCommandOutgoing
|
||||||
import mozilla.components.concept.sync.TabData
|
import mozilla.components.concept.sync.TabData
|
||||||
|
import mozilla.components.concept.sync.TabPrivacy
|
||||||
import mozilla.components.service.fxa.SyncEngine
|
import mozilla.components.service.fxa.SyncEngine
|
||||||
import mozilla.components.service.fxa.manager.SCOPE_PROFILE
|
import mozilla.components.service.fxa.manager.SCOPE_PROFILE
|
||||||
import mozilla.components.service.fxa.manager.SCOPE_SYNC
|
import mozilla.components.service.fxa.manager.SCOPE_SYNC
|
||||||
@@ -217,7 +218,8 @@ class GeckoSyncApiImpl : GeckoSyncApi {
|
|||||||
deviceId: String,
|
deviceId: String,
|
||||||
title: String,
|
title: String,
|
||||||
url: String,
|
url: String,
|
||||||
callback: (Result<Boolean>) -> Unit,
|
private: Boolean,
|
||||||
|
callback: (Result<Boolean>) -> Unit
|
||||||
) {
|
) {
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
runCatching {
|
runCatching {
|
||||||
@@ -237,6 +239,7 @@ class GeckoSyncApiImpl : GeckoSyncApi {
|
|||||||
DeviceCommandOutgoing.SendTab(
|
DeviceCommandOutgoing.SendTab(
|
||||||
title = title,
|
title = title,
|
||||||
url = url,
|
url = url,
|
||||||
|
privacy = if (private) TabPrivacy.Private else TabPrivacy.Normal,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}.fold(
|
}.fold(
|
||||||
|
|||||||
-20
@@ -10,7 +10,6 @@ import eu.weblibre.flutter_mozilla_components.pigeons.AddTabParams
|
|||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoTabsApi
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoTabsApi
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.HistoryMetadataKey as PigeonHistoryMetadataKey
|
import eu.weblibre.flutter_mozilla_components.pigeons.HistoryMetadataKey as PigeonHistoryMetadataKey
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.LoadUrlFlagsValue
|
import eu.weblibre.flutter_mozilla_components.pigeons.LoadUrlFlagsValue
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.RecoverableBrowserState as PigeonRecoverableBrowserState
|
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.RestoreLocation as PigeonRestoreLocation
|
import eu.weblibre.flutter_mozilla_components.pigeons.RestoreLocation as PigeonRestoreLocation
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.RecoverableTab as PigeonRecoverableTab
|
import eu.weblibre.flutter_mozilla_components.pigeons.RecoverableTab as PigeonRecoverableTab
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.SourceValue
|
import eu.weblibre.flutter_mozilla_components.pigeons.SourceValue
|
||||||
@@ -601,25 +600,6 @@ class GeckoTabsApiImpl : GeckoTabsApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun restoreTabsByBrowserState(
|
|
||||||
state: PigeonRecoverableBrowserState,
|
|
||||||
restoreLocation: PigeonRestoreLocation
|
|
||||||
) {
|
|
||||||
try {
|
|
||||||
components.useCases.tabsUseCases.restore(
|
|
||||||
state = RecoverableBrowserState(
|
|
||||||
selectedTabId = state.selectedTabId,
|
|
||||||
tabs = state.tabs.filterNotNull().map { mapTab(it) }
|
|
||||||
),
|
|
||||||
restoreLocation = mapRestoreLocation(restoreLocation)
|
|
||||||
)
|
|
||||||
logger.debug("$TAG: Restored browser state")
|
|
||||||
} catch (e: Exception) {
|
|
||||||
logger.error("$TAG: Failed to restore browser state", e)
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun selectOrAddTabByHistory(
|
override fun selectOrAddTabByHistory(
|
||||||
url: String,
|
url: String,
|
||||||
historyMetadata: PigeonHistoryMetadataKey
|
historyMetadata: PigeonHistoryMetadataKey
|
||||||
|
|||||||
+11
-10
@@ -26,6 +26,7 @@ import eu.weblibre.flutter_mozilla_components.pigeons.TabContentState
|
|||||||
import eu.weblibre.flutter_mozilla_components.pigeons.TabTranslationStateData
|
import eu.weblibre.flutter_mozilla_components.pigeons.TabTranslationStateData
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.TranslationEngineStateData
|
import eu.weblibre.flutter_mozilla_components.pigeons.TranslationEngineStateData
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.TranslationLanguage
|
import eu.weblibre.flutter_mozilla_components.pigeons.TranslationLanguage
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.FlowPreview
|
import kotlinx.coroutines.FlowPreview
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.debounce
|
import kotlinx.coroutines.flow.debounce
|
||||||
@@ -50,7 +51,7 @@ class Events(
|
|||||||
|
|
||||||
@OptIn(FlowPreview::class)
|
@OptIn(FlowPreview::class)
|
||||||
fun registerFlowEvents(stateFlow: Store<BrowserState, BrowserAction>) {
|
fun registerFlowEvents(stateFlow: Store<BrowserState, BrowserAction>) {
|
||||||
stateFlow.flowScoped { flow ->
|
stateFlow.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.map { state -> state.selectedTabId }
|
flow.map { state -> state.selectedTabId }
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
// Make sure this is sent after tabadded action and tab list change
|
// Make sure this is sent after tabadded action and tab list change
|
||||||
@@ -63,7 +64,7 @@ class Events(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stateFlow.flowScoped { flow ->
|
stateFlow.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
var previousTabs = emptySet<String>()
|
var previousTabs = emptySet<String>()
|
||||||
flow.mapNotNull { state -> state.tabs.map { tab -> tab.id } }
|
flow.mapNotNull { state -> state.tabs.map { tab -> tab.id } }
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
@@ -88,7 +89,7 @@ class Events(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stateFlow.flowScoped { flow ->
|
stateFlow.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.mapNotNull { state -> state.tabs }
|
flow.mapNotNull { state -> state.tabs }
|
||||||
.filterChanged {
|
.filterChanged {
|
||||||
it.content
|
it.content
|
||||||
@@ -105,7 +106,7 @@ class Events(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stateFlow.flowScoped { flow ->
|
stateFlow.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.mapNotNull { state -> state.tabs }
|
flow.mapNotNull { state -> state.tabs }
|
||||||
.filterChanged {
|
.filterChanged {
|
||||||
it.content.securityInfo
|
it.content.securityInfo
|
||||||
@@ -124,7 +125,7 @@ class Events(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stateFlow.flowScoped { flow ->
|
stateFlow.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.mapNotNull { state -> state.tabs }
|
flow.mapNotNull { state -> state.tabs }
|
||||||
.filterChanged {
|
.filterChanged {
|
||||||
it.readerState
|
it.readerState
|
||||||
@@ -148,7 +149,7 @@ class Events(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stateFlow.flowScoped { flow ->
|
stateFlow.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.mapNotNull { state -> state.tabs }
|
flow.mapNotNull { state -> state.tabs }
|
||||||
.filterChanged {
|
.filterChanged {
|
||||||
it.content
|
it.content
|
||||||
@@ -180,7 +181,7 @@ class Events(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stateFlow.flowScoped { flow ->
|
stateFlow.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.mapNotNull { state -> state.tabs }
|
flow.mapNotNull { state -> state.tabs }
|
||||||
.filterChanged {
|
.filterChanged {
|
||||||
it.content
|
it.content
|
||||||
@@ -226,7 +227,7 @@ class Events(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Translation engine state (browser-level)
|
// Translation engine state (browser-level)
|
||||||
stateFlow.flowScoped { flow ->
|
stateFlow.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.map { state -> state.translationEngine }
|
flow.map { state -> state.translationEngine }
|
||||||
.distinctUntilChanged { old, new ->
|
.distinctUntilChanged { old, new ->
|
||||||
old.isEngineSupported == new.isEngineSupported &&
|
old.isEngineSupported == new.isEngineSupported &&
|
||||||
@@ -253,7 +254,7 @@ class Events(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Per-tab translation state
|
// Per-tab translation state
|
||||||
stateFlow.flowScoped { flow ->
|
stateFlow.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.mapNotNull { state -> state.tabs }
|
flow.mapNotNull { state -> state.tabs }
|
||||||
.filterChanged {
|
.filterChanged {
|
||||||
it.translationsState
|
it.translationsState
|
||||||
@@ -291,7 +292,7 @@ class Events(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PWA manifest availability events - following Fenix MenuPresenter pattern
|
// PWA manifest availability events - following Fenix MenuPresenter pattern
|
||||||
stateFlow.flowScoped { flow ->
|
stateFlow.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.mapNotNull { state -> state.selectedTab }
|
flow.mapNotNull { state -> state.selectedTab }
|
||||||
.ifAnyChanged { tab ->
|
.ifAnyChanged { tab ->
|
||||||
arrayOf(
|
arrayOf(
|
||||||
|
|||||||
+3
-2
@@ -10,6 +10,7 @@ import eu.weblibre.flutter_mozilla_components.ext.EventSequence
|
|||||||
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoTabContentEvents
|
import eu.weblibre.flutter_mozilla_components.pigeons.GeckoTabContentEvents
|
||||||
import eu.weblibre.flutter_mozilla_components.pigeons.TabContent
|
import eu.weblibre.flutter_mozilla_components.pigeons.TabContent
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.cancel
|
import kotlinx.coroutines.cancel
|
||||||
import kotlinx.coroutines.flow.map
|
import kotlinx.coroutines.flow.map
|
||||||
import mozilla.components.browser.state.store.BrowserStore
|
import mozilla.components.browser.state.store.BrowserStore
|
||||||
@@ -87,7 +88,7 @@ class ReadabilityExtractFeature(
|
|||||||
extensionController.install(
|
extensionController.install(
|
||||||
engine,
|
engine,
|
||||||
onSuccess = { extension ->
|
onSuccess = { extension ->
|
||||||
sessionScope = store.flowScoped { flow ->
|
sessionScope = store.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.map { it.tabs }
|
flow.map { it.tabs }
|
||||||
.filterChanged { it.engineState.engineSession }
|
.filterChanged { it.engineState.engineSession }
|
||||||
.collect { state ->
|
.collect { state ->
|
||||||
@@ -102,7 +103,7 @@ class ReadabilityExtractFeature(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
historyScope = store.flowScoped { flow ->
|
historyScope = store.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.map { it.tabs }
|
flow.map { it.tabs }
|
||||||
.filterChanged { it.content.history }
|
.filterChanged { it.content.history }
|
||||||
.ifAnyChanged { arrayOf(it.content.history.currentIndex) }
|
.ifAnyChanged { arrayOf(it.content.history.currentIndex) }
|
||||||
|
|||||||
+1
-1
@@ -86,7 +86,7 @@ class WebExtensionToolbarFeature(
|
|||||||
}
|
}
|
||||||
|
|
||||||
iconJobDispatcher = iconHandler.asCoroutineDispatcher("WebExtensionIconDispatcher")
|
iconJobDispatcher = iconHandler.asCoroutineDispatcher("WebExtensionIconDispatcher")
|
||||||
scope = store.flowScoped { flow ->
|
scope = store.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow.ifAnyChanged { arrayOf(it.selectedTab, it.extensions) }
|
flow.ifAnyChanged { arrayOf(it.selectedTab, it.extensions) }
|
||||||
.collect { state ->
|
.collect { state ->
|
||||||
renderWebExtensionActions(state, state.selectedTab)
|
renderWebExtensionActions(state, state.selectedTab)
|
||||||
|
|||||||
+116
-181
@@ -1338,43 +1338,6 @@ data class RecoverableTab (
|
|||||||
override fun hashCode(): Int = toList().hashCode()
|
override fun hashCode(): Int = toList().hashCode()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A restored browser state, read from disk.
|
|
||||||
*
|
|
||||||
* Generated class from Pigeon that represents data sent in messages.
|
|
||||||
*/
|
|
||||||
data class RecoverableBrowserState (
|
|
||||||
/** The list of restored tabs. */
|
|
||||||
val tabs: List<RecoverableTab?>,
|
|
||||||
/** The ID of the selected tab in [tabs]. Or `null` if no selection was restored. */
|
|
||||||
val selectedTabId: String? = null
|
|
||||||
)
|
|
||||||
{
|
|
||||||
companion object {
|
|
||||||
fun fromList(pigeonVar_list: List<Any?>): RecoverableBrowserState {
|
|
||||||
val tabs = pigeonVar_list[0] as List<RecoverableTab?>
|
|
||||||
val selectedTabId = pigeonVar_list[1] as String?
|
|
||||||
return RecoverableBrowserState(tabs, selectedTabId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fun toList(): List<Any?> {
|
|
||||||
return listOf(
|
|
||||||
tabs,
|
|
||||||
selectedTabId,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
override fun equals(other: Any?): Boolean {
|
|
||||||
if (other !is RecoverableBrowserState) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this === other) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return GeckoPigeonUtils.deepEquals(toList(), other.toList()) }
|
|
||||||
|
|
||||||
override fun hashCode(): Int = toList().hashCode()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A request to load an [Icon].
|
* A request to load an [Icon].
|
||||||
*
|
*
|
||||||
@@ -4111,290 +4074,285 @@ private open class GeckoPigeonCodec : StandardMessageCodec() {
|
|||||||
}
|
}
|
||||||
178.toByte() -> {
|
178.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
RecoverableBrowserState.fromList(it)
|
IconRequest.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
179.toByte() -> {
|
179.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
IconRequest.fromList(it)
|
ResourceSize.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
180.toByte() -> {
|
180.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ResourceSize.fromList(it)
|
Resource.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
181.toByte() -> {
|
181.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
Resource.fromList(it)
|
IconResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
182.toByte() -> {
|
182.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
IconResult.fromList(it)
|
CookiePartitionKey.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
183.toByte() -> {
|
183.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
CookiePartitionKey.fromList(it)
|
Cookie.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
184.toByte() -> {
|
184.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
Cookie.fromList(it)
|
VisitInfo.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
185.toByte() -> {
|
185.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
VisitInfo.fromList(it)
|
HistoryHighlightWeights.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
186.toByte() -> {
|
186.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
HistoryHighlightWeights.fromList(it)
|
HistoryHighlight.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
187.toByte() -> {
|
187.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
HistoryHighlight.fromList(it)
|
TopFrecentSiteInfo.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
188.toByte() -> {
|
188.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
TopFrecentSiteInfo.fromList(it)
|
HistoryItem.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
189.toByte() -> {
|
189.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
HistoryItem.fromList(it)
|
HistoryState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
190.toByte() -> {
|
190.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
HistoryState.fromList(it)
|
ReaderableState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
191.toByte() -> {
|
191.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ReaderableState.fromList(it)
|
SecurityInfoState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
192.toByte() -> {
|
192.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
SecurityInfoState.fromList(it)
|
TabContentState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
193.toByte() -> {
|
193.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
TabContentState.fromList(it)
|
FindResultState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
194.toByte() -> {
|
194.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
FindResultState.fromList(it)
|
CustomSelectionAction.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
195.toByte() -> {
|
195.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
CustomSelectionAction.fromList(it)
|
WebExtensionData.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
196.toByte() -> {
|
196.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
WebExtensionData.fromList(it)
|
GeckoSuggestion.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
197.toByte() -> {
|
197.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
GeckoSuggestion.fromList(it)
|
TabContent.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
198.toByte() -> {
|
198.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
TabContent.fromList(it)
|
ContentBlocking.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
199.toByte() -> {
|
199.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ContentBlocking.fromList(it)
|
DohSettings.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
200.toByte() -> {
|
200.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
DohSettings.fromList(it)
|
GeckoEngineSettings.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
201.toByte() -> {
|
201.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
GeckoEngineSettings.fromList(it)
|
AutocompleteResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
202.toByte() -> {
|
202.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
AutocompleteResult.fromList(it)
|
UnknownHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
203.toByte() -> {
|
203.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
UnknownHitResult.fromList(it)
|
ImageHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
204.toByte() -> {
|
204.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ImageHitResult.fromList(it)
|
VideoHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
205.toByte() -> {
|
205.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
VideoHitResult.fromList(it)
|
AudioHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
206.toByte() -> {
|
206.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
AudioHitResult.fromList(it)
|
ImageSrcHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
207.toByte() -> {
|
207.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ImageSrcHitResult.fromList(it)
|
PhoneHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
208.toByte() -> {
|
208.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
PhoneHitResult.fromList(it)
|
EmailHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
209.toByte() -> {
|
209.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
EmailHitResult.fromList(it)
|
GeoHitResult.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
210.toByte() -> {
|
210.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
GeoHitResult.fromList(it)
|
DownloadState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
211.toByte() -> {
|
211.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
DownloadState.fromList(it)
|
ShareInternetResourceState.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
212.toByte() -> {
|
212.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ShareInternetResourceState.fromList(it)
|
AddonCollection.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
213.toByte() -> {
|
213.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
AddonCollection.fromList(it)
|
SyncEngineStatus.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
214.toByte() -> {
|
214.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
SyncEngineStatus.fromList(it)
|
SyncAccountInfo.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
215.toByte() -> {
|
215.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
SyncAccountInfo.fromList(it)
|
SyncDevice.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
216.toByte() -> {
|
216.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
SyncDevice.fromList(it)
|
SyncIncomingTab.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
217.toByte() -> {
|
217.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
SyncIncomingTab.fromList(it)
|
SyncRemoteTab.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
218.toByte() -> {
|
218.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
SyncRemoteTab.fromList(it)
|
SyncDeviceTabs.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
219.toByte() -> {
|
219.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
SyncDeviceTabs.fromList(it)
|
GeckoPref.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
220.toByte() -> {
|
220.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
GeckoPref.fromList(it)
|
MlProgressData.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
221.toByte() -> {
|
221.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
MlProgressData.fromList(it)
|
ContainerSiteAssignment.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
222.toByte() -> {
|
222.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ContainerSiteAssignment.fromList(it)
|
GeckoHeader.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
223.toByte() -> {
|
223.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
GeckoHeader.fromList(it)
|
GeckoFetchRequest.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
224.toByte() -> {
|
224.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
GeckoFetchRequest.fromList(it)
|
GeckoFetchResponse.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
225.toByte() -> {
|
225.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
GeckoFetchResponse.fromList(it)
|
BookmarkNode.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
226.toByte() -> {
|
226.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
BookmarkNode.fromList(it)
|
BookmarkInfo.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
227.toByte() -> {
|
227.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
BookmarkInfo.fromList(it)
|
SitePermissions.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
228.toByte() -> {
|
228.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
SitePermissions.fromList(it)
|
TrackingProtectionException.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
229.toByte() -> {
|
229.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
TrackingProtectionException.fromList(it)
|
PwaIcon.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
230.toByte() -> {
|
230.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
PwaIcon.fromList(it)
|
ShareTargetFiles.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
231.toByte() -> {
|
231.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ShareTargetFiles.fromList(it)
|
ShareTargetParams.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
232.toByte() -> {
|
232.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ShareTargetParams.fromList(it)
|
ShareTarget.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
233.toByte() -> {
|
233.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
|
||||||
ShareTarget.fromList(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
234.toByte() -> {
|
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
ExternalApplicationResource.fromList(it)
|
ExternalApplicationResource.fromList(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
235.toByte() -> {
|
234.toByte() -> {
|
||||||
return (readValue(buffer) as? List<Any?>)?.let {
|
return (readValue(buffer) as? List<Any?>)?.let {
|
||||||
PwaManifest.fromList(it)
|
PwaManifest.fromList(it)
|
||||||
}
|
}
|
||||||
@@ -4600,236 +4558,232 @@ private open class GeckoPigeonCodec : StandardMessageCodec() {
|
|||||||
stream.write(177)
|
stream.write(177)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is RecoverableBrowserState -> {
|
is IconRequest -> {
|
||||||
stream.write(178)
|
stream.write(178)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is IconRequest -> {
|
is ResourceSize -> {
|
||||||
stream.write(179)
|
stream.write(179)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ResourceSize -> {
|
is Resource -> {
|
||||||
stream.write(180)
|
stream.write(180)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is Resource -> {
|
is IconResult -> {
|
||||||
stream.write(181)
|
stream.write(181)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is IconResult -> {
|
is CookiePartitionKey -> {
|
||||||
stream.write(182)
|
stream.write(182)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is CookiePartitionKey -> {
|
is Cookie -> {
|
||||||
stream.write(183)
|
stream.write(183)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is Cookie -> {
|
is VisitInfo -> {
|
||||||
stream.write(184)
|
stream.write(184)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is VisitInfo -> {
|
is HistoryHighlightWeights -> {
|
||||||
stream.write(185)
|
stream.write(185)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is HistoryHighlightWeights -> {
|
is HistoryHighlight -> {
|
||||||
stream.write(186)
|
stream.write(186)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is HistoryHighlight -> {
|
is TopFrecentSiteInfo -> {
|
||||||
stream.write(187)
|
stream.write(187)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is TopFrecentSiteInfo -> {
|
is HistoryItem -> {
|
||||||
stream.write(188)
|
stream.write(188)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is HistoryItem -> {
|
is HistoryState -> {
|
||||||
stream.write(189)
|
stream.write(189)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is HistoryState -> {
|
is ReaderableState -> {
|
||||||
stream.write(190)
|
stream.write(190)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ReaderableState -> {
|
is SecurityInfoState -> {
|
||||||
stream.write(191)
|
stream.write(191)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is SecurityInfoState -> {
|
is TabContentState -> {
|
||||||
stream.write(192)
|
stream.write(192)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is TabContentState -> {
|
is FindResultState -> {
|
||||||
stream.write(193)
|
stream.write(193)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is FindResultState -> {
|
is CustomSelectionAction -> {
|
||||||
stream.write(194)
|
stream.write(194)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is CustomSelectionAction -> {
|
is WebExtensionData -> {
|
||||||
stream.write(195)
|
stream.write(195)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is WebExtensionData -> {
|
is GeckoSuggestion -> {
|
||||||
stream.write(196)
|
stream.write(196)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is GeckoSuggestion -> {
|
is TabContent -> {
|
||||||
stream.write(197)
|
stream.write(197)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is TabContent -> {
|
is ContentBlocking -> {
|
||||||
stream.write(198)
|
stream.write(198)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ContentBlocking -> {
|
is DohSettings -> {
|
||||||
stream.write(199)
|
stream.write(199)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is DohSettings -> {
|
is GeckoEngineSettings -> {
|
||||||
stream.write(200)
|
stream.write(200)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is GeckoEngineSettings -> {
|
is AutocompleteResult -> {
|
||||||
stream.write(201)
|
stream.write(201)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is AutocompleteResult -> {
|
is UnknownHitResult -> {
|
||||||
stream.write(202)
|
stream.write(202)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is UnknownHitResult -> {
|
is ImageHitResult -> {
|
||||||
stream.write(203)
|
stream.write(203)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ImageHitResult -> {
|
is VideoHitResult -> {
|
||||||
stream.write(204)
|
stream.write(204)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is VideoHitResult -> {
|
is AudioHitResult -> {
|
||||||
stream.write(205)
|
stream.write(205)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is AudioHitResult -> {
|
is ImageSrcHitResult -> {
|
||||||
stream.write(206)
|
stream.write(206)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ImageSrcHitResult -> {
|
is PhoneHitResult -> {
|
||||||
stream.write(207)
|
stream.write(207)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is PhoneHitResult -> {
|
is EmailHitResult -> {
|
||||||
stream.write(208)
|
stream.write(208)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is EmailHitResult -> {
|
is GeoHitResult -> {
|
||||||
stream.write(209)
|
stream.write(209)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is GeoHitResult -> {
|
is DownloadState -> {
|
||||||
stream.write(210)
|
stream.write(210)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is DownloadState -> {
|
is ShareInternetResourceState -> {
|
||||||
stream.write(211)
|
stream.write(211)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ShareInternetResourceState -> {
|
is AddonCollection -> {
|
||||||
stream.write(212)
|
stream.write(212)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is AddonCollection -> {
|
is SyncEngineStatus -> {
|
||||||
stream.write(213)
|
stream.write(213)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is SyncEngineStatus -> {
|
is SyncAccountInfo -> {
|
||||||
stream.write(214)
|
stream.write(214)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is SyncAccountInfo -> {
|
is SyncDevice -> {
|
||||||
stream.write(215)
|
stream.write(215)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is SyncDevice -> {
|
is SyncIncomingTab -> {
|
||||||
stream.write(216)
|
stream.write(216)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is SyncIncomingTab -> {
|
is SyncRemoteTab -> {
|
||||||
stream.write(217)
|
stream.write(217)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is SyncRemoteTab -> {
|
is SyncDeviceTabs -> {
|
||||||
stream.write(218)
|
stream.write(218)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is SyncDeviceTabs -> {
|
is GeckoPref -> {
|
||||||
stream.write(219)
|
stream.write(219)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is GeckoPref -> {
|
is MlProgressData -> {
|
||||||
stream.write(220)
|
stream.write(220)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is MlProgressData -> {
|
is ContainerSiteAssignment -> {
|
||||||
stream.write(221)
|
stream.write(221)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ContainerSiteAssignment -> {
|
is GeckoHeader -> {
|
||||||
stream.write(222)
|
stream.write(222)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is GeckoHeader -> {
|
is GeckoFetchRequest -> {
|
||||||
stream.write(223)
|
stream.write(223)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is GeckoFetchRequest -> {
|
is GeckoFetchResponse -> {
|
||||||
stream.write(224)
|
stream.write(224)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is GeckoFetchResponse -> {
|
is BookmarkNode -> {
|
||||||
stream.write(225)
|
stream.write(225)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is BookmarkNode -> {
|
is BookmarkInfo -> {
|
||||||
stream.write(226)
|
stream.write(226)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is BookmarkInfo -> {
|
is SitePermissions -> {
|
||||||
stream.write(227)
|
stream.write(227)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is SitePermissions -> {
|
is TrackingProtectionException -> {
|
||||||
stream.write(228)
|
stream.write(228)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is TrackingProtectionException -> {
|
is PwaIcon -> {
|
||||||
stream.write(229)
|
stream.write(229)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is PwaIcon -> {
|
is ShareTargetFiles -> {
|
||||||
stream.write(230)
|
stream.write(230)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ShareTargetFiles -> {
|
is ShareTargetParams -> {
|
||||||
stream.write(231)
|
stream.write(231)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ShareTargetParams -> {
|
is ShareTarget -> {
|
||||||
stream.write(232)
|
stream.write(232)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ShareTarget -> {
|
is ExternalApplicationResource -> {
|
||||||
stream.write(233)
|
stream.write(233)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
is ExternalApplicationResource -> {
|
|
||||||
stream.write(234)
|
|
||||||
writeValue(stream, value.toList())
|
|
||||||
}
|
|
||||||
is PwaManifest -> {
|
is PwaManifest -> {
|
||||||
stream.write(235)
|
stream.write(234)
|
||||||
writeValue(stream, value.toList())
|
writeValue(stream, value.toList())
|
||||||
}
|
}
|
||||||
else -> super.writeValue(stream, value)
|
else -> super.writeValue(stream, value)
|
||||||
@@ -5010,7 +4964,7 @@ interface GeckoSyncApi {
|
|||||||
fun setEngineEnabled(engine: SyncEngineValue, enabled: Boolean, callback: (Result<Unit>) -> Unit)
|
fun setEngineEnabled(engine: SyncEngineValue, enabled: Boolean, callback: (Result<Unit>) -> Unit)
|
||||||
fun getSyncedTabs(callback: (Result<List<SyncDeviceTabs>>) -> Unit)
|
fun getSyncedTabs(callback: (Result<List<SyncDeviceTabs>>) -> Unit)
|
||||||
fun getDevices(callback: (Result<List<SyncDevice>>) -> Unit)
|
fun getDevices(callback: (Result<List<SyncDevice>>) -> Unit)
|
||||||
fun sendTabToDevice(deviceId: String, title: String, url: String, callback: (Result<Boolean>) -> Unit)
|
fun sendTabToDevice(deviceId: String, title: String, url: String, private: Boolean, callback: (Result<Boolean>) -> Unit)
|
||||||
fun refreshDevices(callback: (Result<Unit>) -> Unit)
|
fun refreshDevices(callback: (Result<Unit>) -> Unit)
|
||||||
fun pollDeviceCommands(callback: (Result<Unit>) -> Unit)
|
fun pollDeviceCommands(callback: (Result<Unit>) -> Unit)
|
||||||
fun drainIncomingTabs(callback: (Result<List<SyncIncomingTab>>) -> Unit)
|
fun drainIncomingTabs(callback: (Result<List<SyncIncomingTab>>) -> Unit)
|
||||||
@@ -5178,7 +5132,8 @@ interface GeckoSyncApi {
|
|||||||
val deviceIdArg = args[0] as String
|
val deviceIdArg = args[0] as String
|
||||||
val titleArg = args[1] as String
|
val titleArg = args[1] as String
|
||||||
val urlArg = args[2] as String
|
val urlArg = args[2] as String
|
||||||
api.sendTabToDevice(deviceIdArg, titleArg, urlArg) { result: Result<Boolean> ->
|
val privateArg = args[3] as Boolean
|
||||||
|
api.sendTabToDevice(deviceIdArg, titleArg, urlArg, privateArg) { result: Result<Boolean> ->
|
||||||
val error = result.exceptionOrNull()
|
val error = result.exceptionOrNull()
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
reply.reply(GeckoPigeonUtils.wrapError(error))
|
reply.reply(GeckoPigeonUtils.wrapError(error))
|
||||||
@@ -5820,7 +5775,6 @@ interface GeckoTabsApi {
|
|||||||
fun removePrivateTabs()
|
fun removePrivateTabs()
|
||||||
fun undo()
|
fun undo()
|
||||||
fun restoreTabsByList(tabs: List<RecoverableTab>, selectTabId: String?, restoreLocation: RestoreLocation)
|
fun restoreTabsByList(tabs: List<RecoverableTab>, selectTabId: String?, restoreLocation: RestoreLocation)
|
||||||
fun restoreTabsByBrowserState(state: RecoverableBrowserState, restoreLocation: RestoreLocation)
|
|
||||||
/**
|
/**
|
||||||
* Selects an already existing tab with the matching [HistoryMetadataKey] or otherwise
|
* Selects an already existing tab with the matching [HistoryMetadataKey] or otherwise
|
||||||
* creates a new tab with the given [url].
|
* creates a new tab with the given [url].
|
||||||
@@ -6056,25 +6010,6 @@ interface GeckoTabsApi {
|
|||||||
channel.setMessageHandler(null)
|
channel.setMessageHandler(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
run {
|
|
||||||
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.flutter_mozilla_components.GeckoTabsApi.restoreTabsByBrowserState$separatedMessageChannelSuffix", codec)
|
|
||||||
if (api != null) {
|
|
||||||
channel.setMessageHandler { message, reply ->
|
|
||||||
val args = message as List<Any?>
|
|
||||||
val stateArg = args[0] as RecoverableBrowserState
|
|
||||||
val restoreLocationArg = args[1] as RestoreLocation
|
|
||||||
val wrapped: List<Any?> = try {
|
|
||||||
api.restoreTabsByBrowserState(stateArg, restoreLocationArg)
|
|
||||||
listOf(null)
|
|
||||||
} catch (exception: Throwable) {
|
|
||||||
GeckoPigeonUtils.wrapError(exception)
|
|
||||||
}
|
|
||||||
reply.reply(wrapped)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
channel.setMessageHandler(null)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
run {
|
run {
|
||||||
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.flutter_mozilla_components.GeckoTabsApi.selectOrAddTabByHistory$separatedMessageChannelSuffix", codec)
|
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.flutter_mozilla_components.GeckoTabsApi.selectOrAddTabByHistory$separatedMessageChannelSuffix", codec)
|
||||||
if (api != null) {
|
if (api != null) {
|
||||||
|
|||||||
+11
-1
@@ -6,15 +6,17 @@
|
|||||||
|
|
||||||
package eu.weblibre.flutter_mozilla_components.services
|
package eu.weblibre.flutter_mozilla_components.services
|
||||||
|
|
||||||
|
import android.os.Environment
|
||||||
import eu.weblibre.flutter_mozilla_components.GlobalComponents
|
import eu.weblibre.flutter_mozilla_components.GlobalComponents
|
||||||
import mozilla.components.browser.state.store.BrowserStore
|
import mozilla.components.browser.state.store.BrowserStore
|
||||||
import mozilla.components.feature.downloads.AbstractFetchDownloadService
|
import mozilla.components.feature.downloads.AbstractFetchDownloadService
|
||||||
import mozilla.components.feature.downloads.DateTimeProvider
|
|
||||||
import mozilla.components.feature.downloads.DefaultPackageNameProvider
|
import mozilla.components.feature.downloads.DefaultPackageNameProvider
|
||||||
import mozilla.components.feature.downloads.DownloadEstimator
|
import mozilla.components.feature.downloads.DownloadEstimator
|
||||||
import mozilla.components.feature.downloads.FileSizeFormatter
|
import mozilla.components.feature.downloads.FileSizeFormatter
|
||||||
import mozilla.components.feature.downloads.PackageNameProvider
|
import mozilla.components.feature.downloads.PackageNameProvider
|
||||||
import mozilla.components.support.base.android.NotificationsDelegate
|
import mozilla.components.support.base.android.NotificationsDelegate
|
||||||
|
import mozilla.components.support.utils.DefaultDownloadFileUtils
|
||||||
|
import mozilla.components.support.utils.DownloadFileUtils
|
||||||
|
|
||||||
class DownloadService : AbstractFetchDownloadService() {
|
class DownloadService : AbstractFetchDownloadService() {
|
||||||
private val components by lazy {
|
private val components by lazy {
|
||||||
@@ -31,4 +33,12 @@ class DownloadService : AbstractFetchDownloadService() {
|
|||||||
applicationContext
|
applicationContext
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
override val downloadFileUtils: DownloadFileUtils by lazy {
|
||||||
|
DefaultDownloadFileUtils(
|
||||||
|
context = applicationContext,
|
||||||
|
downloadLocation = {
|
||||||
|
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).path
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+4
-3
@@ -26,6 +26,7 @@ import com.mikepenz.iconics.utils.colorInt
|
|||||||
import com.mikepenz.iconics.utils.sizeDp
|
import com.mikepenz.iconics.utils.sizeDp
|
||||||
import eu.weblibre.flutter_mozilla_components.R
|
import eu.weblibre.flutter_mozilla_components.R
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.cancel
|
import kotlinx.coroutines.cancel
|
||||||
import kotlinx.coroutines.flow.mapNotNull
|
import kotlinx.coroutines.flow.mapNotNull
|
||||||
import mozilla.components.browser.state.selector.findCustomTab
|
import mozilla.components.browser.state.selector.findCustomTab
|
||||||
@@ -193,7 +194,7 @@ class CustomTabToolbar @JvmOverloads constructor(
|
|||||||
val sessionId = this.sessionId ?: return
|
val sessionId = this.sessionId ?: return
|
||||||
val store = this.store ?: return
|
val store = this.store ?: return
|
||||||
|
|
||||||
urlScope = store.flowScoped { flow ->
|
urlScope = store.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow
|
flow
|
||||||
.mapNotNull { state -> state.findCustomTab(sessionId) }
|
.mapNotNull { state -> state.findCustomTab(sessionId) }
|
||||||
.ifAnyChanged { tab -> arrayOf(tab.content.url) }
|
.ifAnyChanged { tab -> arrayOf(tab.content.url) }
|
||||||
@@ -208,7 +209,7 @@ class CustomTabToolbar @JvmOverloads constructor(
|
|||||||
val sessionId = this.sessionId ?: return
|
val sessionId = this.sessionId ?: return
|
||||||
val store = this.store ?: return
|
val store = this.store ?: return
|
||||||
|
|
||||||
titleScope = store.flowScoped { flow ->
|
titleScope = store.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow
|
flow
|
||||||
.mapNotNull { state -> state.findCustomTab(sessionId) }
|
.mapNotNull { state -> state.findCustomTab(sessionId) }
|
||||||
.ifAnyChanged { tab -> arrayOf(tab.content.title) }
|
.ifAnyChanged { tab -> arrayOf(tab.content.title) }
|
||||||
@@ -220,7 +221,7 @@ class CustomTabToolbar @JvmOverloads constructor(
|
|||||||
val sessionId = this.sessionId ?: return
|
val sessionId = this.sessionId ?: return
|
||||||
val store = this.store ?: return
|
val store = this.store ?: return
|
||||||
|
|
||||||
securityScope = store.flowScoped { flow ->
|
securityScope = store.flowScoped(dispatcher = Dispatchers.Main) { flow ->
|
||||||
flow
|
flow
|
||||||
.mapNotNull { state -> state.findCustomTab(sessionId) }
|
.mapNotNull { state -> state.findCustomTab(sessionId) }
|
||||||
.ifAnyChanged {
|
.ifAnyChanged {
|
||||||
|
|||||||
@@ -42,8 +42,13 @@ class GeckoSyncService {
|
|||||||
return _api.getDevices();
|
return _api.getDevices();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> sendTabToDevice(String deviceId, String title, String url) {
|
Future<bool> sendTabToDevice(
|
||||||
return _api.sendTabToDevice(deviceId, title, url);
|
String deviceId,
|
||||||
|
String title,
|
||||||
|
String url,
|
||||||
|
bool private,
|
||||||
|
) {
|
||||||
|
return _api.sendTabToDevice(deviceId, title, url, private);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> refreshDevices() {
|
Future<void> refreshDevices() {
|
||||||
|
|||||||
@@ -116,15 +116,6 @@ class GeckoTabService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> restoreTabsByBrowserState({
|
|
||||||
required RecoverableBrowserState state,
|
|
||||||
RestoreLocation restoreLocation = RestoreLocation.end,
|
|
||||||
}) {
|
|
||||||
return _api.restoreTabsByBrowserState(
|
|
||||||
state: state,
|
|
||||||
restoreLocation: restoreLocation,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
//The calls with engin storage for restore are not supported at the moment
|
//The calls with engin storage for restore are not supported at the moment
|
||||||
|
|
||||||
//selectOrAddTab invokes splitted
|
//selectOrAddTab invokes splitted
|
||||||
|
|||||||
@@ -1325,55 +1325,6 @@ class RecoverableTab {
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A restored browser state, read from disk.
|
|
||||||
class RecoverableBrowserState {
|
|
||||||
RecoverableBrowserState({
|
|
||||||
required this.tabs,
|
|
||||||
this.selectedTabId,
|
|
||||||
});
|
|
||||||
|
|
||||||
/// The list of restored tabs.
|
|
||||||
List<RecoverableTab?> tabs;
|
|
||||||
|
|
||||||
/// The ID of the selected tab in [tabs]. Or `null` if no selection was restored.
|
|
||||||
String? selectedTabId;
|
|
||||||
|
|
||||||
List<Object?> _toList() {
|
|
||||||
return <Object?>[
|
|
||||||
tabs,
|
|
||||||
selectedTabId,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
Object encode() {
|
|
||||||
return _toList(); }
|
|
||||||
|
|
||||||
static RecoverableBrowserState decode(Object result) {
|
|
||||||
result as List<Object?>;
|
|
||||||
return RecoverableBrowserState(
|
|
||||||
tabs: (result[0] as List<Object?>?)!.cast<RecoverableTab?>(),
|
|
||||||
selectedTabId: result[1] as String?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
if (other is! RecoverableBrowserState || other.runtimeType != runtimeType) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (identical(this, other)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return _deepEquals(encode(), other.encode());
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
|
||||||
int get hashCode => Object.hashAll(_toList())
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A request to load an [Icon].
|
/// A request to load an [Icon].
|
||||||
class IconRequest {
|
class IconRequest {
|
||||||
IconRequest({
|
IconRequest({
|
||||||
@@ -5189,179 +5140,176 @@ class _PigeonCodec extends StandardMessageCodec {
|
|||||||
} else if (value is RecoverableTab) {
|
} else if (value is RecoverableTab) {
|
||||||
buffer.putUint8(177);
|
buffer.putUint8(177);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is RecoverableBrowserState) {
|
} else if (value is IconRequest) {
|
||||||
buffer.putUint8(178);
|
buffer.putUint8(178);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is IconRequest) {
|
} else if (value is ResourceSize) {
|
||||||
buffer.putUint8(179);
|
buffer.putUint8(179);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ResourceSize) {
|
} else if (value is Resource) {
|
||||||
buffer.putUint8(180);
|
buffer.putUint8(180);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is Resource) {
|
} else if (value is IconResult) {
|
||||||
buffer.putUint8(181);
|
buffer.putUint8(181);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is IconResult) {
|
} else if (value is CookiePartitionKey) {
|
||||||
buffer.putUint8(182);
|
buffer.putUint8(182);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is CookiePartitionKey) {
|
} else if (value is Cookie) {
|
||||||
buffer.putUint8(183);
|
buffer.putUint8(183);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is Cookie) {
|
} else if (value is VisitInfo) {
|
||||||
buffer.putUint8(184);
|
buffer.putUint8(184);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is VisitInfo) {
|
} else if (value is HistoryHighlightWeights) {
|
||||||
buffer.putUint8(185);
|
buffer.putUint8(185);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is HistoryHighlightWeights) {
|
} else if (value is HistoryHighlight) {
|
||||||
buffer.putUint8(186);
|
buffer.putUint8(186);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is HistoryHighlight) {
|
} else if (value is TopFrecentSiteInfo) {
|
||||||
buffer.putUint8(187);
|
buffer.putUint8(187);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is TopFrecentSiteInfo) {
|
} else if (value is HistoryItem) {
|
||||||
buffer.putUint8(188);
|
buffer.putUint8(188);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is HistoryItem) {
|
} else if (value is HistoryState) {
|
||||||
buffer.putUint8(189);
|
buffer.putUint8(189);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is HistoryState) {
|
} else if (value is ReaderableState) {
|
||||||
buffer.putUint8(190);
|
buffer.putUint8(190);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ReaderableState) {
|
} else if (value is SecurityInfoState) {
|
||||||
buffer.putUint8(191);
|
buffer.putUint8(191);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is SecurityInfoState) {
|
} else if (value is TabContentState) {
|
||||||
buffer.putUint8(192);
|
buffer.putUint8(192);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is TabContentState) {
|
} else if (value is FindResultState) {
|
||||||
buffer.putUint8(193);
|
buffer.putUint8(193);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is FindResultState) {
|
} else if (value is CustomSelectionAction) {
|
||||||
buffer.putUint8(194);
|
buffer.putUint8(194);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is CustomSelectionAction) {
|
} else if (value is WebExtensionData) {
|
||||||
buffer.putUint8(195);
|
buffer.putUint8(195);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is WebExtensionData) {
|
} else if (value is GeckoSuggestion) {
|
||||||
buffer.putUint8(196);
|
buffer.putUint8(196);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is GeckoSuggestion) {
|
} else if (value is TabContent) {
|
||||||
buffer.putUint8(197);
|
buffer.putUint8(197);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is TabContent) {
|
} else if (value is ContentBlocking) {
|
||||||
buffer.putUint8(198);
|
buffer.putUint8(198);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ContentBlocking) {
|
} else if (value is DohSettings) {
|
||||||
buffer.putUint8(199);
|
buffer.putUint8(199);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is DohSettings) {
|
} else if (value is GeckoEngineSettings) {
|
||||||
buffer.putUint8(200);
|
buffer.putUint8(200);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is GeckoEngineSettings) {
|
} else if (value is AutocompleteResult) {
|
||||||
buffer.putUint8(201);
|
buffer.putUint8(201);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is AutocompleteResult) {
|
} else if (value is UnknownHitResult) {
|
||||||
buffer.putUint8(202);
|
buffer.putUint8(202);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is UnknownHitResult) {
|
} else if (value is ImageHitResult) {
|
||||||
buffer.putUint8(203);
|
buffer.putUint8(203);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ImageHitResult) {
|
} else if (value is VideoHitResult) {
|
||||||
buffer.putUint8(204);
|
buffer.putUint8(204);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is VideoHitResult) {
|
} else if (value is AudioHitResult) {
|
||||||
buffer.putUint8(205);
|
buffer.putUint8(205);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is AudioHitResult) {
|
} else if (value is ImageSrcHitResult) {
|
||||||
buffer.putUint8(206);
|
buffer.putUint8(206);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ImageSrcHitResult) {
|
} else if (value is PhoneHitResult) {
|
||||||
buffer.putUint8(207);
|
buffer.putUint8(207);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is PhoneHitResult) {
|
} else if (value is EmailHitResult) {
|
||||||
buffer.putUint8(208);
|
buffer.putUint8(208);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is EmailHitResult) {
|
} else if (value is GeoHitResult) {
|
||||||
buffer.putUint8(209);
|
buffer.putUint8(209);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is GeoHitResult) {
|
} else if (value is DownloadState) {
|
||||||
buffer.putUint8(210);
|
buffer.putUint8(210);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is DownloadState) {
|
} else if (value is ShareInternetResourceState) {
|
||||||
buffer.putUint8(211);
|
buffer.putUint8(211);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ShareInternetResourceState) {
|
} else if (value is AddonCollection) {
|
||||||
buffer.putUint8(212);
|
buffer.putUint8(212);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is AddonCollection) {
|
} else if (value is SyncEngineStatus) {
|
||||||
buffer.putUint8(213);
|
buffer.putUint8(213);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is SyncEngineStatus) {
|
} else if (value is SyncAccountInfo) {
|
||||||
buffer.putUint8(214);
|
buffer.putUint8(214);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is SyncAccountInfo) {
|
} else if (value is SyncDevice) {
|
||||||
buffer.putUint8(215);
|
buffer.putUint8(215);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is SyncDevice) {
|
} else if (value is SyncIncomingTab) {
|
||||||
buffer.putUint8(216);
|
buffer.putUint8(216);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is SyncIncomingTab) {
|
} else if (value is SyncRemoteTab) {
|
||||||
buffer.putUint8(217);
|
buffer.putUint8(217);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is SyncRemoteTab) {
|
} else if (value is SyncDeviceTabs) {
|
||||||
buffer.putUint8(218);
|
buffer.putUint8(218);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is SyncDeviceTabs) {
|
} else if (value is GeckoPref) {
|
||||||
buffer.putUint8(219);
|
buffer.putUint8(219);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is GeckoPref) {
|
} else if (value is MlProgressData) {
|
||||||
buffer.putUint8(220);
|
buffer.putUint8(220);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is MlProgressData) {
|
} else if (value is ContainerSiteAssignment) {
|
||||||
buffer.putUint8(221);
|
buffer.putUint8(221);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ContainerSiteAssignment) {
|
} else if (value is GeckoHeader) {
|
||||||
buffer.putUint8(222);
|
buffer.putUint8(222);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is GeckoHeader) {
|
} else if (value is GeckoFetchRequest) {
|
||||||
buffer.putUint8(223);
|
buffer.putUint8(223);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is GeckoFetchRequest) {
|
} else if (value is GeckoFetchResponse) {
|
||||||
buffer.putUint8(224);
|
buffer.putUint8(224);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is GeckoFetchResponse) {
|
} else if (value is BookmarkNode) {
|
||||||
buffer.putUint8(225);
|
buffer.putUint8(225);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is BookmarkNode) {
|
} else if (value is BookmarkInfo) {
|
||||||
buffer.putUint8(226);
|
buffer.putUint8(226);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is BookmarkInfo) {
|
} else if (value is SitePermissions) {
|
||||||
buffer.putUint8(227);
|
buffer.putUint8(227);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is SitePermissions) {
|
} else if (value is TrackingProtectionException) {
|
||||||
buffer.putUint8(228);
|
buffer.putUint8(228);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is TrackingProtectionException) {
|
} else if (value is PwaIcon) {
|
||||||
buffer.putUint8(229);
|
buffer.putUint8(229);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is PwaIcon) {
|
} else if (value is ShareTargetFiles) {
|
||||||
buffer.putUint8(230);
|
buffer.putUint8(230);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ShareTargetFiles) {
|
} else if (value is ShareTargetParams) {
|
||||||
buffer.putUint8(231);
|
buffer.putUint8(231);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ShareTargetParams) {
|
} else if (value is ShareTarget) {
|
||||||
buffer.putUint8(232);
|
buffer.putUint8(232);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ShareTarget) {
|
} else if (value is ExternalApplicationResource) {
|
||||||
buffer.putUint8(233);
|
buffer.putUint8(233);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else if (value is ExternalApplicationResource) {
|
|
||||||
buffer.putUint8(234);
|
|
||||||
writeValue(buffer, value.encode());
|
|
||||||
} else if (value is PwaManifest) {
|
} else if (value is PwaManifest) {
|
||||||
buffer.putUint8(235);
|
buffer.putUint8(234);
|
||||||
writeValue(buffer, value.encode());
|
writeValue(buffer, value.encode());
|
||||||
} else {
|
} else {
|
||||||
super.writeValue(buffer, value);
|
super.writeValue(buffer, value);
|
||||||
@@ -5503,120 +5451,118 @@ class _PigeonCodec extends StandardMessageCodec {
|
|||||||
case 177:
|
case 177:
|
||||||
return RecoverableTab.decode(readValue(buffer)!);
|
return RecoverableTab.decode(readValue(buffer)!);
|
||||||
case 178:
|
case 178:
|
||||||
return RecoverableBrowserState.decode(readValue(buffer)!);
|
|
||||||
case 179:
|
|
||||||
return IconRequest.decode(readValue(buffer)!);
|
return IconRequest.decode(readValue(buffer)!);
|
||||||
case 180:
|
case 179:
|
||||||
return ResourceSize.decode(readValue(buffer)!);
|
return ResourceSize.decode(readValue(buffer)!);
|
||||||
case 181:
|
case 180:
|
||||||
return Resource.decode(readValue(buffer)!);
|
return Resource.decode(readValue(buffer)!);
|
||||||
case 182:
|
case 181:
|
||||||
return IconResult.decode(readValue(buffer)!);
|
return IconResult.decode(readValue(buffer)!);
|
||||||
case 183:
|
case 182:
|
||||||
return CookiePartitionKey.decode(readValue(buffer)!);
|
return CookiePartitionKey.decode(readValue(buffer)!);
|
||||||
case 184:
|
case 183:
|
||||||
return Cookie.decode(readValue(buffer)!);
|
return Cookie.decode(readValue(buffer)!);
|
||||||
case 185:
|
case 184:
|
||||||
return VisitInfo.decode(readValue(buffer)!);
|
return VisitInfo.decode(readValue(buffer)!);
|
||||||
case 186:
|
case 185:
|
||||||
return HistoryHighlightWeights.decode(readValue(buffer)!);
|
return HistoryHighlightWeights.decode(readValue(buffer)!);
|
||||||
case 187:
|
case 186:
|
||||||
return HistoryHighlight.decode(readValue(buffer)!);
|
return HistoryHighlight.decode(readValue(buffer)!);
|
||||||
case 188:
|
case 187:
|
||||||
return TopFrecentSiteInfo.decode(readValue(buffer)!);
|
return TopFrecentSiteInfo.decode(readValue(buffer)!);
|
||||||
case 189:
|
case 188:
|
||||||
return HistoryItem.decode(readValue(buffer)!);
|
return HistoryItem.decode(readValue(buffer)!);
|
||||||
case 190:
|
case 189:
|
||||||
return HistoryState.decode(readValue(buffer)!);
|
return HistoryState.decode(readValue(buffer)!);
|
||||||
case 191:
|
case 190:
|
||||||
return ReaderableState.decode(readValue(buffer)!);
|
return ReaderableState.decode(readValue(buffer)!);
|
||||||
case 192:
|
case 191:
|
||||||
return SecurityInfoState.decode(readValue(buffer)!);
|
return SecurityInfoState.decode(readValue(buffer)!);
|
||||||
case 193:
|
case 192:
|
||||||
return TabContentState.decode(readValue(buffer)!);
|
return TabContentState.decode(readValue(buffer)!);
|
||||||
case 194:
|
case 193:
|
||||||
return FindResultState.decode(readValue(buffer)!);
|
return FindResultState.decode(readValue(buffer)!);
|
||||||
case 195:
|
case 194:
|
||||||
return CustomSelectionAction.decode(readValue(buffer)!);
|
return CustomSelectionAction.decode(readValue(buffer)!);
|
||||||
case 196:
|
case 195:
|
||||||
return WebExtensionData.decode(readValue(buffer)!);
|
return WebExtensionData.decode(readValue(buffer)!);
|
||||||
case 197:
|
case 196:
|
||||||
return GeckoSuggestion.decode(readValue(buffer)!);
|
return GeckoSuggestion.decode(readValue(buffer)!);
|
||||||
case 198:
|
case 197:
|
||||||
return TabContent.decode(readValue(buffer)!);
|
return TabContent.decode(readValue(buffer)!);
|
||||||
case 199:
|
case 198:
|
||||||
return ContentBlocking.decode(readValue(buffer)!);
|
return ContentBlocking.decode(readValue(buffer)!);
|
||||||
case 200:
|
case 199:
|
||||||
return DohSettings.decode(readValue(buffer)!);
|
return DohSettings.decode(readValue(buffer)!);
|
||||||
case 201:
|
case 200:
|
||||||
return GeckoEngineSettings.decode(readValue(buffer)!);
|
return GeckoEngineSettings.decode(readValue(buffer)!);
|
||||||
case 202:
|
case 201:
|
||||||
return AutocompleteResult.decode(readValue(buffer)!);
|
return AutocompleteResult.decode(readValue(buffer)!);
|
||||||
case 203:
|
case 202:
|
||||||
return UnknownHitResult.decode(readValue(buffer)!);
|
return UnknownHitResult.decode(readValue(buffer)!);
|
||||||
case 204:
|
case 203:
|
||||||
return ImageHitResult.decode(readValue(buffer)!);
|
return ImageHitResult.decode(readValue(buffer)!);
|
||||||
case 205:
|
case 204:
|
||||||
return VideoHitResult.decode(readValue(buffer)!);
|
return VideoHitResult.decode(readValue(buffer)!);
|
||||||
case 206:
|
case 205:
|
||||||
return AudioHitResult.decode(readValue(buffer)!);
|
return AudioHitResult.decode(readValue(buffer)!);
|
||||||
case 207:
|
case 206:
|
||||||
return ImageSrcHitResult.decode(readValue(buffer)!);
|
return ImageSrcHitResult.decode(readValue(buffer)!);
|
||||||
case 208:
|
case 207:
|
||||||
return PhoneHitResult.decode(readValue(buffer)!);
|
return PhoneHitResult.decode(readValue(buffer)!);
|
||||||
case 209:
|
case 208:
|
||||||
return EmailHitResult.decode(readValue(buffer)!);
|
return EmailHitResult.decode(readValue(buffer)!);
|
||||||
case 210:
|
case 209:
|
||||||
return GeoHitResult.decode(readValue(buffer)!);
|
return GeoHitResult.decode(readValue(buffer)!);
|
||||||
case 211:
|
case 210:
|
||||||
return DownloadState.decode(readValue(buffer)!);
|
return DownloadState.decode(readValue(buffer)!);
|
||||||
case 212:
|
case 211:
|
||||||
return ShareInternetResourceState.decode(readValue(buffer)!);
|
return ShareInternetResourceState.decode(readValue(buffer)!);
|
||||||
case 213:
|
case 212:
|
||||||
return AddonCollection.decode(readValue(buffer)!);
|
return AddonCollection.decode(readValue(buffer)!);
|
||||||
case 214:
|
case 213:
|
||||||
return SyncEngineStatus.decode(readValue(buffer)!);
|
return SyncEngineStatus.decode(readValue(buffer)!);
|
||||||
case 215:
|
case 214:
|
||||||
return SyncAccountInfo.decode(readValue(buffer)!);
|
return SyncAccountInfo.decode(readValue(buffer)!);
|
||||||
case 216:
|
case 215:
|
||||||
return SyncDevice.decode(readValue(buffer)!);
|
return SyncDevice.decode(readValue(buffer)!);
|
||||||
case 217:
|
case 216:
|
||||||
return SyncIncomingTab.decode(readValue(buffer)!);
|
return SyncIncomingTab.decode(readValue(buffer)!);
|
||||||
case 218:
|
case 217:
|
||||||
return SyncRemoteTab.decode(readValue(buffer)!);
|
return SyncRemoteTab.decode(readValue(buffer)!);
|
||||||
case 219:
|
case 218:
|
||||||
return SyncDeviceTabs.decode(readValue(buffer)!);
|
return SyncDeviceTabs.decode(readValue(buffer)!);
|
||||||
case 220:
|
case 219:
|
||||||
return GeckoPref.decode(readValue(buffer)!);
|
return GeckoPref.decode(readValue(buffer)!);
|
||||||
case 221:
|
case 220:
|
||||||
return MlProgressData.decode(readValue(buffer)!);
|
return MlProgressData.decode(readValue(buffer)!);
|
||||||
case 222:
|
case 221:
|
||||||
return ContainerSiteAssignment.decode(readValue(buffer)!);
|
return ContainerSiteAssignment.decode(readValue(buffer)!);
|
||||||
case 223:
|
case 222:
|
||||||
return GeckoHeader.decode(readValue(buffer)!);
|
return GeckoHeader.decode(readValue(buffer)!);
|
||||||
case 224:
|
case 223:
|
||||||
return GeckoFetchRequest.decode(readValue(buffer)!);
|
return GeckoFetchRequest.decode(readValue(buffer)!);
|
||||||
case 225:
|
case 224:
|
||||||
return GeckoFetchResponse.decode(readValue(buffer)!);
|
return GeckoFetchResponse.decode(readValue(buffer)!);
|
||||||
case 226:
|
case 225:
|
||||||
return BookmarkNode.decode(readValue(buffer)!);
|
return BookmarkNode.decode(readValue(buffer)!);
|
||||||
case 227:
|
case 226:
|
||||||
return BookmarkInfo.decode(readValue(buffer)!);
|
return BookmarkInfo.decode(readValue(buffer)!);
|
||||||
case 228:
|
case 227:
|
||||||
return SitePermissions.decode(readValue(buffer)!);
|
return SitePermissions.decode(readValue(buffer)!);
|
||||||
case 229:
|
case 228:
|
||||||
return TrackingProtectionException.decode(readValue(buffer)!);
|
return TrackingProtectionException.decode(readValue(buffer)!);
|
||||||
case 230:
|
case 229:
|
||||||
return PwaIcon.decode(readValue(buffer)!);
|
return PwaIcon.decode(readValue(buffer)!);
|
||||||
case 231:
|
case 230:
|
||||||
return ShareTargetFiles.decode(readValue(buffer)!);
|
return ShareTargetFiles.decode(readValue(buffer)!);
|
||||||
case 232:
|
case 231:
|
||||||
return ShareTargetParams.decode(readValue(buffer)!);
|
return ShareTargetParams.decode(readValue(buffer)!);
|
||||||
case 233:
|
case 232:
|
||||||
return ShareTarget.decode(readValue(buffer)!);
|
return ShareTarget.decode(readValue(buffer)!);
|
||||||
case 234:
|
case 233:
|
||||||
return ExternalApplicationResource.decode(readValue(buffer)!);
|
return ExternalApplicationResource.decode(readValue(buffer)!);
|
||||||
case 235:
|
case 234:
|
||||||
return PwaManifest.decode(readValue(buffer)!);
|
return PwaManifest.decode(readValue(buffer)!);
|
||||||
default:
|
default:
|
||||||
return super.readValueOfType(type, buffer);
|
return super.readValueOfType(type, buffer);
|
||||||
@@ -6033,14 +5979,14 @@ class GeckoSyncApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> sendTabToDevice(String deviceId, String title, String url) async {
|
Future<bool> sendTabToDevice(String deviceId, String title, String url, bool private) async {
|
||||||
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_mozilla_components.GeckoSyncApi.sendTabToDevice$pigeonVar_messageChannelSuffix';
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_mozilla_components.GeckoSyncApi.sendTabToDevice$pigeonVar_messageChannelSuffix';
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[deviceId, title, url]);
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[deviceId, title, url, private]);
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
if (pigeonVar_replyList == null) {
|
if (pigeonVar_replyList == null) {
|
||||||
throw _createConnectionError(pigeonVar_channelName);
|
throw _createConnectionError(pigeonVar_channelName);
|
||||||
@@ -7038,28 +6984,6 @@ class GeckoTabsApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> restoreTabsByBrowserState({required RecoverableBrowserState state, required RestoreLocation restoreLocation}) async {
|
|
||||||
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_mozilla_components.GeckoTabsApi.restoreTabsByBrowserState$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
|
||||||
pigeonVar_channelName,
|
|
||||||
pigeonChannelCodec,
|
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
|
||||||
);
|
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[state, restoreLocation]);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
|
||||||
if (pigeonVar_replyList == null) {
|
|
||||||
throw _createConnectionError(pigeonVar_channelName);
|
|
||||||
} else if (pigeonVar_replyList.length > 1) {
|
|
||||||
throw PlatformException(
|
|
||||||
code: pigeonVar_replyList[0]! as String,
|
|
||||||
message: pigeonVar_replyList[1] as String?,
|
|
||||||
details: pigeonVar_replyList[2],
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Selects an already existing tab with the matching [HistoryMetadataKey] or otherwise
|
/// Selects an already existing tab with the matching [HistoryMetadataKey] or otherwise
|
||||||
/// creates a new tab with the given [url].
|
/// creates a new tab with the given [url].
|
||||||
Future<String> selectOrAddTabByHistory({required String url, required HistoryMetadataKey historyMetadata}) async {
|
Future<String> selectOrAddTabByHistory({required String url, required HistoryMetadataKey historyMetadata}) async {
|
||||||
|
|||||||
@@ -314,17 +314,6 @@ class RecoverableTab {
|
|||||||
const RecoverableTab({this.engineSessionStateJson, required this.state});
|
const RecoverableTab({this.engineSessionStateJson, required this.state});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A restored browser state, read from disk.
|
|
||||||
class RecoverableBrowserState {
|
|
||||||
/// The list of restored tabs.
|
|
||||||
final List<RecoverableTab?> tabs;
|
|
||||||
|
|
||||||
/// The ID of the selected tab in [tabs]. Or `null` if no selection was restored.
|
|
||||||
final String? selectedTabId;
|
|
||||||
|
|
||||||
const RecoverableBrowserState({required this.tabs, this.selectedTabId});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Indicates what location the tabs should be restored at
|
/// Indicates what location the tabs should be restored at
|
||||||
enum RestoreLocation {
|
enum RestoreLocation {
|
||||||
/// Restore tabs at the beginning of the tab list
|
/// Restore tabs at the beginning of the tab list
|
||||||
@@ -1266,7 +1255,7 @@ abstract class GeckoSyncApi {
|
|||||||
List<SyncDevice> getDevices();
|
List<SyncDevice> getDevices();
|
||||||
|
|
||||||
@async
|
@async
|
||||||
bool sendTabToDevice(String deviceId, String title, String url);
|
bool sendTabToDevice(String deviceId, String title, String url, bool private);
|
||||||
|
|
||||||
@async
|
@async
|
||||||
void refreshDevices();
|
void refreshDevices();
|
||||||
@@ -1447,10 +1436,6 @@ abstract class GeckoTabsApi {
|
|||||||
required String? selectTabId,
|
required String? selectTabId,
|
||||||
required RestoreLocation restoreLocation,
|
required RestoreLocation restoreLocation,
|
||||||
});
|
});
|
||||||
void restoreTabsByBrowserState({
|
|
||||||
required RecoverableBrowserState state,
|
|
||||||
required RestoreLocation restoreLocation,
|
|
||||||
});
|
|
||||||
//The calls with engin storage for restore are not supported at the moment
|
//The calls with engin storage for restore are not supported at the moment
|
||||||
|
|
||||||
//selectOrAddTab invokes splitted
|
//selectOrAddTab invokes splitted
|
||||||
@@ -2486,5 +2471,10 @@ abstract class GeckoPwaApi {
|
|||||||
/// The [overrideShortcutName] allows customizing the shortcut label.
|
/// The [overrideShortcutName] allows customizing the shortcut label.
|
||||||
/// Returns true if the shortcut was created successfully.
|
/// Returns true if the shortcut was created successfully.
|
||||||
@async
|
@async
|
||||||
bool installBasicShortcut(String? tabId, String profileUuid, String? contextId, String? overrideShortcutName);
|
bool installBasicShortcut(
|
||||||
|
String? tabId,
|
||||||
|
String profileUuid,
|
||||||
|
String? contextId,
|
||||||
|
String? overrideShortcutName,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user