Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: components/autofill/content/renderer/form_autofill_util.h

Issue 962673004: [Autofill/Autocomplete Feature] Substring matching instead of prefix matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unittest for Android bot. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/content/renderer/form_autofill_util.h
diff --git a/components/autofill/content/renderer/form_autofill_util.h b/components/autofill/content/renderer/form_autofill_util.h
index 1be05cdac08433fab3baf5dd2e293ea3d2af413c..708b30b8b3a75fda2878d1e769de623465b0b55c 100644
--- a/components/autofill/content/renderer/form_autofill_util.h
+++ b/components/autofill/content/renderer/form_autofill_util.h
@@ -176,6 +176,28 @@ bool IsWebElementEmpty(const blink::WebElement& element);
// Return a gfx::RectF that is the bounding box for |element| scaled by |scale|.
gfx::RectF GetScaledBoundingBox(float scale, blink::WebElement* element);
+// Previews the |input_element| with supplied |suggestion| text and highlights
vabr (Chromium) 2015/07/13 14:04:25 grammar: missing definite articles: the |suggestio
vabr (Chromium) 2015/07/13 14:04:25 Sorry, I gave up listing the nits for this comment
vabr (Chromium) 2015/07/13 14:04:26 Wrong valency for preview, please change to: Previ
Pritam Nikam 2015/07/14 10:30:07 Done. Thanks. Above points you mentioned will def
+// the part of |input_element| text from the end of the |user_input| text till
+// end of |suggestion| text.
+// The |input_element| is the text field being considered for preview and should
vabr (Chromium) 2015/07/13 14:04:26 nit: Do not repeat that the preview is done in the
+// not be null.
+// The |suggestion| text is the field's suggestion to be previewed in the
vabr (Chromium) 2015/07/13 14:04:26 This sentence is completely duplicating what has a
+// |input_element| and being highlighted.
+// And the |user_input| text is the field contents that user has typed.
+// If the |user_input| text prefixes the |suggestion|, the |input_element|'s
+// text selection range starts at |user_input|'s string length till the
+// |suggestion| string's end. If |kEnableSuggestionsWithSubstringMatch| commond
+// line switch is enabled and the |user_input| substrings the field's
+// |suggestion| starting at token boundaries, the text selection range starts at
+// part of the |suggestion| string where |user_input| string ends till the
+// |suggestion| string's end.
+// Here, we are not using input_element->value() and
+// input_element->suggestedValue() directly because password manager sometimes
+// does not set them. http://crbug.com/507714
+void PreviewSuggestion(const base::string16& suggestion,
+ const base::string16& user_input,
+ blink::WebFormControlElement* input_element);
+
} // namespace autofill
#endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698