OLD | NEW |
---|---|
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 #include "components/autofill/core/browser/autofill_manager.h" | 5 #include "components/autofill/core/browser/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> |
11 #include <set> | 11 #include <set> |
12 #include <utility> | 12 #include <utility> |
13 | 13 |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/guid.h" | 16 #include "base/guid.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/threading/sequenced_worker_pool.h" | 22 #include "base/threading/sequenced_worker_pool.h" |
23 #include "chrome/browser/password_manager/password_generation_manager.h" | |
23 #include "components/autofill/content/browser/autocheckout/whitelist_manager.h" | 24 #include "components/autofill/content/browser/autocheckout/whitelist_manager.h" |
24 #include "components/autofill/content/browser/autocheckout_manager.h" | 25 #include "components/autofill/content/browser/autocheckout_manager.h" |
25 #include "components/autofill/core/browser/autocomplete_history_manager.h" | 26 #include "components/autofill/core/browser/autocomplete_history_manager.h" |
26 #include "components/autofill/core/browser/autofill_data_model.h" | 27 #include "components/autofill/core/browser/autofill_data_model.h" |
27 #include "components/autofill/core/browser/autofill_driver.h" | 28 #include "components/autofill/core/browser/autofill_driver.h" |
28 #include "components/autofill/core/browser/autofill_external_delegate.h" | 29 #include "components/autofill/core/browser/autofill_external_delegate.h" |
29 #include "components/autofill/core/browser/autofill_field.h" | 30 #include "components/autofill/core/browser/autofill_field.h" |
30 #include "components/autofill/core/browser/autofill_manager_delegate.h" | 31 #include "components/autofill/core/browser/autofill_manager_delegate.h" |
31 #include "components/autofill/core/browser/autofill_manager_test_delegate.h" | 32 #include "components/autofill/core/browser/autofill_manager_test_delegate.h" |
32 #include "components/autofill/core/browser/autofill_metrics.h" | 33 #include "components/autofill/core/browser/autofill_metrics.h" |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
737 const std::string& response_xml) { | 738 const std::string& response_xml) { |
738 scoped_ptr<autofill::AutocheckoutPageMetaData> page_meta_data( | 739 scoped_ptr<autofill::AutocheckoutPageMetaData> page_meta_data( |
739 new autofill::AutocheckoutPageMetaData()); | 740 new autofill::AutocheckoutPageMetaData()); |
740 | 741 |
741 // Parse and store the server predictions. | 742 // Parse and store the server predictions. |
742 FormStructure::ParseQueryResponse(response_xml, | 743 FormStructure::ParseQueryResponse(response_xml, |
743 form_structures_.get(), | 744 form_structures_.get(), |
744 page_meta_data.get(), | 745 page_meta_data.get(), |
745 *metric_logger_); | 746 *metric_logger_); |
746 | 747 |
748 // Forward form structures to the password generation manager to detect | |
749 // account creation form. | |
750 PasswordGenerationManager* manager = | |
751 PasswordGenerationManager::FromWebContents(driver_->GetWebContents()); | |
752 if (manager) { | |
753 manager->DetectAccountCreationForms(form_structures_.get()); | |
754 } | |
Ilya Sherman
2013/08/29 23:08:13
nit: No need for curly braces.
zysxqn
2013/09/03 23:00:20
NA now.
| |
755 | |
747 if (page_meta_data->IsInAutofillableFlow()) { | 756 if (page_meta_data->IsInAutofillableFlow()) { |
748 RenderViewHost* host = driver_->GetWebContents()->GetRenderViewHost(); | 757 RenderViewHost* host = driver_->GetWebContents()->GetRenderViewHost(); |
749 if (host) | 758 if (host) |
750 host->Send(new AutofillMsg_AutocheckoutSupported(host->GetRoutingID())); | 759 host->Send(new AutofillMsg_AutocheckoutSupported(host->GetRoutingID())); |
751 } | 760 } |
752 | 761 |
753 // TODO(ahutter): Remove this once Autocheckout is implemented on other | 762 // TODO(ahutter): Remove this once Autocheckout is implemented on other |
754 // platforms. See http://crbug.com/173416. | 763 // platforms. See http://crbug.com/173416. |
755 #if defined(TOOLKIT_VIEWS) | 764 #if defined(TOOLKIT_VIEWS) |
756 if (!GetAutocheckoutURLPrefix().empty()) | 765 if (!GetAutocheckoutURLPrefix().empty()) |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1210 | 1219 |
1211 void AutofillManager::UpdateInitialInteractionTimestamp( | 1220 void AutofillManager::UpdateInitialInteractionTimestamp( |
1212 const TimeTicks& interaction_timestamp) { | 1221 const TimeTicks& interaction_timestamp) { |
1213 if (initial_interaction_timestamp_.is_null() || | 1222 if (initial_interaction_timestamp_.is_null() || |
1214 interaction_timestamp < initial_interaction_timestamp_) { | 1223 interaction_timestamp < initial_interaction_timestamp_) { |
1215 initial_interaction_timestamp_ = interaction_timestamp; | 1224 initial_interaction_timestamp_ = interaction_timestamp; |
1216 } | 1225 } |
1217 } | 1226 } |
1218 | 1227 |
1219 } // namespace autofill | 1228 } // namespace autofill |
OLD | NEW |