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

Side by Side Diff: components/autofill/browser/autofill_manager.h

Issue 15097004: Enable Autocomplete feature for chromium webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setSaveFormData2
Patch Set: address Ben's comments Created 7 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BROWSER_AUTOFILL_MANAGER_H_ 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_
6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_ 6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 AutofillExternalDelegate* external_delegate() { 196 AutofillExternalDelegate* external_delegate() {
197 return external_delegate_; 197 return external_delegate_;
198 } 198 }
199 199
200 // Exposed for testing. 200 // Exposed for testing.
201 autofill::AutocheckoutManager* autocheckout_manager() { 201 autofill::AutocheckoutManager* autocheckout_manager() {
202 return &autocheckout_manager_; 202 return &autocheckout_manager_;
203 } 203 }
204 204
205 // Processes the submitted |form|, saving any new Autofill data and uploading 205 // Processes the submitted |form|, saving any new Autofill data and uploading
206 // the possible field types for the submitted fields to the crowdsouring 206 // the possible field types for the submitted fields to the crowdsourcing
207 // server. Returns false if this form is not relevant for Autofill. 207 // server. Returns false if this form is not relevant for Autofill.
208 bool OnFormSubmitted(const FormData& form, 208 bool OnFormSubmitted(const FormData& form,
209 const base::TimeTicks& timestamp); 209 const base::TimeTicks& timestamp);
210 210
211 // Tell the renderer the current interactive autocomplete finished. 211 // Tell the renderer the current interactive autocomplete finished.
212 virtual void ReturnAutocompleteResult( 212 virtual void ReturnAutocompleteResult(
213 WebKit::WebFormElement::AutocompleteResult result, 213 WebKit::WebFormElement::AutocompleteResult result,
214 const FormData& form_data); 214 const FormData& form_data);
215 215
216 private: 216 private:
(...skipping 12 matching lines...) Expand all
229 autofill::FormsSeenState state); 229 autofill::FormsSeenState state);
230 void OnTextFieldDidChange(const FormData& form, 230 void OnTextFieldDidChange(const FormData& form,
231 const FormFieldData& field, 231 const FormFieldData& field,
232 const base::TimeTicks& timestamp); 232 const base::TimeTicks& timestamp);
233 233
234 // The |bounding_box| is a window relative value. 234 // The |bounding_box| is a window relative value.
235 void OnQueryFormFieldAutofill(int query_id, 235 void OnQueryFormFieldAutofill(int query_id,
236 const FormData& form, 236 const FormData& form,
237 const FormFieldData& field, 237 const FormFieldData& field,
238 const gfx::RectF& bounding_box, 238 const gfx::RectF& bounding_box,
239 bool display_warning); 239 bool display_warning);
Ilya Sherman 2013/06/03 23:22:19 nit: Add a newline after this line.
sgurun-gerrit only 2013/06/13 01:13:31 Done.
240 void OnQueryFormFieldAutofillPersonalData(
Ilya Sherman 2013/06/03 23:22:19 Please name this method something more like "GetAu
sgurun-gerrit only 2013/06/13 01:13:31 Done.
241 int query_id,
242 const FormData& form,
243 const FormFieldData& field,
244 std::vector<base::string16>* values,
245 std::vector<base::string16>* labels,
246 std::vector<string16>* icons,
247 std::vector<int>* unique_ids);
248
240 void OnDidEndTextFieldEditing(); 249 void OnDidEndTextFieldEditing();
241 void OnHideAutofillUi(); 250 void OnHideAutofillUi();
242 void OnAddPasswordFormMapping( 251 void OnAddPasswordFormMapping(
243 const FormFieldData& form, 252 const FormFieldData& form,
244 const PasswordFormFillData& fill_data); 253 const PasswordFormFillData& fill_data);
245 void OnShowPasswordSuggestions( 254 void OnShowPasswordSuggestions(
246 const FormFieldData& field, 255 const FormFieldData& field,
247 const gfx::RectF& bounds, 256 const gfx::RectF& bounds,
248 const std::vector<base::string16>& suggestions); 257 const std::vector<base::string16>& suggestions);
249 void OnSetDataList(const std::vector<base::string16>& values, 258 void OnSetDataList(const std::vector<base::string16>& values,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 void SendAutofillTypePredictions( 353 void SendAutofillTypePredictions(
345 const std::vector<FormStructure*>& forms) const; 354 const std::vector<FormStructure*>& forms) const;
346 355
347 autofill::AutofillManagerDelegate* const manager_delegate_; 356 autofill::AutofillManagerDelegate* const manager_delegate_;
348 357
349 std::string app_locale_; 358 std::string app_locale_;
350 359
351 // The personal data manager, used to save and load personal data to/from the 360 // The personal data manager, used to save and load personal data to/from the
352 // web database. This is overridden by the AutofillManagerTest. 361 // web database. This is overridden by the AutofillManagerTest.
353 // Weak reference. 362 // Weak reference.
354 // May be NULL. NULL indicates OTR. 363 // May be NULL for OTR and android webview.
Ilya Sherman 2013/06/03 23:22:19 nit: "Android WebView". Ditto below.
sgurun-gerrit only 2013/06/13 01:13:31 Done.
355 PersonalDataManager* personal_data_; 364 PersonalDataManager* personal_data_;
356 365
357 std::list<std::string> autofilled_form_signatures_; 366 std::list<std::string> autofilled_form_signatures_;
358 367
359 // Handles queries and uploads to Autofill servers. Will be NULL if 368 // Handles queries and uploads to Autofill servers. Will be NULL if
360 // the download manager functionality is disabled. 369 // the download manager functionality is disabled.
361 scoped_ptr<AutofillDownloadManager> download_manager_; 370 scoped_ptr<AutofillDownloadManager> download_manager_;
362 371
363 // Handles single-field autocomplete form data. 372 // Handles single-field autocomplete form data.
364 AutocompleteHistoryManager autocomplete_history_manager_; 373 AutocompleteHistoryManager autocomplete_history_manager_;
365 374
366 // Handles autocheckout flows. 375 // Handles autocheckout flows. NULL for android webview.
367 autofill::AutocheckoutManager autocheckout_manager_; 376 autofill::AutocheckoutManager autocheckout_manager_;
368 377
369 // For logging UMA metrics. Overridden by metrics tests. 378 // For logging UMA metrics. Overridden by metrics tests.
370 scoped_ptr<const AutofillMetrics> metric_logger_; 379 scoped_ptr<const AutofillMetrics> metric_logger_;
371 // Have we logged whether Autofill is enabled for this page load? 380 // Have we logged whether Autofill is enabled for this page load?
372 bool has_logged_autofill_enabled_; 381 bool has_logged_autofill_enabled_;
373 // Have we logged an address suggestions count metric for this page? 382 // Have we logged an address suggestions count metric for this page?
374 bool has_logged_address_suggestions_count_; 383 bool has_logged_address_suggestions_count_;
375 // Have we shown Autofill suggestions at least once? 384 // Have we shown Autofill suggestions at least once?
376 bool did_show_suggestions_; 385 bool did_show_suggestions_;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, 436 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest,
428 UserHappinessFormLoadAndSubmission); 437 UserHappinessFormLoadAndSubmission);
429 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); 438 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction);
430 439
431 DISALLOW_COPY_AND_ASSIGN(AutofillManager); 440 DISALLOW_COPY_AND_ASSIGN(AutofillManager);
432 }; 441 };
433 442
434 } // namespace autofill 443 } // namespace autofill
435 444
436 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_ 445 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698