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/webdata/autofill_table.h" | 5 #include "components/autofill/core/browser/webdata/autofill_table.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2229 return false; | 2229 return false; |
2230 } | 2230 } |
2231 sql::Statement s(db_->GetUniqueStatement( | 2231 sql::Statement s(db_->GetUniqueStatement( |
2232 "SELECT guid, address_line_1, address_line_2 FROM autofill_profiles")); | 2232 "SELECT guid, address_line_1, address_line_2 FROM autofill_profiles")); |
2233 while (s.Step()) { | 2233 while (s.Step()) { |
2234 std::string guid = s.ColumnString(0); | 2234 std::string guid = s.ColumnString(0); |
2235 base::string16 line1 = s.ColumnString16(1); | 2235 base::string16 line1 = s.ColumnString16(1); |
2236 base::string16 line2 = s.ColumnString16(2); | 2236 base::string16 line2 = s.ColumnString16(2); |
2237 base::string16 street_address = line1; | 2237 base::string16 street_address = line1; |
2238 if (!line2.empty()) | 2238 if (!line2.empty()) |
2239 street_address += ASCIIToUTF16("\n") + line2; | 2239 street_address += base::ASCIIToUTF16("\n") + line2; |
2240 | 2240 |
2241 sql::Statement s_update(db_->GetUniqueStatement( | 2241 sql::Statement s_update(db_->GetUniqueStatement( |
2242 "UPDATE autofill_profiles_temp SET street_address=? WHERE guid=?")); | 2242 "UPDATE autofill_profiles_temp SET street_address=? WHERE guid=?")); |
2243 s_update.BindString16(0, street_address); | 2243 s_update.BindString16(0, street_address); |
2244 s_update.BindString(1, guid); | 2244 s_update.BindString(1, guid); |
2245 if (!s_update.Run()) | 2245 if (!s_update.Run()) |
2246 return false; | 2246 return false; |
2247 } | 2247 } |
2248 if (!s.Succeeded()) | 2248 if (!s.Succeeded()) |
2249 return false; | 2249 return false; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2285 if (!db_->Execute("ALTER TABLE autofill_profile_phones_temp " | 2285 if (!db_->Execute("ALTER TABLE autofill_profile_phones_temp " |
2286 "RENAME TO autofill_profile_phones")) { | 2286 "RENAME TO autofill_profile_phones")) { |
2287 return false; | 2287 return false; |
2288 } | 2288 } |
2289 } | 2289 } |
2290 | 2290 |
2291 return transaction.Commit(); | 2291 return transaction.Commit(); |
2292 } | 2292 } |
2293 | 2293 |
2294 } // namespace autofill | 2294 } // namespace autofill |
OLD | NEW |