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 | |
145 // Grab a copy of the form data. | 141 // Grab a copy of the form data. |
146 upload_form_structure_.reset(new FormStructure(form)); | 142 upload_form_structure_.reset(new FormStructure(form)); |
147 | 143 |
148 if (!upload_form_structure_->IsAutoFillable()) | 144 if (!upload_form_structure_->IsAutoFillable()) |
149 return; | 145 return; |
150 | 146 |
151 // Determine the possible field types and upload the form structure to the | 147 // Determine the possible field types and upload the form structure to the |
152 // PersonalDataManager. | 148 // PersonalDataManager. |
153 DeterminePossibleFieldTypes(upload_form_structure_.get()); | 149 DeterminePossibleFieldTypes(upload_form_structure_.get()); |
154 HandleSubmit(); | 150 HandleSubmit(); |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 | 788 |
793 // When receiving IDs (across processes) from the renderer we unpack credit card | 789 // When receiving IDs (across processes) from the renderer we unpack credit card |
794 // and profile IDs from a single integer. Credit card IDs are stored in the | 790 // and profile IDs from a single integer. Credit card IDs are stored in the |
795 // high word and profile IDs are stored in the low word. | 791 // high word and profile IDs are stored in the low word. |
796 // static | 792 // static |
797 void AutoFillManager::UnpackIDs(int id, int* cc_id, int* profile_id) { | 793 void AutoFillManager::UnpackIDs(int id, int* cc_id, int* profile_id) { |
798 *cc_id = id >> std::numeric_limits<unsigned short>::digits & | 794 *cc_id = id >> std::numeric_limits<unsigned short>::digits & |
799 std::numeric_limits<unsigned short>::max(); | 795 std::numeric_limits<unsigned short>::max(); |
800 *profile_id = id & std::numeric_limits<unsigned short>::max(); | 796 *profile_id = id & std::numeric_limits<unsigned short>::max(); |
801 } | 797 } |
OLD | NEW |