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.h" | 5 #include "chrome/browser/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/web_contents.h" | 10 #include "chrome/browser/web_contents.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 switch (form_for_autofill.scheme) { | 165 switch (form_for_autofill.scheme) { |
166 case PasswordForm::SCHEME_HTML: { | 166 case PasswordForm::SCHEME_HTML: { |
167 // Note the check above is required because the observer_ for a non-HTML | 167 // Note the check above is required because the observer_ for a non-HTML |
168 // schemed password form may have been freed, so we need to distinguish. | 168 // schemed password form may have been freed, so we need to distinguish. |
169 bool action_mismatch = form_for_autofill.action.GetWithEmptyPath() != | 169 bool action_mismatch = form_for_autofill.action.GetWithEmptyPath() != |
170 preferred_match->action.GetWithEmptyPath(); | 170 preferred_match->action.GetWithEmptyPath(); |
171 scoped_ptr<PasswordFormDomManager::FillData> fill_data( | 171 scoped_ptr<PasswordFormDomManager::FillData> fill_data( |
172 PasswordFormDomManager::CreateFillData(form_for_autofill, | 172 PasswordFormDomManager::CreateFillData(form_for_autofill, |
173 best_matches, preferred_match, | 173 best_matches, preferred_match, |
174 action_mismatch)); | 174 action_mismatch)); |
175 web_contents_->FillPasswordForm(*fill_data); | 175 web_contents_->render_view_host()->FillPasswordForm(*fill_data); |
176 return; | 176 return; |
177 } | 177 } |
178 default: | 178 default: |
179 if (observer_) | 179 if (observer_) |
180 observer_->OnAutofillDataAvailable(preferred_match->username_value, | 180 observer_->OnAutofillDataAvailable(preferred_match->username_value, |
181 preferred_match->password_value); | 181 preferred_match->password_value); |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 void PasswordManager::CloseBars() { | 185 void PasswordManager::CloseBars() { |
(...skipping 30 matching lines...) Expand all Loading... |
216 | 216 |
217 void PasswordManager::SavePasswordBar::OKButtonPressed() { | 217 void PasswordManager::SavePasswordBar::OKButtonPressed() { |
218 form_manager_->Save(); | 218 form_manager_->Save(); |
219 BeginClose(); | 219 BeginClose(); |
220 } | 220 } |
221 | 221 |
222 void PasswordManager::SavePasswordBar::CancelButtonPressed() { | 222 void PasswordManager::SavePasswordBar::CancelButtonPressed() { |
223 form_manager_->PermanentlyBlacklist(); | 223 form_manager_->PermanentlyBlacklist(); |
224 BeginClose(); | 224 BeginClose(); |
225 } | 225 } |
OLD | NEW |