1
0
Fork 0

For #6126 - moved the sessionObserver init to the onCreate

This helps because we will always need the observer to be initiated, not only when the `openToBrowser` method gets called. Example: Opening a tab from the tab tray had it's own method for opening the browser, causing this to not be called.
master
Mihai Branescu 2020-06-12 18:55:22 +03:00
parent 7e6116512c
commit 4f870e9251
1 changed files with 3 additions and 6 deletions

View File

@ -101,13 +101,12 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
private var webExtScope: CoroutineScope? = null
lateinit var themeManager: ThemeManager
lateinit var browsingModeManager: BrowsingModeManager
private lateinit var sessionObserver: SessionManager.Observer
private var isVisuallyComplete = false
private var visualCompletenessQueue: RunWhenReadyQueue? = null
private var sessionObserver: SessionManager.Observer? = null
private var isToolbarInflated = false
private val webExtensionPopupFeature by lazy {
@ -152,6 +151,8 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
}
}
sessionObserver = UriOpenedObserver(this)
externalSourceIntentProcessors.any { it.process(intent, navHost.navController, this.intent) }
Performance.processIntentIfPerformanceTest(intent, this)
@ -351,10 +352,6 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
}
fun openToBrowser(from: BrowserDirection, customTabSessionId: String? = null) {
if (sessionObserver == null) {
sessionObserver = UriOpenedObserver(this)
}
if (navHost.navController.alreadyOnDestination(R.id.browserFragment)) return
@IdRes val fragmentId = if (from.fragmentId != 0) from.fragmentId else null
val directions = getNavDirections(from, customTabSessionId)