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

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

Issue 548953002: [Password Manager] Modified to support saving passwords on forms without username fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit-tests and fixed lint errors. Created 6 years, 3 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 "components/password_manager/core/browser/password_manager.h" 5 #include "components/password_manager/core/browser/password_manager.h"
6 6
7 #include <string>
vabr (Chromium) 2014/09/15 13:01:45 Another change which should have a separate clean-
Pritam Nikam 2014/09/15 15:02:08 Done.
8
7 #include "base/command_line.h" 9 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
9 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
10 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
11 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
12 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
13 #include "base/threading/platform_thread.h" 15 #include "base/threading/platform_thread.h"
14 #include "components/autofill/core/common/password_autofill_util.h" 16 #include "components/autofill/core/common/password_autofill_util.h"
15 #include "components/password_manager/core/browser/browser_save_password_progres s_logger.h" 17 #include "components/password_manager/core/browser/browser_save_password_progres s_logger.h"
16 #include "components/password_manager/core/browser/password_autofill_manager.h" 18 #include "components/password_manager/core/browser/password_autofill_manager.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 client_->GetAuthorizationPromptPolicy(*iter); 396 client_->GetAuthorizationPromptPolicy(*iter);
395 397
396 manager->FetchMatchingLoginsFromPasswordStore(prompt_policy); 398 manager->FetchMatchingLoginsFromPasswordStore(prompt_policy);
397 } 399 }
398 } 400 }
399 401
400 bool PasswordManager::ShouldPromptUserToSavePassword() const { 402 bool PasswordManager::ShouldPromptUserToSavePassword() const {
401 return !client_->IsAutomaticPasswordSavingEnabled() && 403 return !client_->IsAutomaticPasswordSavingEnabled() &&
402 provisional_save_manager_->IsNewLogin() && 404 provisional_save_manager_->IsNewLogin() &&
403 !provisional_save_manager_->HasGeneratedPassword() && 405 !provisional_save_manager_->HasGeneratedPassword() &&
404 !provisional_save_manager_->IsPendingCredentialsPublicSuffixMatch(); 406 !provisional_save_manager_->IsPendingCredentialsPublicSuffixMatch() &&
407 provisional_save_manager_->HasValidLogin();
vabr (Chromium) 2014/09/15 13:01:45 As explained in the browsertest above, there shoul
Pritam Nikam 2014/09/15 15:02:08 Done.
405 } 408 }
406 409
407 void PasswordManager::OnPasswordFormsRendered( 410 void PasswordManager::OnPasswordFormsRendered(
408 const std::vector<PasswordForm>& visible_forms, 411 const std::vector<PasswordForm>& visible_forms,
409 bool did_stop_loading) { 412 bool did_stop_loading) {
410 CreatePendingLoginManagers(visible_forms); 413 CreatePendingLoginManagers(visible_forms);
411 scoped_ptr<BrowserSavePasswordProgressLogger> logger; 414 scoped_ptr<BrowserSavePasswordProgressLogger> logger;
412 if (client_->IsLoggingActive()) { 415 if (client_->IsLoggingActive()) {
413 logger.reset(new BrowserSavePasswordProgressLogger(client_)); 416 logger.reset(new BrowserSavePasswordProgressLogger(client_));
414 logger->LogMessage(Logger::STRING_ON_PASSWORD_FORMS_RENDERED_METHOD); 417 logger->LogMessage(Logger::STRING_ON_PASSWORD_FORMS_RENDERED_METHOD);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 observers_, 564 observers_,
562 OnAutofillDataAvailable(preferred_match.username_value, 565 OnAutofillDataAvailable(preferred_match.username_value,
563 preferred_match.password_value)); 566 preferred_match.password_value));
564 break; 567 break;
565 } 568 }
566 569
567 client_->PasswordWasAutofilled(best_matches); 570 client_->PasswordWasAutofilled(best_matches);
568 } 571 }
569 572
570 } // namespace password_manager 573 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698