OLD | NEW |
---|---|
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 "components/autofill/core/common/autofill_messages.h" | |
8 #include "ui/events/keycodes/keyboard_codes.h" | 9 #include "ui/events/keycodes/keyboard_codes.h" |
9 | 10 |
10 namespace autofill { | 11 namespace autofill { |
11 | 12 |
12 //////////////////////////////////////////////////////////////////////////////// | 13 //////////////////////////////////////////////////////////////////////////////// |
13 // PasswordAutofillManager, public: | 14 // PasswordAutofillManager, public: |
14 | 15 |
15 PasswordAutofillManager::PasswordAutofillManager( | 16 PasswordAutofillManager::PasswordAutofillManager( |
16 AutofillDriver* autofill_driver) : autofill_driver_(autofill_driver) { | 17 AutofillDriver* autofill_driver) : autofill_driver_(autofill_driver) { |
17 DCHECK(autofill_driver); | 18 DCHECK(autofill_driver); |
(...skipping 16 matching lines...) Expand all Loading... | |
34 | 35 |
35 return false; | 36 return false; |
36 } | 37 } |
37 | 38 |
38 void PasswordAutofillManager::AddPasswordFormMapping( | 39 void PasswordAutofillManager::AddPasswordFormMapping( |
39 const FormFieldData& username_element, | 40 const FormFieldData& username_element, |
40 const PasswordFormFillData& password) { | 41 const PasswordFormFillData& password) { |
41 login_to_password_info_[username_element] = password; | 42 login_to_password_info_[username_element] = password; |
42 } | 43 } |
43 | 44 |
45 bool PasswordAutofillManager::RemovePasswordSuggestion( | |
46 const FormFieldData& field, | |
47 const PasswordForm& passwordform) { | |
48 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(field); | |
49 if (iter == login_to_password_info_.end()) | |
50 return false; | |
51 login_to_password_info_.erase(iter); | |
52 | |
53 scoped_ptr<PasswordForm> password_form = CreatePasswordForm(form); | |
54 | |
55 Send(new AutofillHostMsg_RemovePasswordSuggestion( | |
56 routing_id(), | |
57 password_form.get())); | |
vabr (Chromium)
2014/01/13 14:46:29
*password_form
(dereference instead of getting a p
riadh.chtara
2014/01/13 20:34:10
Done.
vabr (Chromium)
2014/01/14 14:11:02
Does not look done -- there is still .get() instea
| |
58 return true; | |
59 } | |
60 | |
44 void PasswordAutofillManager::Reset() { | 61 void PasswordAutofillManager::Reset() { |
45 login_to_password_info_.clear(); | 62 login_to_password_info_.clear(); |
46 } | 63 } |
47 | 64 |
48 //////////////////////////////////////////////////////////////////////////////// | 65 //////////////////////////////////////////////////////////////////////////////// |
49 // PasswordAutofillManager, private: | 66 // PasswordAutofillManager, private: |
50 | 67 |
51 bool PasswordAutofillManager::WillFillUserNameAndPassword( | 68 bool PasswordAutofillManager::WillFillUserNameAndPassword( |
52 const base::string16& current_username, | 69 const base::string16& current_username, |
53 const PasswordFormFillData& fill_data) { | 70 const PasswordFormFillData& fill_data) { |
(...skipping 27 matching lines...) Expand all Loading... | |
81 PasswordFormFillData* found_password) { | 98 PasswordFormFillData* found_password) { |
82 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(field); | 99 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(field); |
83 if (iter == login_to_password_info_.end()) | 100 if (iter == login_to_password_info_.end()) |
84 return false; | 101 return false; |
85 | 102 |
86 *found_password = iter->second; | 103 *found_password = iter->second; |
87 return true; | 104 return true; |
88 } | 105 } |
89 | 106 |
90 } // namespace autofill | 107 } // namespace autofill |
OLD | NEW |