mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
Bug 1818774 - Navigate to search dialog when interacting with homescreen private browsing button
This commit is contained in:
parent
2af1b953e3
commit
21f59548a5
@ -41,6 +41,7 @@ import org.mozilla.fenix.GleanMetrics.TopSites
|
||||
import org.mozilla.fenix.HomeActivity
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.browser.BrowserAnimator
|
||||
import org.mozilla.fenix.browser.BrowserFragmentDirections
|
||||
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
|
||||
import org.mozilla.fenix.collections.SaveCollectionStep
|
||||
import org.mozilla.fenix.components.AppStore
|
||||
@ -627,6 +628,14 @@ class DefaultSessionControlController(
|
||||
appStore.dispatch(
|
||||
AppAction.ModeChange(Mode.fromBrowsingMode(newMode)),
|
||||
)
|
||||
|
||||
if (navController.currentDestination?.id == R.id.searchDialogFragment) {
|
||||
navController.navigate(
|
||||
BrowserFragmentDirections.actionGlobalSearchDialog(
|
||||
sessionId = null,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@ import org.mozilla.fenix.GleanMetrics.RecentTabs
|
||||
import org.mozilla.fenix.GleanMetrics.TopSites
|
||||
import org.mozilla.fenix.HomeActivity
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.browser.BrowserFragmentDirections
|
||||
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
|
||||
import org.mozilla.fenix.components.Analytics
|
||||
import org.mozilla.fenix.components.AppStore
|
||||
@ -1099,6 +1100,11 @@ class DefaultSessionControlControllerTest {
|
||||
verify {
|
||||
settings.incrementNumTimesPrivateModeOpened()
|
||||
AppAction.ModeChange(Mode.fromBrowsingMode(newMode))
|
||||
navController.navigate(
|
||||
BrowserFragmentDirections.actionGlobalSearchDialog(
|
||||
sessionId = null,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1129,6 +1135,11 @@ class DefaultSessionControlControllerTest {
|
||||
appStore.dispatch(
|
||||
AppAction.ModeChange(Mode.fromBrowsingMode(newMode)),
|
||||
)
|
||||
navController.navigate(
|
||||
BrowserFragmentDirections.actionGlobalSearchDialog(
|
||||
sessionId = null,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user