| OLD | NEW |
| 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/autofill/renderer/password_generation_manager.h" | 5 #include "components/autofill/renderer/password_generation_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "components/autofill/common/autofill_messages.h" | 8 #include "components/autofill/common/autofill_messages.h" |
| 9 #include "components/autofill/common/password_generation_util.h" | 9 #include "components/autofill/common/password_generation_util.h" |
| 10 #include "content/public/renderer/password_form_conversion_utils.h" | 10 #include "content/public/renderer/password_form_conversion_utils.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 IPC_END_MESSAGE_MAP() | 208 IPC_END_MESSAGE_MAP() |
| 209 return handled; | 209 return handled; |
| 210 } | 210 } |
| 211 | 211 |
| 212 void PasswordGenerationManager::OnFormNotBlacklisted( | 212 void PasswordGenerationManager::OnFormNotBlacklisted( |
| 213 const content::PasswordForm& form) { | 213 const content::PasswordForm& form) { |
| 214 not_blacklisted_password_form_origins_.push_back(form.origin); | 214 not_blacklisted_password_form_origins_.push_back(form.origin); |
| 215 MaybeShowIcon(); | 215 MaybeShowIcon(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 void PasswordGenerationManager::OnPasswordAccepted(const string16& password) { | 218 void PasswordGenerationManager::OnPasswordAccepted( |
| 219 const base::string16& password) { |
| 219 for (std::vector<WebKit::WebInputElement>::iterator it = passwords_.begin(); | 220 for (std::vector<WebKit::WebInputElement>::iterator it = passwords_.begin(); |
| 220 it != passwords_.end(); ++it) { | 221 it != passwords_.end(); ++it) { |
| 221 it->setValue(password); | 222 it->setValue(password); |
| 222 it->setAutofilled(true); | 223 it->setAutofilled(true); |
| 223 // Advance focus to the next input field. We assume password fields in | 224 // Advance focus to the next input field. We assume password fields in |
| 224 // an account creation form are always adjacent. | 225 // an account creation form are always adjacent. |
| 225 render_view_->GetWebView()->advanceFocus(false); | 226 render_view_->GetWebView()->advanceFocus(false); |
| 226 } | 227 } |
| 227 } | 228 } |
| 228 | 229 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 247 passwords_[0].decorationElementFor(this).setAttribute("style", | 248 passwords_[0].decorationElementFor(this).setAttribute("style", |
| 248 "display:block"); | 249 "display:block"); |
| 249 password_generation::LogPasswordGenerationEvent( | 250 password_generation::LogPasswordGenerationEvent( |
| 250 password_generation::ICON_SHOWN); | 251 password_generation::ICON_SHOWN); |
| 251 return; | 252 return; |
| 252 } | 253 } |
| 253 } | 254 } |
| 254 } | 255 } |
| 255 | 256 |
| 256 } // namespace autofill | 257 } // namespace autofill |
| OLD | NEW |