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

Side by Side Diff: chrome/browser/importer/nss_decryptor.cc

Issue 3750001: base: Move SplitString functions into the base namespace and update the callers. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: brett review, reverted changes in o3d due to it's using an old base revision Created 10 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
« no previous file with comments | « chrome/browser/importer/ie_importer.cc ('k') | chrome/browser/importer/toolbar_importer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // References: 112 // References:
113 // http://kb.mozillazine.org/Signons.txt 113 // http://kb.mozillazine.org/Signons.txt
114 // http://kb.mozillazine.org/Signons2.txt 114 // http://kb.mozillazine.org/Signons2.txt
115 // http://kb.mozillazine.org/Signons3.txt 115 // http://kb.mozillazine.org/Signons3.txt
116 void NSSDecryptor::ParseSignons(const std::string& content, 116 void NSSDecryptor::ParseSignons(const std::string& content,
117 std::vector<PasswordForm>* forms) { 117 std::vector<PasswordForm>* forms) {
118 forms->clear(); 118 forms->clear();
119 119
120 // Splits the file content into lines. 120 // Splits the file content into lines.
121 std::vector<std::string> lines; 121 std::vector<std::string> lines;
122 SplitString(content, '\n', &lines); 122 base::SplitString(content, '\n', &lines);
123 123
124 // The first line is the file version. We skip the unknown versions. 124 // The first line is the file version. We skip the unknown versions.
125 if (lines.empty()) 125 if (lines.empty())
126 return; 126 return;
127 int version; 127 int version;
128 if (lines[0] == "#2c") 128 if (lines[0] == "#2c")
129 version = 1; 129 version = 1;
130 else if (lines[0] == "#2d") 130 else if (lines[0] == "#2d")
131 version = 2; 131 version = 2;
132 else if (lines[0] == "#2e") 132 else if (lines[0] == "#2e")
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 // The user name, password and action. 293 // The user name, password and action.
294 form.username_element = UTF8ToUTF16(s2.column_string(3)); 294 form.username_element = UTF8ToUTF16(s2.column_string(3));
295 form.username_value = Decrypt(s2.column_string(5)); 295 form.username_value = Decrypt(s2.column_string(5));
296 form.password_element = UTF8ToUTF16(s2.column_string(4)); 296 form.password_element = UTF8ToUTF16(s2.column_string(4));
297 form.password_value = Decrypt(s2.column_string(6)); 297 form.password_value = Decrypt(s2.column_string(6));
298 form.action = GURL(s2.column_string(2)).ReplaceComponents(rep); 298 form.action = GURL(s2.column_string(2)).ReplaceComponents(rep);
299 forms->push_back(form); 299 forms->push_back(form);
300 } 300 }
301 return true; 301 return true;
302 } 302 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/ie_importer.cc ('k') | chrome/browser/importer/toolbar_importer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698