2019-08-23 12:54:03 +02:00
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
package org.mozilla.fenix.share
|
|
|
|
|
|
|
|
import mozilla.components.concept.sync.Device
|
2019-11-06 02:30:04 +01:00
|
|
|
import org.mozilla.fenix.share.listadapters.AppShareOption
|
2019-08-23 12:54:03 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interactor for the share screen.
|
|
|
|
*/
|
2019-08-28 10:20:32 +02:00
|
|
|
class ShareInteractor(
|
|
|
|
private val controller: ShareController
|
|
|
|
) : ShareCloseInteractor, ShareToAccountDevicesInteractor, ShareToAppsInteractor {
|
2019-09-05 20:13:03 +02:00
|
|
|
override fun onReauth() {
|
|
|
|
controller.handleReauth()
|
|
|
|
}
|
|
|
|
|
2019-08-23 12:54:03 +02:00
|
|
|
override fun onShareClosed() {
|
2019-08-28 10:20:32 +02:00
|
|
|
controller.handleShareClosed()
|
2019-08-23 12:54:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
override fun onSignIn() {
|
2019-08-28 10:20:32 +02:00
|
|
|
controller.handleSignIn()
|
2019-08-23 12:54:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
override fun onAddNewDevice() {
|
2019-08-28 10:20:32 +02:00
|
|
|
controller.handleAddNewDevice()
|
2019-08-23 12:54:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
override fun onShareToDevice(device: Device) {
|
2019-08-28 10:20:32 +02:00
|
|
|
controller.handleShareToDevice(device)
|
2019-08-23 12:54:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
override fun onShareToAllDevices(devices: List<Device>) {
|
2019-08-28 10:20:32 +02:00
|
|
|
controller.handleShareToAllDevices(devices)
|
2019-08-23 12:54:03 +02:00
|
|
|
}
|
|
|
|
|
2019-11-06 02:30:04 +01:00
|
|
|
override fun onShareToApp(appToShareTo: AppShareOption) {
|
2019-08-28 10:20:32 +02:00
|
|
|
controller.handleShareToApp(appToShareTo)
|
2019-08-23 12:54:03 +02:00
|
|
|
}
|
|
|
|
}
|