morgan pushed to branch tor-browser-128.4.0esr-14.5-1 at The Tor Project / Applications / Tor Browser
Commits: 5e9deb42 by cypherpunks1 at 2024-10-30T03:09:46+00:00 fixup! [android] Modify UI/UX
Bug 43251: Enable tab suggestions and autocomplete for private tabs on Android
- - - - -
3 changed files:
- mobile/android/android-components/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/SessionAutocompleteProvider.kt - mobile/android/android-components/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/SessionSuggestionProvider.kt - mobile/android/fenix/app/src/main/java/org/mozilla/fenix/search/awesomebar/AwesomeBarView.kt
Changes:
===================================== mobile/android/android-components/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/SessionAutocompleteProvider.kt ===================================== @@ -36,7 +36,7 @@ class SessionAutocompleteProvider(
val tabUrl = store.state.tabs .firstOrNull { - !it.content.private && doesUrlStartsWithText(it.content.url, query) + /* !it.content.private && */ doesUrlStartsWithText(it.content.url, query) } ?.content?.url ?: return null
===================================== mobile/android/android-components/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/SessionSuggestionProvider.kt ===================================== @@ -54,7 +54,7 @@ class SessionSuggestionProvider(
val suggestions = mutableListOf<AwesomeBar.Suggestion>() val iconRequests: List<Deferred<Icon>?> = distinctTabs.map { - icons?.loadIcon(IconRequest(url = it.content.url, waitOnNetworkLoad = false)) + icons?.loadIcon(IconRequest(url = it.content.url, isPrivate = it.content.private, waitOnNetworkLoad = false)) }
val searchWords = searchText.split(" ") @@ -62,7 +62,7 @@ class SessionSuggestionProvider( if ( resultsUriFilter?.invoke(result.content.url.toUri()) != false && searchWords.all { result.contains(it) } && - !result.content.private && +// !result.content.private && shouldIncludeSelectedTab(state, result) ) { suggestions.add(
===================================== mobile/android/fenix/app/src/main/java/org/mozilla/fenix/search/awesomebar/AwesomeBarView.kt ===================================== @@ -328,12 +328,12 @@ class AwesomeBarView( } }
- if (activity.browsingModeManager.mode == BrowsingMode.Normal && state.showAllSessionSuggestions) { + if (/* activity.browsingModeManager.mode == BrowsingMode.Normal && */ state.showAllSessionSuggestions) { // Unlike other providers, we don't exclude sponsored suggestions for open tabs. providersToAdd.add(getLocalTabsProvider()) }
- if (activity.browsingModeManager.mode == BrowsingMode.Normal && state.showSessionSuggestionsForCurrentEngine) { + if (/* activity.browsingModeManager.mode == BrowsingMode.Normal && */ state.showSessionSuggestionsForCurrentEngine) { getFilterForCurrentEngineResults(state)?.let { providersToAdd.add(getLocalTabsProvider(it)) }
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/5e9deb42...
tbb-commits@lists.torproject.org