[Android][TouchToFill] Use FindPasswordInfoForElement for triggering

Use for TouchToFill the same triggering logic that is used for regular
suggestions.

Bug: 1010233
Change-Id: I111d4eac4ce94dd94b86097b6b6c98e08875e11a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1834230
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702058}
void PasswordAutofillAgent::FireSubmissionIfFormDisappear(
    SubmissionIndicatorEvent event) {
  if (!browser_has_form_to_process_)
    return;
  DCHECK(FrameCanAccessPasswordManager());

  WebLocalFrame* frame = render_frame()->GetWebFrame();
  if (event != SubmissionIndicatorEvent::DOM_MUTATION_AFTER_XHR) {
    bool is_last_updated_field_in_form =
        last_updated_form_renderer_id_ != FormData::kNotSetFormRendererId;
    if (is_last_updated_field_in_form) {
      if (IsFormVisible(frame, last_updated_form_renderer_id_))
        return;
    } else {
      if (IsFormControlVisible(frame, last_updated_field_renderer_id_))
        return;
    }
  }
  GetPasswordManagerDriver()->SameDocumentNavigation(event);
  browser_has_form_to_process_ = false;
}

void PasswordAutofillAgent::FireSubmissionIfFormDisappear(
    SubmissionIndicatorEvent event) {
  if (!browser_has_form_to_process_)
    return;
  DCHECK(FrameCanAccessPasswordManager());

  WebLocalFrame* frame = render_frame()->GetWebFrame();
  if (event != SubmissionIndicatorEvent::DOM_MUTATION_AFTER_XHR) {
    bool is_last_updated_field_in_form =
        last_updated_form_renderer_id_ != FormData::kNotSetFormRendererId;
    if (is_last_updated_field_in_form) {
      if (IsFormVisible(frame, last_updated_form_renderer_id_))
        return;
    } else {
      if (IsFormControlVisible(frame, last_updated_field_renderer_id_))
        return;
    }
  }
  GetPasswordManagerDriver()->SameDocumentNavigation(event);
  browser_has_form_to_process_ = false;
}
