OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_delegate_impl.h" | 5 #include "chrome/browser/password_manager_delegate_impl.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/singleton.h" | 8 #include "base/singleton.h" |
9 #include "chrome/browser/password_manager/password_form_manager.h" | 9 #include "chrome/browser/password_manager/password_form_manager.h" |
10 #include "chrome/browser/password_manager/password_manager.h" | 10 #include "chrome/browser/password_manager/password_manager.h" |
11 #include "chrome/browser/renderer_host/render_view_host.h" | 11 #include "chrome/browser/renderer_host/render_view_host.h" |
12 #include "chrome/browser/tab_contents/infobar_delegate.h" | 12 #include "chrome/browser/tab_contents/infobar_delegate.h" |
13 #include "chrome/browser/tab_contents/tab_contents.h" | 13 #include "chrome/browser/tab_contents/tab_contents.h" |
| 14 #include "chrome/common/autofill_messages.h" |
14 #include "grit/chromium_strings.h" | 15 #include "grit/chromium_strings.h" |
15 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
16 #include "grit/theme_resources.h" | 17 #include "grit/theme_resources.h" |
17 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
18 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
19 #include "webkit/glue/password_form.h" | 20 #include "webkit/glue/password_form.h" |
20 | 21 |
21 // After a successful *new* login attempt, we take the PasswordFormManager in | 22 // After a successful *new* login attempt, we take the PasswordFormManager in |
22 // provisional_save_manager_ and move it to a SavePasswordInfoBarDelegate while | 23 // provisional_save_manager_ and move it to a SavePasswordInfoBarDelegate while |
23 // the user makes up their mind with the "save password" infobar. Note if the | 24 // the user makes up their mind with the "save password" infobar. Note if the |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 form_to_save_->PermanentlyBlacklist(); | 112 form_to_save_->PermanentlyBlacklist(); |
112 infobar_response_ = DONT_REMEMBER_PASSWORD; | 113 infobar_response_ = DONT_REMEMBER_PASSWORD; |
113 return true; | 114 return true; |
114 } | 115 } |
115 | 116 |
116 | 117 |
117 // PasswordManagerDelegateImpl ------------------------------------------------ | 118 // PasswordManagerDelegateImpl ------------------------------------------------ |
118 | 119 |
119 void PasswordManagerDelegateImpl::FillPasswordForm( | 120 void PasswordManagerDelegateImpl::FillPasswordForm( |
120 const webkit_glue::PasswordFormFillData& form_data) { | 121 const webkit_glue::PasswordFormFillData& form_data) { |
121 tab_contents_->render_view_host()->FillPasswordForm(form_data); | 122 tab_contents_->render_view_host()->Send(new AutoFillMsg_FillPasswordForm( |
| 123 tab_contents_->render_view_host()->routing_id(), form_data)); |
122 } | 124 } |
123 | 125 |
124 void PasswordManagerDelegateImpl::AddSavePasswordInfoBar( | 126 void PasswordManagerDelegateImpl::AddSavePasswordInfoBar( |
125 PasswordFormManager* form_to_save) { | 127 PasswordFormManager* form_to_save) { |
126 tab_contents_->AddInfoBar( | 128 tab_contents_->AddInfoBar( |
127 new SavePasswordInfoBarDelegate(tab_contents_, form_to_save)); | 129 new SavePasswordInfoBarDelegate(tab_contents_, form_to_save)); |
128 } | 130 } |
129 | 131 |
130 Profile* PasswordManagerDelegateImpl::GetProfileForPasswordManager() { | 132 Profile* PasswordManagerDelegateImpl::GetProfileForPasswordManager() { |
131 return tab_contents_->profile(); | 133 return tab_contents_->profile(); |
132 } | 134 } |
133 | 135 |
134 bool PasswordManagerDelegateImpl::DidLastPageLoadEncounterSSLErrors() { | 136 bool PasswordManagerDelegateImpl::DidLastPageLoadEncounterSSLErrors() { |
135 return tab_contents_->controller().ssl_manager()-> | 137 return tab_contents_->controller().ssl_manager()-> |
136 ProcessedSSLErrorFromRequest(); | 138 ProcessedSSLErrorFromRequest(); |
137 } | 139 } |
OLD | NEW |