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

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: enable autocomplete independent of autofill. Created 7 years, 6 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 AutofillExternalDelegate* external_delegate() { 203 AutofillExternalDelegate* external_delegate() {
204 return external_delegate_; 204 return external_delegate_;
205 } 205 }
206 206
207 // Exposed for testing. 207 // Exposed for testing.
208 autofill::AutocheckoutManager* autocheckout_manager() { 208 autofill::AutocheckoutManager* autocheckout_manager() {
209 return &autocheckout_manager_; 209 return &autocheckout_manager_;
210 } 210 }
211 211
212 // Processes the submitted |form|, saving any new Autofill data and uploading 212 // Processes the submitted |form|, saving any new Autofill data and uploading
213 // the possible field types for the submitted fields to the crowdsouring 213 // the possible field types for the submitted fields to the crowdsourcing
214 // server. Returns false if this form is not relevant for Autofill. 214 // server. Returns false if this form is not relevant for Autofill.
215 bool OnFormSubmitted(const FormData& form, 215 bool OnFormSubmitted(const FormData& form,
216 const base::TimeTicks& timestamp); 216 const base::TimeTicks& timestamp);
217 217
218 // Tell the renderer the current interactive autocomplete finished. 218 // Tell the renderer the current interactive autocomplete finished.
219 virtual void ReturnAutocompleteResult( 219 virtual void ReturnAutocompleteResult(
220 WebKit::WebFormElement::AutocompleteResult result, 220 WebKit::WebFormElement::AutocompleteResult result,
221 const FormData& form_data); 221 const FormData& form_data);
222 222
223 private: 223 private:
224 // content::WebContentsObserver: 224 // content::WebContentsObserver:
225 virtual void DidNavigateMainFrame( 225 virtual void DidNavigateMainFrame(
226 const content::LoadCommittedDetails& details, 226 const content::LoadCommittedDetails& details,
227 const content::FrameNavigateParams& params) OVERRIDE; 227 const content::FrameNavigateParams& params) OVERRIDE;
228 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 228 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
229 229
230 // AutofillDownloadManager::Observer: 230 // AutofillDownloadManager::Observer:
231 virtual void OnLoadedServerPredictions( 231 virtual void OnLoadedServerPredictions(
232 const std::string& response_xml) OVERRIDE; 232 const std::string& response_xml) OVERRIDE;
233 233
234 void OnFormsSeen(const std::vector<FormData>& forms, 234 void OnFormsSeen(const std::vector<FormData>& forms,
235 const base::TimeTicks& timestamp, 235 const base::TimeTicks& timestamp,
236 autofill::FormsSeenState state); 236 autofill::FormsSeenState state);
237
237 void OnTextFieldDidChange(const FormData& form, 238 void OnTextFieldDidChange(const FormData& form,
238 const FormFieldData& field, 239 const FormFieldData& field,
239 const base::TimeTicks& timestamp); 240 const base::TimeTicks& timestamp);
240 241
241 // The |bounding_box| is a window relative value. 242 // The |bounding_box| is a window relative value.
242 void OnQueryFormFieldAutofill(int query_id, 243 void OnQueryFormFieldAutofill(int query_id,
243 const FormData& form, 244 const FormData& form,
244 const FormFieldData& field, 245 const FormFieldData& field,
245 const gfx::RectF& bounding_box, 246 const gfx::RectF& bounding_box,
246 bool display_warning); 247 bool display_warning);
248
247 void OnDidEndTextFieldEditing(); 249 void OnDidEndTextFieldEditing();
248 void OnHideAutofillUi(); 250 void OnHideAutofillUi();
249 void OnAddPasswordFormMapping( 251 void OnAddPasswordFormMapping(
250 const FormFieldData& form, 252 const FormFieldData& form,
251 const PasswordFormFillData& fill_data); 253 const PasswordFormFillData& fill_data);
252 void OnShowPasswordSuggestions( 254 void OnShowPasswordSuggestions(
253 const FormFieldData& field, 255 const FormFieldData& field,
254 const gfx::RectF& bounds, 256 const gfx::RectF& bounds,
255 const std::vector<base::string16>& suggestions); 257 const std::vector<base::string16>& suggestions);
256 void OnSetDataList(const std::vector<base::string16>& values, 258 void OnSetDataList(const std::vector<base::string16>& values,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 void SendAutofillTypePredictions( 345 void SendAutofillTypePredictions(
344 const std::vector<FormStructure*>& forms) const; 346 const std::vector<FormStructure*>& forms) const;
345 347
346 autofill::AutofillManagerDelegate* const manager_delegate_; 348 autofill::AutofillManagerDelegate* const manager_delegate_;
347 349
348 std::string app_locale_; 350 std::string app_locale_;
349 351
350 // The personal data manager, used to save and load personal data to/from the 352 // The personal data manager, used to save and load personal data to/from the
351 // web database. This is overridden by the AutofillManagerTest. 353 // web database. This is overridden by the AutofillManagerTest.
352 // Weak reference. 354 // Weak reference.
353 // May be NULL. NULL indicates OTR. 355 // May be NULL for OTR and Android Webview.
Ilya Sherman 2013/06/18 05:56:25 nit: Please revert all the changes in this file be
sgurun-gerrit only 2013/06/19 00:16:17 Done.
354 PersonalDataManager* personal_data_; 356 PersonalDataManager* personal_data_;
355 357
356 std::list<std::string> autofilled_form_signatures_; 358 std::list<std::string> autofilled_form_signatures_;
357 359
358 // Handles queries and uploads to Autofill servers. Will be NULL if 360 // Handles queries and uploads to Autofill servers. Will be NULL if
359 // the download manager functionality is disabled. 361 // the download manager functionality is disabled.
360 scoped_ptr<AutofillDownloadManager> download_manager_; 362 scoped_ptr<AutofillDownloadManager> download_manager_;
361 363
362 // Handles single-field autocomplete form data. 364 // Handles single-field autocomplete form data.
363 AutocompleteHistoryManager autocomplete_history_manager_; 365 AutocompleteHistoryManager autocomplete_history_manager_;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, 428 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest,
427 UserHappinessFormLoadAndSubmission); 429 UserHappinessFormLoadAndSubmission);
428 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); 430 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction);
429 431
430 DISALLOW_COPY_AND_ASSIGN(AutofillManager); 432 DISALLOW_COPY_AND_ASSIGN(AutofillManager);
431 }; 433 };
432 434
433 } // namespace autofill 435 } // namespace autofill
434 436
435 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_ 437 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698