From d162e11f5827659faf946ee0adae09862080d707 Mon Sep 17 00:00:00 2001 From: Emily Kager Date: Tue, 23 Apr 2019 13:12:05 -0700 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/1922 - Open bookmark in new tab menu should open and show new tab --- .../fenix/library/bookmarks/BookmarkFragment.kt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt index cf2d0e40f6..ce484f94d8 100644 --- a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt @@ -184,15 +184,23 @@ class BookmarkFragment : Fragment(), CoroutineScope, BackHandler, AccountObserve } is BookmarkAction.OpenInNewTab -> { it.item.url?.let { url -> - requireComponents.useCases.tabsUseCases.addTab.invoke(url) - (activity as HomeActivity).browsingModeManager.mode = BrowsingModeManager.Mode.Normal + (activity as HomeActivity).browsingModeManager.mode = + BrowsingModeManager.Mode.Normal + (activity as HomeActivity).openToBrowserAndLoad( + text = url, + from = BrowserDirection.FromBookmarks + ) requireComponents.analytics.metrics.track(Event.OpenedBookmarkInNewTab) } } is BookmarkAction.OpenInPrivateTab -> { it.item.url?.let { url -> - requireComponents.useCases.tabsUseCases.addPrivateTab.invoke(url) - (activity as HomeActivity).browsingModeManager.mode = BrowsingModeManager.Mode.Private + (activity as HomeActivity).browsingModeManager.mode = + BrowsingModeManager.Mode.Private + (activity as HomeActivity).openToBrowserAndLoad( + text = url, + from = BrowserDirection.FromBookmarks + ) requireComponents.analytics.metrics.track(Event.OpenedBookmarkInPrivateTab) } }