OLD | NEW |
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 #include "chrome/browser/autofill/autofill_manager.h" | 5 #include "chrome/browser/autofill/autofill_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 IPC_MESSAGE_HANDLER(AutofillHostMsg_HideAutofillPopup, | 353 IPC_MESSAGE_HANDLER(AutofillHostMsg_HideAutofillPopup, |
354 OnHideAutofillPopup) | 354 OnHideAutofillPopup) |
355 IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordGenerationPopup, | 355 IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordGenerationPopup, |
356 OnShowPasswordGenerationPopup) | 356 OnShowPasswordGenerationPopup) |
357 IPC_MESSAGE_HANDLER(AutofillHostMsg_AddPasswordFormMapping, | 357 IPC_MESSAGE_HANDLER(AutofillHostMsg_AddPasswordFormMapping, |
358 OnAddPasswordFormMapping) | 358 OnAddPasswordFormMapping) |
359 IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordSuggestions, | 359 IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordSuggestions, |
360 OnShowPasswordSuggestions) | 360 OnShowPasswordSuggestions) |
361 IPC_MESSAGE_HANDLER(AutofillHostMsg_SetDataList, | 361 IPC_MESSAGE_HANDLER(AutofillHostMsg_SetDataList, |
362 OnSetDataList) | 362 OnSetDataList) |
| 363 IPC_MESSAGE_HANDLER(AutofillHostMsg_RequestAutocomplete, |
| 364 OnRequestAutocomplete) |
363 IPC_MESSAGE_UNHANDLED(handled = false) | 365 IPC_MESSAGE_UNHANDLED(handled = false) |
364 IPC_END_MESSAGE_MAP() | 366 IPC_END_MESSAGE_MAP() |
365 | 367 |
366 return handled; | 368 return handled; |
367 } | 369 } |
368 | 370 |
369 void AutofillManager::WebContentsDestroyed(content::WebContents* web_contents) { | 371 void AutofillManager::WebContentsDestroyed(content::WebContents* web_contents) { |
370 ProfileSyncServiceBase* service = manager_delegate_->GetProfileSyncService(); | 372 ProfileSyncServiceBase* service = manager_delegate_->GetProfileSyncService(); |
371 if (service && service->HasObserver(this)) | 373 if (service && service->HasObserver(this)) |
372 service->RemoveObserver(this); | 374 service->RemoveObserver(this); |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 const std::vector<string16>& icons, | 792 const std::vector<string16>& icons, |
791 const std::vector<int>& unique_ids) { | 793 const std::vector<int>& unique_ids) { |
792 if (external_delegate_) { | 794 if (external_delegate_) { |
793 external_delegate_->SetCurrentDataListValues(values, | 795 external_delegate_->SetCurrentDataListValues(values, |
794 labels, | 796 labels, |
795 icons, | 797 icons, |
796 unique_ids); | 798 unique_ids); |
797 } | 799 } |
798 } | 800 } |
799 | 801 |
| 802 void AutofillManager::OnRequestAutocomplete(const FormData& form) { |
| 803 // TODO(dbeam): implement interactive autocomplete UI. |
| 804 } |
| 805 |
800 void AutofillManager::OnLoadedServerPredictions( | 806 void AutofillManager::OnLoadedServerPredictions( |
801 const std::string& response_xml) { | 807 const std::string& response_xml) { |
802 // Parse and store the server predictions. | 808 // Parse and store the server predictions. |
803 FormStructure::ParseQueryResponse(response_xml, | 809 FormStructure::ParseQueryResponse(response_xml, |
804 form_structures_.get(), | 810 form_structures_.get(), |
805 *metric_logger_); | 811 *metric_logger_); |
806 | 812 |
807 // If the corresponding flag is set, annotate forms with the predicted types. | 813 // If the corresponding flag is set, annotate forms with the predicted types. |
808 SendAutofillTypePredictions(form_structures_.get()); | 814 SendAutofillTypePredictions(form_structures_.get()); |
809 } | 815 } |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 *profile_guid = IDToGUID(profile_id); | 1419 *profile_guid = IDToGUID(profile_id); |
1414 } | 1420 } |
1415 | 1421 |
1416 void AutofillManager::UpdateInitialInteractionTimestamp( | 1422 void AutofillManager::UpdateInitialInteractionTimestamp( |
1417 const TimeTicks& interaction_timestamp) { | 1423 const TimeTicks& interaction_timestamp) { |
1418 if (initial_interaction_timestamp_.is_null() || | 1424 if (initial_interaction_timestamp_.is_null() || |
1419 interaction_timestamp < initial_interaction_timestamp_) { | 1425 interaction_timestamp < initial_interaction_timestamp_) { |
1420 initial_interaction_timestamp_ = interaction_timestamp; | 1426 initial_interaction_timestamp_ = interaction_timestamp; |
1421 } | 1427 } |
1422 } | 1428 } |
OLD | NEW |