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

Side by Side Diff: components/password_manager/core/browser/password_manager.cc

Issue 184103016: Autofill: Refactoring to support fetching password after a username is selected (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actually fix compile failure. Created 6 years, 7 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 | Annotate | Revision Log
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 "components/password_manager/core/browser/password_manager.h" 5 #include "components/password_manager/core/browser/password_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/threading/platform_thread.h" 13 #include "base/threading/platform_thread.h"
14 #include "components/autofill/core/common/password_autofill_util.h" 14 #include "components/autofill/core/common/password_autofill_util.h"
15 #include "components/password_manager/core/browser/password_autofill_manager.h"
15 #include "components/password_manager/core/browser/password_form_manager.h" 16 #include "components/password_manager/core/browser/password_form_manager.h"
16 #include "components/password_manager/core/browser/password_manager_client.h" 17 #include "components/password_manager/core/browser/password_manager_client.h"
17 #include "components/password_manager/core/browser/password_manager_driver.h" 18 #include "components/password_manager/core/browser/password_manager_driver.h"
18 #include "components/password_manager/core/browser/password_manager_metrics_util .h" 19 #include "components/password_manager/core/browser/password_manager_metrics_util .h"
19 #include "components/password_manager/core/common/password_manager_pref_names.h" 20 #include "components/password_manager/core/common/password_manager_pref_names.h"
20 #include "components/user_prefs/pref_registry_syncable.h" 21 #include "components/user_prefs/pref_registry_syncable.h"
21 22
22 using autofill::PasswordForm; 23 using autofill::PasswordForm;
23 using autofill::PasswordFormMap; 24 using autofill::PasswordFormMap;
24 25
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 observers_.AddObserver(observer); 222 observers_.AddObserver(observer);
222 } 223 }
223 224
224 void PasswordManager::RemoveObserver(LoginModelObserver* observer) { 225 void PasswordManager::RemoveObserver(LoginModelObserver* observer) {
225 observers_.RemoveObserver(observer); 226 observers_.RemoveObserver(observer);
226 } 227 }
227 228
228 void PasswordManager::DidNavigateMainFrame(bool is_in_page) { 229 void PasswordManager::DidNavigateMainFrame(bool is_in_page) {
229 // Clear data after main frame navigation if the navigation was to a 230 // Clear data after main frame navigation if the navigation was to a
230 // different page. 231 // different page.
231 if (!is_in_page) 232 if (!is_in_page) {
232 pending_login_managers_.clear(); 233 pending_login_managers_.clear();
234 driver_->GetPasswordAutofillManager()->Reset();
235 }
233 } 236 }
234 237
235 void PasswordManager::OnPasswordFormSubmitted( 238 void PasswordManager::OnPasswordFormSubmitted(
236 const PasswordForm& password_form) { 239 const PasswordForm& password_form) {
237 ProvisionallySavePassword(password_form); 240 ProvisionallySavePassword(password_form);
238 for (size_t i = 0; i < submission_callbacks_.size(); ++i) { 241 for (size_t i = 0; i < submission_callbacks_.size(); ++i) {
239 submission_callbacks_[i].Run(password_form); 242 submission_callbacks_[i].Run(password_form);
240 } 243 }
241 244
242 pending_login_managers_.clear(); 245 pending_login_managers_.clear();
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 observers_, 390 observers_,
388 OnAutofillDataAvailable(preferred_match.username_value, 391 OnAutofillDataAvailable(preferred_match.username_value,
389 preferred_match.password_value)); 392 preferred_match.password_value));
390 break; 393 break;
391 } 394 }
392 395
393 client_->PasswordWasAutofilled(best_matches); 396 client_->PasswordWasAutofilled(best_matches);
394 } 397 }
395 398
396 } // namespace password_manager 399 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698