2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] Update Android Components to 51.0.20200717190031

This commit is contained in:
Christian Sadilek 2020-07-16 16:34:50 -04:00
parent e740819acd
commit 250c95eb28
6 changed files with 10 additions and 8 deletions

View File

@ -33,8 +33,8 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import mozilla.components.browser.search.SearchEngine import mozilla.components.browser.search.SearchEngine
import mozilla.components.browser.session.Session
import mozilla.components.browser.session.SessionManager import mozilla.components.browser.session.SessionManager
import mozilla.components.browser.state.state.SessionState
import mozilla.components.browser.state.state.WebExtensionState import mozilla.components.browser.state.state.WebExtensionState
import mozilla.components.browser.state.store.BrowserStore import mozilla.components.browser.state.store.BrowserStore
import mozilla.components.browser.tabstray.BrowserTabsTray import mozilla.components.browser.tabstray.BrowserTabsTray
@ -545,7 +545,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
components.useCases.searchUseCases.newTabSearch components.useCases.searchUseCases.newTabSearch
.invoke( .invoke(
searchTerms, searchTerms,
Session.Source.USER_ENTERED, SessionState.Source.USER_ENTERED,
true, true,
mode.isPrivate, mode.isPrivate,
searchEngine = engine searchEngine = engine

View File

@ -808,7 +808,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
protected open fun removeSessionIfNeeded(): Boolean { protected open fun removeSessionIfNeeded(): Boolean {
getSessionById()?.let { session -> getSessionById()?.let { session ->
val sessionManager = requireComponents.core.sessionManager val sessionManager = requireComponents.core.sessionManager
return if (session.source == Session.Source.ACTION_VIEW) { return if (session.source == SessionState.Source.ACTION_VIEW) {
activity?.finish() activity?.finish()
sessionManager.remove(session) sessionManager.remove(session)
true true

View File

@ -11,9 +11,9 @@ import androidx.annotation.VisibleForTesting
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import mozilla.components.browser.session.Session import mozilla.components.browser.session.Session
import mozilla.components.browser.session.Session.Source
import mozilla.components.browser.session.SessionManager import mozilla.components.browser.session.SessionManager
import mozilla.components.browser.state.state.CustomTabConfig import mozilla.components.browser.state.state.CustomTabConfig
import mozilla.components.browser.state.state.SessionState
import mozilla.components.concept.engine.EngineSession import mozilla.components.concept.engine.EngineSession
import mozilla.components.concept.engine.manifest.WebAppManifest import mozilla.components.concept.engine.manifest.WebAppManifest
import mozilla.components.concept.engine.manifest.WebAppManifestParser import mozilla.components.concept.engine.manifest.WebAppManifestParser
@ -60,7 +60,7 @@ class FennecWebAppIntentProcessor(
return if (!url.isNullOrEmpty() && matches(intent)) { return if (!url.isNullOrEmpty() && matches(intent)) {
val webAppManifest = runBlocking { loadManifest(safeIntent, url) } val webAppManifest = runBlocking { loadManifest(safeIntent, url) }
val session = Session(url, private = false, source = Source.HOME_SCREEN) val session = Session(url, private = false, source = SessionState.Source.HOME_SCREEN)
session.webAppManifest = webAppManifest session.webAppManifest = webAppManifest
session.customTabConfig = session.customTabConfig =
webAppManifest?.toCustomTabConfig() ?: createFallbackCustomTabConfig() webAppManifest?.toCustomTabConfig() ?: createFallbackCustomTabConfig()

View File

@ -9,6 +9,7 @@ import android.content.Intent.ACTION_VIEW
import androidx.annotation.VisibleForTesting import androidx.annotation.VisibleForTesting
import mozilla.components.browser.session.Session import mozilla.components.browser.session.Session
import mozilla.components.browser.session.SessionManager import mozilla.components.browser.session.SessionManager
import mozilla.components.browser.state.state.SessionState
import mozilla.components.concept.engine.EngineSession import mozilla.components.concept.engine.EngineSession
import mozilla.components.feature.intent.ext.putSessionId import mozilla.components.feature.intent.ext.putSessionId
import mozilla.components.feature.intent.processing.IntentProcessor import mozilla.components.feature.intent.processing.IntentProcessor
@ -40,7 +41,7 @@ class FennecBookmarkShortcutsIntentProcessor(
val url = safeIntent.dataString val url = safeIntent.dataString
return if (!url.isNullOrEmpty() && matches(intent)) { return if (!url.isNullOrEmpty() && matches(intent)) {
val session = Session(url, private = false, source = Session.Source.HOME_SCREEN) val session = Session(url, private = false, source = SessionState.Source.HOME_SCREEN)
sessionManager.add(session, selected = true) sessionManager.add(session, selected = true)
loadUrlUseCase(url, session, EngineSession.LoadUrlFlags.external()) loadUrlUseCase(url, session, EngineSession.LoadUrlFlags.external())

View File

@ -15,6 +15,7 @@ import io.mockk.verifyAll
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import mozilla.components.browser.session.Session import mozilla.components.browser.session.Session
import mozilla.components.browser.session.SessionManager import mozilla.components.browser.session.SessionManager
import mozilla.components.browser.state.state.SessionState
import mozilla.components.concept.engine.EngineSession import mozilla.components.concept.engine.EngineSession
import mozilla.components.feature.intent.ext.getSessionId import mozilla.components.feature.intent.ext.getSessionId
import mozilla.components.feature.session.SessionUseCases import mozilla.components.feature.session.SessionUseCases
@ -56,7 +57,7 @@ class FennecBookmarkShortcutsIntentProcessorTest {
val fennecShortcutsIntent = Intent(ACTION_FENNEC_HOMESCREEN_SHORTCUT) val fennecShortcutsIntent = Intent(ACTION_FENNEC_HOMESCREEN_SHORTCUT)
val testUrl = "http://mozilla.org" val testUrl = "http://mozilla.org"
fennecShortcutsIntent.data = Uri.parse(testUrl) fennecShortcutsIntent.data = Uri.parse(testUrl)
val expectedSession = Session(testUrl, private = false, source = Session.Source.HOME_SCREEN) val expectedSession = Session(testUrl, private = false, source = SessionState.Source.HOME_SCREEN)
val wasIntentProcessed = processor.process(fennecShortcutsIntent) val wasIntentProcessed = processor.process(fennecShortcutsIntent)

View File

@ -3,5 +3,5 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
object AndroidComponents { object AndroidComponents {
const val VERSION = "51.0.20200717130954" const val VERSION = "51.0.20200717190031"
} }