| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 profile->SetRawInfo(autofill::NAME_MIDDLE, s.ColumnString16(3)); | 53 profile->SetRawInfo(autofill::NAME_MIDDLE, s.ColumnString16(3)); |
| 54 profile->SetRawInfo(autofill::NAME_LAST, s.ColumnString16(4)); | 54 profile->SetRawInfo(autofill::NAME_LAST, s.ColumnString16(4)); |
| 55 profile->SetRawInfo(autofill::EMAIL_ADDRESS, s.ColumnString16(5)); | 55 profile->SetRawInfo(autofill::EMAIL_ADDRESS, s.ColumnString16(5)); |
| 56 profile->SetRawInfo(autofill::COMPANY_NAME, s.ColumnString16(6)); | 56 profile->SetRawInfo(autofill::COMPANY_NAME, s.ColumnString16(6)); |
| 57 profile->SetRawInfo(autofill::ADDRESS_HOME_LINE1, s.ColumnString16(7)); | 57 profile->SetRawInfo(autofill::ADDRESS_HOME_LINE1, s.ColumnString16(7)); |
| 58 profile->SetRawInfo(autofill::ADDRESS_HOME_LINE2, s.ColumnString16(8)); | 58 profile->SetRawInfo(autofill::ADDRESS_HOME_LINE2, s.ColumnString16(8)); |
| 59 profile->SetRawInfo(autofill::ADDRESS_HOME_CITY, s.ColumnString16(9)); | 59 profile->SetRawInfo(autofill::ADDRESS_HOME_CITY, s.ColumnString16(9)); |
| 60 profile->SetRawInfo(autofill::ADDRESS_HOME_STATE, s.ColumnString16(10)); | 60 profile->SetRawInfo(autofill::ADDRESS_HOME_STATE, s.ColumnString16(10)); |
| 61 profile->SetRawInfo(autofill::ADDRESS_HOME_ZIP, s.ColumnString16(11)); | 61 profile->SetRawInfo(autofill::ADDRESS_HOME_ZIP, s.ColumnString16(11)); |
| 62 profile->SetInfo( | 62 profile->SetInfo( |
| 63 autofill::ADDRESS_HOME_COUNTRY, s.ColumnString16(12), "en-US"); | 63 autofill::AutofillType(autofill::ADDRESS_HOME_COUNTRY), |
| 64 s.ColumnString16(12), "en-US"); |
| 64 profile->SetRawInfo(autofill::PHONE_HOME_WHOLE_NUMBER, s.ColumnString16(13)); | 65 profile->SetRawInfo(autofill::PHONE_HOME_WHOLE_NUMBER, s.ColumnString16(13)); |
| 65 *date_modified = s.ColumnInt64(15); | 66 *date_modified = s.ColumnInt64(15); |
| 66 profile->set_guid(s.ColumnString(16)); | 67 profile->set_guid(s.ColumnString(16)); |
| 67 EXPECT_TRUE(base::IsValidGUID(profile->guid())); | 68 EXPECT_TRUE(base::IsValidGUID(profile->guid())); |
| 68 } | 69 } |
| 69 | 70 |
| 70 void AutofillProfile33FromStatement(const sql::Statement& s, | 71 void AutofillProfile33FromStatement(const sql::Statement& s, |
| 71 AutofillProfile* profile, | 72 AutofillProfile* profile, |
| 72 int64* date_modified) { | 73 int64* date_modified) { |
| 73 DCHECK(profile); | 74 DCHECK(profile); |
| 74 DCHECK(date_modified); | 75 DCHECK(date_modified); |
| 75 profile->set_guid(s.ColumnString(0)); | 76 profile->set_guid(s.ColumnString(0)); |
| 76 EXPECT_TRUE(base::IsValidGUID(profile->guid())); | 77 EXPECT_TRUE(base::IsValidGUID(profile->guid())); |
| 77 profile->SetRawInfo(autofill::COMPANY_NAME, s.ColumnString16(1)); | 78 profile->SetRawInfo(autofill::COMPANY_NAME, s.ColumnString16(1)); |
| 78 profile->SetRawInfo(autofill::ADDRESS_HOME_LINE1, s.ColumnString16(2)); | 79 profile->SetRawInfo(autofill::ADDRESS_HOME_LINE1, s.ColumnString16(2)); |
| 79 profile->SetRawInfo(autofill::ADDRESS_HOME_LINE2, s.ColumnString16(3)); | 80 profile->SetRawInfo(autofill::ADDRESS_HOME_LINE2, s.ColumnString16(3)); |
| 80 profile->SetRawInfo(autofill::ADDRESS_HOME_CITY, s.ColumnString16(4)); | 81 profile->SetRawInfo(autofill::ADDRESS_HOME_CITY, s.ColumnString16(4)); |
| 81 profile->SetRawInfo(autofill::ADDRESS_HOME_STATE, s.ColumnString16(5)); | 82 profile->SetRawInfo(autofill::ADDRESS_HOME_STATE, s.ColumnString16(5)); |
| 82 profile->SetRawInfo(autofill::ADDRESS_HOME_ZIP, s.ColumnString16(6)); | 83 profile->SetRawInfo(autofill::ADDRESS_HOME_ZIP, s.ColumnString16(6)); |
| 83 profile->SetInfo( | 84 profile->SetInfo( |
| 84 autofill::ADDRESS_HOME_COUNTRY, s.ColumnString16(7), "en-US"); | 85 autofill::AutofillType(autofill::ADDRESS_HOME_COUNTRY), |
| 86 s.ColumnString16(7), "en-US"); |
| 85 *date_modified = s.ColumnInt64(8); | 87 *date_modified = s.ColumnInt64(8); |
| 86 } | 88 } |
| 87 | 89 |
| 88 void CreditCard31FromStatement(const sql::Statement& s, | 90 void CreditCard31FromStatement(const sql::Statement& s, |
| 89 CreditCard* credit_card, | 91 CreditCard* credit_card, |
| 90 base::string16* label, | 92 base::string16* label, |
| 91 int* unique_id, | 93 int* unique_id, |
| 92 std::string* encrypted_number, | 94 std::string* encrypted_number, |
| 93 int64* date_modified) { | 95 int64* date_modified) { |
| 94 DCHECK(credit_card); | 96 DCHECK(credit_card); |
| (...skipping 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2071 EXPECT_TRUE(connection.DoesColumnExist("keywords", | 2073 EXPECT_TRUE(connection.DoesColumnExist("keywords", |
| 2072 "search_url_post_params")); | 2074 "search_url_post_params")); |
| 2073 EXPECT_TRUE(connection.DoesColumnExist("keywords", | 2075 EXPECT_TRUE(connection.DoesColumnExist("keywords", |
| 2074 "suggest_url_post_params")); | 2076 "suggest_url_post_params")); |
| 2075 EXPECT_TRUE(connection.DoesColumnExist("keywords", | 2077 EXPECT_TRUE(connection.DoesColumnExist("keywords", |
| 2076 "instant_url_post_params")); | 2078 "instant_url_post_params")); |
| 2077 EXPECT_TRUE(connection.DoesColumnExist("keywords", | 2079 EXPECT_TRUE(connection.DoesColumnExist("keywords", |
| 2078 "image_url_post_params")); | 2080 "image_url_post_params")); |
| 2079 } | 2081 } |
| 2080 } | 2082 } |
| OLD | NEW |