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

Side by Side Diff: components/autofill/content/renderer/password_generation_agent.cc

Issue 2893903002: [Password Generation] Set TYPE_GENERATED to presaved credentials (Closed)
Patch Set: Created 3 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
« no previous file with comments | « chrome/renderer/autofill/fake_content_password_manager_driver.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/autofill/content/renderer/password_generation_agent.h" 5 #include "components/autofill/content/renderer/password_generation_agent.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 // change username and password values. 347 // change username and password values.
348 std::unique_ptr<PasswordForm> password_form; 348 std::unique_ptr<PasswordForm> password_form;
349 if (!generation_element_.Form().IsNull()) { 349 if (!generation_element_.Form().IsNull()) {
350 password_form = CreatePasswordFormFromWebForm(generation_element_.Form(), 350 password_form = CreatePasswordFormFromWebForm(generation_element_.Form(),
351 nullptr, nullptr); 351 nullptr, nullptr);
352 } else { 352 } else {
353 password_form = CreatePasswordFormFromUnownedInputElements( 353 password_form = CreatePasswordFormFromUnownedInputElements(
354 *render_frame()->GetWebFrame(), nullptr, nullptr); 354 *render_frame()->GetWebFrame(), nullptr, nullptr);
355 } 355 }
356 if (password_form) { 356 if (password_form) {
357 password_form->type = PasswordForm::TYPE_GENERATED;
357 // TODO(kolos): when we are good in username detection, save username 358 // TODO(kolos): when we are good in username detection, save username
358 // as well. 359 // as well.
359 password_form->username_value = base::string16(); 360 password_form->username_value = base::string16();
360 password_form->password_value = generation_element_.Value().Utf16(); 361 password_form->password_value = generation_element_.Value().Utf16();
361 } 362 }
362 363
363 return password_form; 364 return password_form;
364 } 365 }
365 366
366 void PasswordGenerationAgent::FoundFormsEligibleForGeneration( 367 void PasswordGenerationAgent::FoundFormsEligibleForGeneration(
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 625
625 void PasswordGenerationAgent::LogNumber(Logger::StringID message_id, 626 void PasswordGenerationAgent::LogNumber(Logger::StringID message_id,
626 int number) { 627 int number) {
627 if (!password_agent_->logging_state_active()) 628 if (!password_agent_->logging_state_active())
628 return; 629 return;
629 RendererSavePasswordProgressLogger logger(GetPasswordManagerDriver().get()); 630 RendererSavePasswordProgressLogger logger(GetPasswordManagerDriver().get());
630 logger.LogNumber(message_id, number); 631 logger.LogNumber(message_id, number);
631 } 632 }
632 633
633 } // namespace autofill 634 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/renderer/autofill/fake_content_password_manager_driver.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698