OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "chrome/common/sqlite_utils.h" | 12 #include "chrome/common/sqlite_utils.h" |
13 | 13 |
14 #if defined(USE_NSS) | 14 #if defined(USE_NSS) |
15 #include <pk11pub.h> | 15 #include <pk11pub.h> |
16 #include <pk11sdr.h> | 16 #include <pk11sdr.h> |
17 #endif // defined(USE_NSS) | 17 #endif // defined(USE_NSS) |
18 | 18 |
19 #include "base/base64.h" | 19 #include "base/base64.h" |
| 20 #include "base/string_split.h" |
20 #include "base/string_util.h" | 21 #include "base/string_util.h" |
21 #include "base/utf_string_conversions.h" | 22 #include "base/utf_string_conversions.h" |
22 #include "webkit/glue/password_form.h" | 23 #include "webkit/glue/password_form.h" |
23 | 24 |
24 using webkit_glue::PasswordForm; | 25 using webkit_glue::PasswordForm; |
25 | 26 |
26 // This method is based on some Firefox code in | 27 // This method is based on some Firefox code in |
27 // security/manager/ssl/src/nsSDR.cpp | 28 // security/manager/ssl/src/nsSDR.cpp |
28 // The license block is: | 29 // The license block is: |
29 | 30 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 // The user name, password and action. | 293 // The user name, password and action. |
293 form.username_element = UTF8ToUTF16(s2.column_string(3)); | 294 form.username_element = UTF8ToUTF16(s2.column_string(3)); |
294 form.username_value = Decrypt(s2.column_string(5)); | 295 form.username_value = Decrypt(s2.column_string(5)); |
295 form.password_element = UTF8ToUTF16(s2.column_string(4)); | 296 form.password_element = UTF8ToUTF16(s2.column_string(4)); |
296 form.password_value = Decrypt(s2.column_string(6)); | 297 form.password_value = Decrypt(s2.column_string(6)); |
297 form.action = GURL(s2.column_string(2)).ReplaceComponents(rep); | 298 form.action = GURL(s2.column_string(2)).ReplaceComponents(rep); |
298 forms->push_back(form); | 299 forms->push_back(form); |
299 } | 300 } |
300 return true; | 301 return true; |
301 } | 302 } |
OLD | NEW |