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

Side by Side Diff: components/autofill/core/browser/password_autofill_manager.cc

Issue 208453002: Add "previewing on hover" support for password field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "components/autofill/core/browser/autofill_driver.h" 6 #include "components/autofill/core/browser/autofill_driver.h"
7 #include "components/autofill/core/browser/password_autofill_manager.h" 7 #include "components/autofill/core/browser/password_autofill_manager.h"
8 #include "ui/events/keycodes/keyboard_codes.h" 8 #include "ui/events/keycodes/keyboard_codes.h"
9 9
10 namespace autofill { 10 namespace autofill {
11 11
12 //////////////////////////////////////////////////////////////////////////////// 12 ////////////////////////////////////////////////////////////////////////////////
13 // PasswordAutofillManager, public: 13 // PasswordAutofillManager, public:
14 14
15 PasswordAutofillManager::PasswordAutofillManager( 15 PasswordAutofillManager::PasswordAutofillManager(
16 AutofillDriver* autofill_driver) : autofill_driver_(autofill_driver) { 16 AutofillDriver* autofill_driver) : autofill_driver_(autofill_driver) {
17 DCHECK(autofill_driver); 17 DCHECK(autofill_driver);
18 } 18 }
19 19
20 PasswordAutofillManager::~PasswordAutofillManager() { 20 PasswordAutofillManager::~PasswordAutofillManager() {
21 } 21 }
22 22
23 bool PasswordAutofillManager::DidSelectAutofillSuggestion(
24 const FormFieldData& field,
25 const base::string16& username) {
26 PasswordFormFillData password;
27 if (!FindLoginInfo(field, &password))
28 return false;
29
30 if (WillFillUserNameAndPassword(username, password)) {
31 autofill_driver_->RendererShouldPreviewPassword(username);
Ilya Sherman 2014/03/21 22:35:19 Can we send both the username and the password dow
ziran.sun 2014/03/25 18:25:26 I might have a quick work on DidAcceptAutofillSugg
Ilya Sherman 2014/03/25 19:45:27 Sounds great -- thanks! I've filed http://crbug.c
32 return true;
33 }
34
35 return false;
36 }
37
23 bool PasswordAutofillManager::DidAcceptAutofillSuggestion( 38 bool PasswordAutofillManager::DidAcceptAutofillSuggestion(
24 const FormFieldData& field, 39 const FormFieldData& field,
25 const base::string16& username) { 40 const base::string16& username) {
26 PasswordFormFillData password; 41 PasswordFormFillData password;
27 if (!FindLoginInfo(field, &password)) 42 if (!FindLoginInfo(field, &password))
28 return false; 43 return false;
29 44
30 if (WillFillUserNameAndPassword(username, password)) { 45 if (WillFillUserNameAndPassword(username, password)) {
31 autofill_driver_->RendererShouldAcceptPasswordAutofillSuggestion(username); 46 autofill_driver_->RendererShouldAcceptPasswordAutofillSuggestion(username);
32 return true; 47 return true;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 PasswordFormFillData* found_password) { 96 PasswordFormFillData* found_password) {
82 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(field); 97 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(field);
83 if (iter == login_to_password_info_.end()) 98 if (iter == login_to_password_info_.end())
84 return false; 99 return false;
85 100
86 *found_password = iter->second; 101 *found_password = iter->second;
87 return true; 102 return true;
88 } 103 }
89 104
90 } // namespace autofill 105 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698