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

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

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 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) 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/utility/importer/nss_decryptor.h" 5 #include "chrome/utility/importer/nss_decryptor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 base::JSONReader::Read(json_content)); 299 base::JSONReader::Read(json_content));
300 const base::DictionaryValue* password_dict; 300 const base::DictionaryValue* password_dict;
301 const base::ListValue* password_list; 301 const base::ListValue* password_list;
302 const base::ListValue* blacklist_domains; 302 const base::ListValue* blacklist_domains;
303 if (!parsed_json || !parsed_json->GetAsDictionary(&password_dict)) 303 if (!parsed_json || !parsed_json->GetAsDictionary(&password_dict))
304 return false; 304 return false;
305 305
306 if (password_dict->GetList("disabledHosts", &blacklist_domains)) { 306 if (password_dict->GetList("disabledHosts", &blacklist_domains)) {
307 for (const auto& value : *blacklist_domains) { 307 for (const auto& value : *blacklist_domains) {
308 std::string disabled_host; 308 std::string disabled_host;
309 if (!value.GetAsString(&disabled_host)) 309 if (!value->GetAsString(&disabled_host))
310 continue; 310 continue;
311 forms->push_back(CreateBlacklistPasswordForm(disabled_host)); 311 forms->push_back(CreateBlacklistPasswordForm(disabled_host));
312 } 312 }
313 } 313 }
314 314
315 if (password_dict->GetList("logins", &password_list)) { 315 if (password_dict->GetList("logins", &password_list)) {
316 for (const auto& value : *password_list) { 316 for (const auto& value : *password_list) {
317 const base::DictionaryValue* password_detail; 317 const base::DictionaryValue* password_detail;
318 if (!value.GetAsDictionary(&password_detail)) 318 if (!value->GetAsDictionary(&password_detail))
319 continue; 319 continue;
320 320
321 FirefoxRawPasswordInfo raw_password_info; 321 FirefoxRawPasswordInfo raw_password_info;
322 password_detail->GetString("hostname", &raw_password_info.host); 322 password_detail->GetString("hostname", &raw_password_info.host);
323 password_detail->GetString("usernameField", 323 password_detail->GetString("usernameField",
324 &raw_password_info.username_element); 324 &raw_password_info.username_element);
325 password_detail->GetString("passwordField", 325 password_detail->GetString("passwordField",
326 &raw_password_info.password_element); 326 &raw_password_info.password_element);
327 password_detail->GetString("encryptedUsername", 327 password_detail->GetString("encryptedUsername",
328 &raw_password_info.encrypted_username); 328 &raw_password_info.encrypted_username);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 form->scheme = autofill::PasswordForm::SCHEME_BASIC; 372 form->scheme = autofill::PasswordForm::SCHEME_BASIC;
373 } 373 }
374 form->username_element = raw_password_info.username_element; 374 form->username_element = raw_password_info.username_element;
375 form->username_value = Decrypt(raw_password_info.encrypted_username); 375 form->username_value = Decrypt(raw_password_info.encrypted_username);
376 form->password_element = raw_password_info.password_element; 376 form->password_element = raw_password_info.password_element;
377 form->password_value = Decrypt(raw_password_info.encrypted_password); 377 form->password_value = Decrypt(raw_password_info.encrypted_password);
378 form->action = GURL(raw_password_info.form_action).ReplaceComponents(rep); 378 form->action = GURL(raw_password_info.form_action).ReplaceComponents(rep);
379 379
380 return true; 380 return true;
381 } 381 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/performance_logger.cc ('k') | chromecast/crash/linux/crash_testing_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698