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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // Meta, script and title tags don't influence the emptiness of a webpage. 169 // Meta, script and title tags don't influence the emptiness of a webpage.
170 bool IsWebpageEmpty(const blink::WebFrame* frame); 170 bool IsWebpageEmpty(const blink::WebFrame* frame);
171 171
172 // This function checks whether the children of |element| 172 // This function checks whether the children of |element|
173 // are of the type <script>, <meta>, or <title>. 173 // are of the type <script>, <meta>, or <title>.
174 bool IsWebElementEmpty(const blink::WebElement& element); 174 bool IsWebElementEmpty(const blink::WebElement& element);
175 175
176 // Return a gfx::RectF that is the bounding box for |element| scaled by |scale|. 176 // Return a gfx::RectF that is the bounding box for |element| scaled by |scale|.
177 gfx::RectF GetScaledBoundingBox(float scale, blink::WebElement* element); 177 gfx::RectF GetScaledBoundingBox(float scale, blink::WebElement* element);
178 178
179 // 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
180 // the part of |input_element| text from the end of the |user_input| text till
181 // end of |suggestion| text.
182 // 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
183 // not be null.
184 // 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
185 // |input_element| and being highlighted.
186 // And the |user_input| text is the field contents that user has typed.
187 // If the |user_input| text prefixes the |suggestion|, the |input_element|'s
188 // text selection range starts at |user_input|'s string length till the
189 // |suggestion| string's end. If |kEnableSuggestionsWithSubstringMatch| commond
190 // line switch is enabled and the |user_input| substrings the field's
191 // |suggestion| starting at token boundaries, the text selection range starts at
192 // part of the |suggestion| string where |user_input| string ends till the
193 // |suggestion| string's end.
194 // Here, we are not using input_element->value() and
195 // input_element->suggestedValue() directly because password manager sometimes
196 // does not set them. http://crbug.com/507714
197 void PreviewSuggestion(const base::string16& suggestion,
198 const base::string16& user_input,
199 blink::WebFormControlElement* input_element);
200
179 } // namespace autofill 201 } // namespace autofill
180 202
181 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ 203 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698