Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Do not show login save/select if autofill is disabled (#3848)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored Aug 20, 2020
1 parent 5b4597a commit f2e4a1c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public GeckoResult<PromptResponse> onLoginSave(@NonNull GeckoSession geckoSessio
final GeckoResult<PromptResponse> result = new GeckoResult<>();

// We always get at least one item, at the moment only one item is support.
if (autocompleteRequest.options.length > 0) {
if (autocompleteRequest.options.length > 0 && SettingsStore.getInstance(mContext).isAutoFillEnabled()) {
Autocomplete.LoginSaveOption saveOption = autocompleteRequest.options[0];
boolean originHasException = mSavedLoginBlockedSites.stream().anyMatch(site -> site.url.equals(saveOption.value.origin));
if (originHasException || !SettingsStore.getInstance(mContext).isLoginAutocompleteEnabled()) {
Expand Down Expand Up @@ -335,7 +335,7 @@ public void confirm(@NonNull Login login) {
public GeckoResult<PromptResponse> onLoginSelect(@NonNull GeckoSession geckoSession, final @NonNull AutocompleteRequest<Autocomplete.LoginSelectOption> autocompleteRequest) {
final GeckoResult<PromptResponse> result = new GeckoResult<>();

if (autocompleteRequest.options.length > 1) {
if (autocompleteRequest.options.length > 1 && SettingsStore.getInstance(mContext).isAutoFillEnabled()) {
List<Login> logins = Arrays.stream(autocompleteRequest.options).map(item -> GeckoLoginDelegateWrapper.toLogin(item.value)).collect(Collectors.toList());
mSelectLoginPrompt = new SelectLoginPromptWidget(mContext, new SelectLoginPromptWidget.Delegate() {
@Override
Expand Down

0 comments on commit f2e4a1c

Please sign in to comment.