OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logins_table.h" | 5 #include "chrome/browser/webdata/logins_table.h" |
6 | 6 |
7 #include "app/sql/statement.h" | |
8 #include "base/logging.h" | 7 #include "base/logging.h" |
9 #include "base/time.h" | 8 #include "base/time.h" |
10 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/password_manager/ie7_password.h" | 10 #include "chrome/browser/password_manager/ie7_password.h" |
| 11 #include "sql/statement.h" |
12 | 12 |
13 bool LoginsTable::AddIE7Login(const IE7PasswordInfo& info) { | 13 bool LoginsTable::AddIE7Login(const IE7PasswordInfo& info) { |
14 sql::Statement s(db_->GetUniqueStatement( | 14 sql::Statement s(db_->GetUniqueStatement( |
15 "INSERT OR REPLACE INTO ie7_logins " | 15 "INSERT OR REPLACE INTO ie7_logins " |
16 "(url_hash, password_value, date_created) " | 16 "(url_hash, password_value, date_created) " |
17 "VALUES (?,?,?)")); | 17 "VALUES (?,?,?)")); |
18 if (!s) { | 18 if (!s) { |
19 NOTREACHED() << db_->GetErrorMessage(); | 19 NOTREACHED() << db_->GetErrorMessage(); |
20 return false; | 20 return false; |
21 } | 21 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 60 } |
61 | 61 |
62 s.BindString(0, WideToUTF8(info.url_hash)); | 62 s.BindString(0, WideToUTF8(info.url_hash)); |
63 if (s.Step()) { | 63 if (s.Step()) { |
64 s.ColumnBlobAsVector(0, &result->encrypted_data); | 64 s.ColumnBlobAsVector(0, &result->encrypted_data); |
65 result->date_created = base::Time::FromTimeT(s.ColumnInt64(1)); | 65 result->date_created = base::Time::FromTimeT(s.ColumnInt64(1)); |
66 result->url_hash = info.url_hash; | 66 result->url_hash = info.url_hash; |
67 } | 67 } |
68 return s.Succeeded(); | 68 return s.Succeeded(); |
69 } | 69 } |
OLD | NEW |