OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/webdata/web_database.h" | 5 #include "chrome/browser/webdata/web_database.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 | 624 |
625 bool WebDatabase::AddLogin(const PasswordForm& form) { | 625 bool WebDatabase::AddLogin(const PasswordForm& form) { |
626 SQLStatement s; | 626 SQLStatement s; |
627 std::string encrypted_password; | 627 std::string encrypted_password; |
628 if (s.prepare(db_, | 628 if (s.prepare(db_, |
629 "INSERT OR REPLACE INTO logins " | 629 "INSERT OR REPLACE INTO logins " |
630 "(origin_url, action_url, username_element, username_value, " | 630 "(origin_url, action_url, username_element, username_value, " |
631 " password_element, password_value, submit_element, " | 631 " password_element, password_value, submit_element, " |
632 " signon_realm, ssl_valid, preferred, date_created, " | 632 " signon_realm, ssl_valid, preferred, date_created, " |
633 " blacklisted_by_user, scheme) " | 633 " blacklisted_by_user, scheme) " |
634 "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") != SQLITE_OK)
{ | 634 "VALUES " |
| 635 "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") != SQLITE_OK) { |
635 NOTREACHED() << "Statement prepare failed"; | 636 NOTREACHED() << "Statement prepare failed"; |
636 return false; | 637 return false; |
637 } | 638 } |
638 | 639 |
639 s.bind_string(0, form.origin.spec()); | 640 s.bind_string(0, form.origin.spec()); |
640 s.bind_string(1, form.action.spec()); | 641 s.bind_string(1, form.action.spec()); |
641 s.bind_wstring(2, form.username_element); | 642 s.bind_wstring(2, form.username_element); |
642 s.bind_wstring(3, form.username_value); | 643 s.bind_wstring(3, form.username_value); |
643 s.bind_wstring(4, form.password_element); | 644 s.bind_wstring(4, form.password_element); |
644 Encryptor::EncryptString16(WideToUTF16Hack(form.password_value), | 645 Encryptor::EncryptString16(WideToUTF16Hack(form.password_value), |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 | 1186 |
1186 // Add successive versions here. Each should set the version number and | 1187 // Add successive versions here. Each should set the version number and |
1187 // compatible version number as appropriate, then fall through to the next | 1188 // compatible version number as appropriate, then fall through to the next |
1188 // case. | 1189 // case. |
1189 | 1190 |
1190 case kCurrentVersionNumber: | 1191 case kCurrentVersionNumber: |
1191 // No migration needed. | 1192 // No migration needed. |
1192 return; | 1193 return; |
1193 } | 1194 } |
1194 } | 1195 } |
OLD | NEW |