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
parent
7e6116512c
commit
4f870e9251
|
@ -101,13 +101,12 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
|
||||||
private var webExtScope: CoroutineScope? = null
|
private var webExtScope: CoroutineScope? = null
|
||||||
lateinit var themeManager: ThemeManager
|
lateinit var themeManager: ThemeManager
|
||||||
lateinit var browsingModeManager: BrowsingModeManager
|
lateinit var browsingModeManager: BrowsingModeManager
|
||||||
|
private lateinit var sessionObserver: SessionManager.Observer
|
||||||
|
|
||||||
private var isVisuallyComplete = false
|
private var isVisuallyComplete = false
|
||||||
|
|
||||||
private var visualCompletenessQueue: RunWhenReadyQueue? = null
|
private var visualCompletenessQueue: RunWhenReadyQueue? = null
|
||||||
|
|
||||||
private var sessionObserver: SessionManager.Observer? = null
|
|
||||||
|
|
||||||
private var isToolbarInflated = false
|
private var isToolbarInflated = false
|
||||||
|
|
||||||
private val webExtensionPopupFeature by lazy {
|
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) }
|
externalSourceIntentProcessors.any { it.process(intent, navHost.navController, this.intent) }
|
||||||
|
|
||||||
Performance.processIntentIfPerformanceTest(intent, this)
|
Performance.processIntentIfPerformanceTest(intent, this)
|
||||||
|
@ -351,10 +352,6 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun openToBrowser(from: BrowserDirection, customTabSessionId: String? = null) {
|
fun openToBrowser(from: BrowserDirection, customTabSessionId: String? = null) {
|
||||||
if (sessionObserver == null) {
|
|
||||||
sessionObserver = UriOpenedObserver(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (navHost.navController.alreadyOnDestination(R.id.browserFragment)) return
|
if (navHost.navController.alreadyOnDestination(R.id.browserFragment)) return
|
||||||
@IdRes val fragmentId = if (from.fragmentId != 0) from.fragmentId else null
|
@IdRes val fragmentId = if (from.fragmentId != 0) from.fragmentId else null
|
||||||
val directions = getNavDirections(from, customTabSessionId)
|
val directions = getNavDirections(from, customTabSessionId)
|
||||||
|
|
Loading…
Reference in New Issue