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 "chrome/browser/importer/nss_decryptor.h" | 5 #include "chrome/browser/importer/nss_decryptor.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // Version 3 has an extra line for further use. | 225 // Version 3 has an extra line for further use. |
226 if (version == 3) { | 226 if (version == 3) { |
227 ++begin; | 227 ++begin; |
228 } | 228 } |
229 | 229 |
230 forms->push_back(form); | 230 forms->push_back(form); |
231 } | 231 } |
232 } | 232 } |
233 } | 233 } |
234 | 234 |
235 bool NSSDecryptor::ReadAndParseSignons(const FilePath& sqlite_file, | 235 bool NSSDecryptor::ReadAndParseSignons(const base::FilePath& sqlite_file, |
236 std::vector<content::PasswordForm>* forms) { | 236 std::vector<content::PasswordForm>* forms) { |
237 sql::Connection db; | 237 sql::Connection db; |
238 if (!db.Open(sqlite_file)) | 238 if (!db.Open(sqlite_file)) |
239 return false; | 239 return false; |
240 | 240 |
241 const char* query = "SELECT hostname FROM moz_disabledHosts"; | 241 const char* query = "SELECT hostname FROM moz_disabledHosts"; |
242 sql::Statement s(db.GetUniqueStatement(query)); | 242 sql::Statement s(db.GetUniqueStatement(query)); |
243 if (!s.is_valid()) | 243 if (!s.is_valid()) |
244 return false; | 244 return false; |
245 | 245 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // The user name, password and action. | 290 // The user name, password and action. |
291 form.username_element = s2.ColumnString16(3); | 291 form.username_element = s2.ColumnString16(3); |
292 form.username_value = Decrypt(s2.ColumnString(5)); | 292 form.username_value = Decrypt(s2.ColumnString(5)); |
293 form.password_element = s2.ColumnString16(4); | 293 form.password_element = s2.ColumnString16(4); |
294 form.password_value = Decrypt(s2.ColumnString(6)); | 294 form.password_value = Decrypt(s2.ColumnString(6)); |
295 form.action = GURL(s2.ColumnString(2)).ReplaceComponents(rep); | 295 form.action = GURL(s2.ColumnString(2)).ReplaceComponents(rep); |
296 forms->push_back(form); | 296 forms->push_back(form); |
297 } | 297 } |
298 return true; | 298 return true; |
299 } | 299 } |
OLD | NEW |