[fenix] For https://github.com/mozilla-mobile/fenix/issues/4155: Sets pastedText default value

pull/600/head
Sawyer Blatz 5 years ago
parent 603740cde0
commit 7bee891913

@ -57,8 +57,7 @@ class DefaultBrowserToolbarController(
navController.nav( navController.nav(
R.id.browserFragment, R.id.browserFragment,
BrowserFragmentDirections.actionBrowserFragmentToSearchFragment( BrowserFragmentDirections.actionBrowserFragmentToSearchFragment(
sessionId = customTabSession?.id ?: context.components.core.sessionManager.selectedSession?.id, sessionId = customTabSession?.id ?: context.components.core.sessionManager.selectedSession?.id
pastedText = text
) )
) )
} }
@ -75,8 +74,7 @@ class DefaultBrowserToolbarController(
navController.nav( navController.nav(
R.id.browserFragment, R.id.browserFragment,
BrowserFragmentDirections.actionBrowserFragmentToSearchFragment( BrowserFragmentDirections.actionBrowserFragmentToSearchFragment(
customTabSession?.id ?: context.components.core.sessionManager.selectedSession?.id, customTabSession?.id ?: context.components.core.sessionManager.selectedSession?.id
pastedText = null
) )
) )
} }
@ -120,16 +118,14 @@ class DefaultBrowserToolbarController(
} }
ToolbarMenu.Item.NewTab -> { ToolbarMenu.Item.NewTab -> {
val directions = BrowserFragmentDirections.actionBrowserFragmentToSearchFragment( val directions = BrowserFragmentDirections.actionBrowserFragmentToSearchFragment(
sessionId = null, sessionId = null
pastedText = null
) )
navController.nav(R.id.browserFragment, directions) navController.nav(R.id.browserFragment, directions)
browsingModeManager.mode = BrowsingMode.Normal browsingModeManager.mode = BrowsingMode.Normal
} }
ToolbarMenu.Item.NewPrivateTab -> { ToolbarMenu.Item.NewPrivateTab -> {
val directions = BrowserFragmentDirections.actionBrowserFragmentToSearchFragment( val directions = BrowserFragmentDirections.actionBrowserFragmentToSearchFragment(
sessionId = null, sessionId = null
pastedText = null
) )
navController.nav(R.id.browserFragment, directions) navController.nav(R.id.browserFragment, directions)
browsingModeManager.mode = BrowsingMode.Private browsingModeManager.mode = BrowsingMode.Private

@ -235,8 +235,7 @@ class HomeFragment : Fragment(), AccountObserver {
onboarding.finish() onboarding.finish()
val directions = HomeFragmentDirections.actionHomeFragmentToSearchFragment( val directions = HomeFragmentDirections.actionHomeFragmentToSearchFragment(
sessionId = null, sessionId = null,
showShortcutEnginePicker = true, showShortcutEnginePicker = true
pastedText = null
) )
val extras = val extras =
FragmentNavigator.Extras.Builder() FragmentNavigator.Extras.Builder()
@ -390,8 +389,7 @@ class HomeFragment : Fragment(), AccountObserver {
invokePendingDeleteJobs() invokePendingDeleteJobs()
val directions = HomeFragmentDirections.actionHomeFragmentToSearchFragment( val directions = HomeFragmentDirections.actionHomeFragmentToSearchFragment(
sessionId = null, sessionId = null,
showShortcutEnginePicker = true, showShortcutEnginePicker = true
pastedText = null
) )
nav(R.id.homeFragment, directions) nav(R.id.homeFragment, directions)
} }

@ -26,8 +26,7 @@ class StartSearchIntentProcessor(
val directions = NavGraphDirections.actionGlobalSearch( val directions = NavGraphDirections.actionGlobalSearch(
sessionId = null, sessionId = null,
showShortcutEnginePicker = true, showShortcutEnginePicker = true
pastedText = null
) )
navController.nav(null, directions) navController.nav(null, directions)
true true

@ -108,6 +108,7 @@
app:popUpTo="@+id/searchFragment" /> app:popUpTo="@+id/searchFragment" />
<argument <argument
android:name="pastedText" android:name="pastedText"
android:defaultValue="@null"
app:argType="string" app:argType="string"
app:nullable="true"/> app:nullable="true"/>
</fragment> </fragment>

@ -422,7 +422,6 @@
<!-- Content Description for session item share button --> <!-- Content Description for session item share button -->
<string name="content_description_session_share">Share session</string> <string name="content_description_session_share">Share session</string>
<string name="paste">Paste</string>
<!-- Bookmarks --> <!-- Bookmarks -->
<!-- Content description for bookmarks library menu --> <!-- Content description for bookmarks library menu -->
<string name="bookmark_menu_content_description">Bookmark menu</string> <string name="bookmark_menu_content_description">Bookmark menu</string>

@ -128,8 +128,7 @@ class DefaultBrowserToolbarControllerTest {
navController.nav( navController.nav(
R.id.browserFragment, R.id.browserFragment,
BrowserFragmentDirections.actionBrowserFragmentToSearchFragment( BrowserFragmentDirections.actionBrowserFragmentToSearchFragment(
sessionId = "1", sessionId = "1"
pastedText = null
) )
) )
} }
@ -276,7 +275,7 @@ class DefaultBrowserToolbarControllerTest {
verify { metrics.track(Event.BrowserMenuItemTapped(Event.BrowserMenuItemTapped.Item.NEW_PRIVATE_TAB)) } verify { metrics.track(Event.BrowserMenuItemTapped(Event.BrowserMenuItemTapped.Item.NEW_PRIVATE_TAB)) }
verify { verify {
val directions = BrowserFragmentDirections val directions = BrowserFragmentDirections
.actionBrowserFragmentToSearchFragment(sessionId = null, pastedText = null) .actionBrowserFragmentToSearchFragment(sessionId = null)
navController.nav(R.id.browserFragment, directions) navController.nav(R.id.browserFragment, directions)
} }
verify { browsingModeManager.mode = BrowsingMode.Private } verify { browsingModeManager.mode = BrowsingMode.Private }
@ -343,7 +342,7 @@ class DefaultBrowserToolbarControllerTest {
verify { metrics.track(Event.BrowserMenuItemTapped(Event.BrowserMenuItemTapped.Item.NEW_TAB)) } verify { metrics.track(Event.BrowserMenuItemTapped(Event.BrowserMenuItemTapped.Item.NEW_TAB)) }
verify { verify {
val directions = BrowserFragmentDirections val directions = BrowserFragmentDirections
.actionBrowserFragmentToSearchFragment(sessionId = null, pastedText = null) .actionBrowserFragmentToSearchFragment(sessionId = null)
navController.nav(R.id.browserFragment, directions) navController.nav(R.id.browserFragment, directions)
} }
verify { browsingModeManager.mode = BrowsingMode.Normal } verify { browsingModeManager.mode = BrowsingMode.Normal }
@ -370,7 +369,7 @@ class DefaultBrowserToolbarControllerTest {
verify { viewModel.previousFragmentId = R.id.browserFragment } verify { viewModel.previousFragmentId = R.id.browserFragment }
verify { verify {
val directions = BrowserFragmentDirections val directions = BrowserFragmentDirections
.actionBrowserFragmentToSearchFragment(sessionId = null, pastedText = null) .actionBrowserFragmentToSearchFragment(sessionId = null)
navController.nav(R.id.browserFragment, directions) navController.nav(R.id.browserFragment, directions)
} }
} }

@ -67,8 +67,7 @@ class StartSearchIntentProcessorTest {
navController.navigate( navController.navigate(
NavGraphDirections.actionGlobalSearch( NavGraphDirections.actionGlobalSearch(
sessionId = null, sessionId = null,
showShortcutEnginePicker = true, showShortcutEnginePicker = true
pastedText = null
) )
) )
} }

Loading…
Cancel
Save