This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added setting to disable autocomplete (#3551)
Do not get search suggestions in private mode! Completion fixes
- Loading branch information
Showing
9 changed files
with
73 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
...ch/suggestions/SearchSuggestionsCLient.kt → ...ch/suggestions/SearchSuggestionsClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
package org.mozilla.vrbrowser.search.suggestions | ||
|
||
import android.content.Context | ||
import kotlinx.coroutines.GlobalScope | ||
import kotlinx.coroutines.future.future | ||
import mozilla.components.browser.search.suggestions.SearchSuggestionClient | ||
import mozilla.components.concept.fetch.Request | ||
import org.mozilla.vrbrowser.browser.engine.EngineProvider | ||
import java.nio.charset.StandardCharsets | ||
import java.util.concurrent.CompletableFuture | ||
|
||
fun getSuggestionsAsync(client: SearchSuggestionClient, query: String): CompletableFuture<List<String>?> = | ||
GlobalScope.future { | ||
client.getSuggestions(query) | ||
} | ||
} | ||
|
||
fun fetchSearchSuggestions(context: Context, searchUrl: String): String? { | ||
val request = Request(searchUrl); | ||
return EngineProvider.getDefaultClient(context).fetch(request).body.string(StandardCharsets.UTF_8) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters