| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/password_manager/password_manager.h" | 5 #include "chrome/browser/password_manager/password_manager.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/app/theme/theme_resources.h" | 8 #include "chrome/app/theme/theme_resources.h" |
| 9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
| 10 #include "chrome/browser/tab_contents/web_contents.h" | 10 #include "chrome/browser/tab_contents/web_contents.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 const PasswordFormMap& best_matches, | 221 const PasswordFormMap& best_matches, |
| 222 const PasswordForm* const preferred_match) const
{ | 222 const PasswordForm* const preferred_match) const
{ |
| 223 DCHECK(web_contents_); | 223 DCHECK(web_contents_); |
| 224 DCHECK(preferred_match); | 224 DCHECK(preferred_match); |
| 225 switch (form_for_autofill.scheme) { | 225 switch (form_for_autofill.scheme) { |
| 226 case PasswordForm::SCHEME_HTML: { | 226 case PasswordForm::SCHEME_HTML: { |
| 227 // Note the check above is required because the observer_ for a non-HTML | 227 // Note the check above is required because the observer_ for a non-HTML |
| 228 // schemed password form may have been freed, so we need to distinguish. | 228 // schemed password form may have been freed, so we need to distinguish. |
| 229 bool action_mismatch = form_for_autofill.action.GetWithEmptyPath() != | 229 bool action_mismatch = form_for_autofill.action.GetWithEmptyPath() != |
| 230 preferred_match->action.GetWithEmptyPath(); | 230 preferred_match->action.GetWithEmptyPath(); |
| 231 scoped_ptr<PasswordFormDomManager::FillData> fill_data( | 231 PasswordFormDomManager::FillData fill_data; |
| 232 PasswordFormDomManager::CreateFillData(form_for_autofill, | 232 PasswordFormDomManager::InitFillData(form_for_autofill, |
| 233 best_matches, preferred_match, | 233 best_matches, preferred_match, |
| 234 action_mismatch)); | 234 action_mismatch, |
| 235 web_contents_->render_view_host()->FillPasswordForm(*fill_data); | 235 &fill_data); |
| 236 web_contents_->render_view_host()->FillPasswordForm(fill_data); |
| 236 return; | 237 return; |
| 237 } | 238 } |
| 238 default: | 239 default: |
| 239 if (observer_) | 240 if (observer_) |
| 240 observer_->OnAutofillDataAvailable(preferred_match->username_value, | 241 observer_->OnAutofillDataAvailable(preferred_match->username_value, |
| 241 preferred_match->password_value); | 242 preferred_match->password_value); |
| 242 } | 243 } |
| 243 } | 244 } |
| 244 | 245 |
| OLD | NEW |