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

Side by Side Diff: chrome/browser/password_manager/password_store_win.cc

Issue 153043005: Autofilling passwords imported from IE more conservative (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updating unit test" Created 6 years, 10 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 | « no previous file | chrome/browser/password_manager/password_store_win_unittest.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) 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/password_manager/password_store_win.h" 5 #include "chrome/browser/password_manager/password_store_win.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // We got a result. 110 // We got a result.
111 // Delete the entry. If it's good we will add it to the real saved password 111 // Delete the entry. If it's good we will add it to the real saved password
112 // table. 112 // table.
113 web_data_service_->RemoveIE7Login(info); 113 web_data_service_->RemoveIE7Login(info);
114 std::vector<ie7_password::DecryptedCredentials> credentials; 114 std::vector<ie7_password::DecryptedCredentials> credentials;
115 std::wstring url = base::ASCIIToWide(form.origin.spec()); 115 std::wstring url = base::ASCIIToWide(form.origin.spec());
116 if (ie7_password::DecryptPasswords(url, 116 if (ie7_password::DecryptPasswords(url,
117 info.encrypted_data, 117 info.encrypted_data,
118 &credentials)) { 118 &credentials)) {
119 for (size_t i = 0; i < credentials.size(); ++i) { 119 for (size_t i = 0; i < credentials.size(); ++i) {
120 PasswordForm* autofill = new PasswordForm(form); 120 PasswordForm* autofill = new PasswordForm();
121 autofill->username_value = credentials[i].username; 121 autofill->username_value = credentials[i].username;
122 autofill->password_value = credentials[i].password; 122 autofill->password_value = credentials[i].password;
123 autofill->signon_realm = form.signon_realm;
124 autofill->origin = form.origin;
123 autofill->preferred = true; 125 autofill->preferred = true;
124 autofill->ssl_valid = form.origin.SchemeIsSecure(); 126 autofill->ssl_valid = form.origin.SchemeIsSecure();
125 autofill->date_created = info.date_created; 127 autofill->date_created = info.date_created;
128
126 matching_forms.push_back(autofill); 129 matching_forms.push_back(autofill);
127 // Add this PasswordForm to the saved password table. We're on the DB 130 // Add this PasswordForm to the saved password table. We're on the DB
128 // thread already, so we use AddLoginImpl. 131 // thread already, so we use AddLoginImpl.
129 password_store_->AddLoginImpl(*autofill); 132 password_store_->AddLoginImpl(*autofill);
130 } 133 }
131 } 134 }
132 } 135 }
133 return matching_forms; 136 return matching_forms;
134 } 137 }
135 138
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 204
202 void PasswordStoreWin::GetLoginsImpl( 205 void PasswordStoreWin::GetLoginsImpl(
203 const PasswordForm& form, 206 const PasswordForm& form,
204 AuthorizationPromptPolicy prompt_policy, 207 AuthorizationPromptPolicy prompt_policy,
205 const ConsumerCallbackRunner& callback_runner) { 208 const ConsumerCallbackRunner& callback_runner) {
206 ConsumerCallbackRunner get_ie7_login = 209 ConsumerCallbackRunner get_ie7_login =
207 base::Bind(&PasswordStoreWin::GetIE7LoginIfNecessary, 210 base::Bind(&PasswordStoreWin::GetIE7LoginIfNecessary,
208 this, form, callback_runner); 211 this, form, callback_runner);
209 PasswordStoreDefault::GetLoginsImpl(form, prompt_policy, get_ie7_login); 212 PasswordStoreDefault::GetLoginsImpl(form, prompt_policy, get_ie7_login);
210 } 213 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_store_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698