Skip to content

Commit

Permalink
For mozilla-mobile#10467 - blue dot doesn't disappear on menu dismiss
Browse files Browse the repository at this point in the history
  • Loading branch information
BranescuMihai authored and ekager committed Jun 25, 2020
1 parent 42098d9 commit 830f653
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ open class BrowserInteractor(
browserToolbarController.handleToolbarItemInteraction(item)
}

override fun onBrowserMenuDismissed(lowPrioHighlightItems: List<ToolbarMenu.Item>) {
browserToolbarController.handleBrowserMenuDismissed(lowPrioHighlightItems)
}

override fun onScrolled(offset: Int) {
browserToolbarController.handleScroll(offset)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ interface BrowserToolbarController {
fun handleToolbarClick()
fun handleTabCounterClick()
fun handleTabCounterItemInteraction(item: TabCounterMenuItem)
fun handleBrowserMenuDismissed(lowPrioHighlightItems: List<ToolbarMenu.Item>)
fun handleReaderModePressed(enabled: Boolean)
}

Expand Down Expand Up @@ -158,16 +157,6 @@ class DefaultBrowserToolbarController(
}
}

override fun handleBrowserMenuDismissed(lowPrioHighlightItems: List<ToolbarMenu.Item>) {
val settings = activity.settings()
lowPrioHighlightItems.forEach {
when (it) {
ToolbarMenu.Item.AddToHomeScreen -> settings.installPwaOpened = true
ToolbarMenu.Item.OpenInApp -> settings.openInAppOpened = true
}
}
}

override fun handleScroll(offset: Int) {
engineView.setVerticalClipping(offset)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ interface BrowserToolbarViewInteractor {
fun onBrowserToolbarMenuItemTapped(item: ToolbarMenu.Item)
fun onTabCounterClicked()
fun onTabCounterMenuItemTapped(item: TabCounterMenuItem)
fun onBrowserMenuDismissed(lowPrioHighlightItems: List<ToolbarMenu.Item>)
fun onScrolled(offset: Int)
fun onReaderModePressed(enabled: Boolean)
}
Expand Down Expand Up @@ -229,7 +228,6 @@ class BrowserToolbarView(
bookmarksStorage = bookmarkStorage
)
view.display.setMenuDismissAction {
interactor.onBrowserMenuDismissed(menuToolbar.getLowPrioHighlightItems())
view.invalidateActions()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,6 @@ class DefaultToolbarMenu(
BrowserMenuItemToolbar(listOf(bookmark, share, forward, refresh))
}

internal fun getLowPrioHighlightItems(): List<ToolbarMenu.Item> {
val lowPrioHighlightItems: MutableList<ToolbarMenu.Item> = mutableListOf()
if (canInstall() && installToHomescreen.isHighlighted()) {
lowPrioHighlightItems.add(ToolbarMenu.Item.InstallToHomeScreen)
}
if (shouldShowOpenInApp() && openInApp.isHighlighted()) {
lowPrioHighlightItems.add(ToolbarMenu.Item.OpenInApp)
}
return lowPrioHighlightItems
}

// Predicates that need to be repeatedly called as the session changes
private fun canAddToHomescreen(): Boolean =
session != null && context.components.useCases.webAppUseCases.isPinningSupported() &&
Expand Down

0 comments on commit 830f653

Please sign in to comment.