| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 kAutoFillNegativeUploadRateDefaultValue); | 131 kAutoFillNegativeUploadRateDefaultValue); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void AutoFillManager::FormSubmitted(const FormData& form) { | 134 void AutoFillManager::FormSubmitted(const FormData& form) { |
| 135 if (!IsAutoFillEnabled()) | 135 if (!IsAutoFillEnabled()) |
| 136 return; | 136 return; |
| 137 | 137 |
| 138 if (tab_contents_->profile()->IsOffTheRecord()) | 138 if (tab_contents_->profile()->IsOffTheRecord()) |
| 139 return; | 139 return; |
| 140 | 140 |
| 141 // Don't save data that was submitted through JavaScript. |
| 142 if (!form.user_submitted) |
| 143 return; |
| 144 |
| 141 // Grab a copy of the form data. | 145 // Grab a copy of the form data. |
| 142 upload_form_structure_.reset(new FormStructure(form)); | 146 upload_form_structure_.reset(new FormStructure(form)); |
| 143 | 147 |
| 144 if (!upload_form_structure_->IsAutoFillable()) | 148 if (!upload_form_structure_->IsAutoFillable()) |
| 145 return; | 149 return; |
| 146 | 150 |
| 147 // Determine the possible field types and upload the form structure to the | 151 // Determine the possible field types and upload the form structure to the |
| 148 // PersonalDataManager. | 152 // PersonalDataManager. |
| 149 DeterminePossibleFieldTypes(upload_form_structure_.get()); | 153 DeterminePossibleFieldTypes(upload_form_structure_.get()); |
| 150 HandleSubmit(); | 154 HandleSubmit(); |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 | 792 |
| 789 // When receiving IDs (across processes) from the renderer we unpack credit card | 793 // When receiving IDs (across processes) from the renderer we unpack credit card |
| 790 // and profile IDs from a single integer. Credit card IDs are stored in the | 794 // and profile IDs from a single integer. Credit card IDs are stored in the |
| 791 // high word and profile IDs are stored in the low word. | 795 // high word and profile IDs are stored in the low word. |
| 792 // static | 796 // static |
| 793 void AutoFillManager::UnpackIDs(int id, int* cc_id, int* profile_id) { | 797 void AutoFillManager::UnpackIDs(int id, int* cc_id, int* profile_id) { |
| 794 *cc_id = id >> std::numeric_limits<unsigned short>::digits & | 798 *cc_id = id >> std::numeric_limits<unsigned short>::digits & |
| 795 std::numeric_limits<unsigned short>::max(); | 799 std::numeric_limits<unsigned short>::max(); |
| 796 *profile_id = id & std::numeric_limits<unsigned short>::max(); | 800 *profile_id = id & std::numeric_limits<unsigned short>::max(); |
| 797 } | 801 } |
| OLD | NEW |