Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: chrome/browser/webdata/logins_table_win.cc

Issue 26465006: Fix IE password import (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Renaming ie7_password to ie7_password_win Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "components/webdata/encryptor/ie7_password.h" 10 #include "components/webdata/encryptor/ie7_password_win.h"
11 #include "sql/statement.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 s.BindString(0, WideToUTF8(info.url_hash)); 18 s.BindString(0, WideToUTF8(info.url_hash));
19 s.BindBlob(1, &info.encrypted_data.front(), 19 s.BindBlob(1, &info.encrypted_data.front(),
20 static_cast<int>(info.encrypted_data.size())); 20 static_cast<int>(info.encrypted_data.size()));
(...skipping 19 matching lines...) Expand all
40 "WHERE url_hash == ? ")); 40 "WHERE url_hash == ? "));
41 s.BindString16(0, info.url_hash); 41 s.BindString16(0, info.url_hash);
42 42
43 if (s.Step()) { 43 if (s.Step()) {
44 s.ColumnBlobAsVector(0, &result->encrypted_data); 44 s.ColumnBlobAsVector(0, &result->encrypted_data);
45 result->date_created = base::Time::FromTimeT(s.ColumnInt64(1)); 45 result->date_created = base::Time::FromTimeT(s.ColumnInt64(1));
46 result->url_hash = info.url_hash; 46 result->url_hash = info.url_hash;
47 } 47 }
48 return s.Succeeded(); 48 return s.Succeeded();
49 } 49 }
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_store_win_unittest.cc ('k') | chrome/browser/webdata/web_data_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698