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 "components/autofill/browser/autofill_manager.h" | 5 #include "components/autofill/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> |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 form_structure->DetermineHeuristicTypes(*metric_logger_); | 1253 form_structure->DetermineHeuristicTypes(*metric_logger_); |
1254 | 1254 |
1255 // Set aside forms with method GET or author-specified types, so that they | 1255 // Set aside forms with method GET or author-specified types, so that they |
1256 // are not included in the query to the server. | 1256 // are not included in the query to the server. |
1257 if (form_structure->ShouldBeCrowdsourced()) | 1257 if (form_structure->ShouldBeCrowdsourced()) |
1258 form_structures_.push_back(form_structure.release()); | 1258 form_structures_.push_back(form_structure.release()); |
1259 else | 1259 else |
1260 non_queryable_forms.push_back(form_structure.release()); | 1260 non_queryable_forms.push_back(form_structure.release()); |
1261 } | 1261 } |
1262 | 1262 |
1263 // If none of the forms were parsed, no use querying the server. | 1263 if (form_structures_.empty()) { |
1264 if (!form_structures_.empty() && !disable_download_manager_requests_) { | 1264 // Call OnLoadedPageMetaData with no page metadata immediately if there is |
| 1265 // no form in the page. This give |autocheckout_manager| a chance to |
| 1266 // terminate Autocheckout and send Autocheckout status. |
| 1267 autocheckout_manager_.OnLoadedPageMetaData( |
| 1268 scoped_ptr<autofill::AutocheckoutPageMetaData>(NULL)); |
| 1269 } else if (!disable_download_manager_requests_) { |
| 1270 // Query the server if we have at least one of the forms were parsed. |
1265 download_manager_.StartQueryRequest(form_structures_.get(), | 1271 download_manager_.StartQueryRequest(form_structures_.get(), |
1266 *metric_logger_); | 1272 *metric_logger_); |
1267 } | 1273 } |
1268 | 1274 |
1269 for (std::vector<FormStructure*>::const_iterator iter = | 1275 for (std::vector<FormStructure*>::const_iterator iter = |
1270 non_queryable_forms.begin(); | 1276 non_queryable_forms.begin(); |
1271 iter != non_queryable_forms.end(); ++iter) { | 1277 iter != non_queryable_forms.end(); ++iter) { |
1272 form_structures_.push_back(*iter); | 1278 form_structures_.push_back(*iter); |
1273 } | 1279 } |
1274 | 1280 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 *profile_guid = IDToGUID(profile_id); | 1343 *profile_guid = IDToGUID(profile_id); |
1338 } | 1344 } |
1339 | 1345 |
1340 void AutofillManager::UpdateInitialInteractionTimestamp( | 1346 void AutofillManager::UpdateInitialInteractionTimestamp( |
1341 const TimeTicks& interaction_timestamp) { | 1347 const TimeTicks& interaction_timestamp) { |
1342 if (initial_interaction_timestamp_.is_null() || | 1348 if (initial_interaction_timestamp_.is_null() || |
1343 interaction_timestamp < initial_interaction_timestamp_) { | 1349 interaction_timestamp < initial_interaction_timestamp_) { |
1344 initial_interaction_timestamp_ = interaction_timestamp; | 1350 initial_interaction_timestamp_ = interaction_timestamp; |
1345 } | 1351 } |
1346 } | 1352 } |
OLD | NEW |