Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: components/password_manager/content/browser/content_password_manager_driver.cc

Issue 2414913003: Inform WebContents when a password field is visible (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/password_manager/content/browser/content_password_manager_d river.h" 5 #include "components/password_manager/content/browser/content_password_manager_d river.h"
6 6
7 #include "components/autofill/content/browser/content_autofill_driver.h" 7 #include "components/autofill/content/browser/content_autofill_driver.h"
8 #include "components/autofill/core/common/form_data.h" 8 #include "components/autofill/core/common/form_data.h"
9 #include "components/autofill/core/common/password_form.h" 9 #include "components/autofill/core/common/password_form.h"
10 #include "components/password_manager/content/browser/bad_message.h" 10 #include "components/password_manager/content/browser/bad_message.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 for (const auto& form : forms) 167 for (const auto& form : forms)
168 if (!CheckChildProcessSecurityPolicy( 168 if (!CheckChildProcessSecurityPolicy(
169 form.origin, BadMessageReason::CPMD_BAD_ORIGIN_FORMS_PARSED)) 169 form.origin, BadMessageReason::CPMD_BAD_ORIGIN_FORMS_PARSED))
170 return; 170 return;
171 171
172 OnPasswordFormsParsedNoRenderCheck(forms); 172 OnPasswordFormsParsedNoRenderCheck(forms);
173 } 173 }
174 174
175 void ContentPasswordManagerDriver::OnPasswordFormsParsedNoRenderCheck( 175 void ContentPasswordManagerDriver::OnPasswordFormsParsedNoRenderCheck(
176 const std::vector<autofill::PasswordForm>& forms) { 176 const std::vector<autofill::PasswordForm>& forms) {
177 MaybeNotifyPasswordInputShownOnHttp(render_frame_host_);
178 GetPasswordManager()->OnPasswordFormsParsed(this, forms); 177 GetPasswordManager()->OnPasswordFormsParsed(this, forms);
179 GetPasswordGenerationManager()->CheckIfFormClassifierShouldRun(); 178 GetPasswordGenerationManager()->CheckIfFormClassifierShouldRun();
180 } 179 }
181 180
182 void ContentPasswordManagerDriver::PasswordFormsRendered( 181 void ContentPasswordManagerDriver::PasswordFormsRendered(
183 const std::vector<autofill::PasswordForm>& visible_forms, 182 const std::vector<autofill::PasswordForm>& visible_forms,
184 bool did_stop_loading) { 183 bool did_stop_loading) {
185 for (const auto& form : visible_forms) 184 for (const auto& form : visible_forms)
186 if (!CheckChildProcessSecurityPolicy( 185 if (!CheckChildProcessSecurityPolicy(
187 form.origin, BadMessageReason::CPMD_BAD_ORIGIN_FORMS_RENDERED)) 186 form.origin, BadMessageReason::CPMD_BAD_ORIGIN_FORMS_RENDERED))
(...skipping 14 matching lines...) Expand all
202 void ContentPasswordManagerDriver::OnFocusedPasswordFormFound( 201 void ContentPasswordManagerDriver::OnFocusedPasswordFormFound(
203 const autofill::PasswordForm& password_form) { 202 const autofill::PasswordForm& password_form) {
204 if (!CheckChildProcessSecurityPolicy( 203 if (!CheckChildProcessSecurityPolicy(
205 password_form.origin, 204 password_form.origin,
206 BadMessageReason::CPMD_BAD_ORIGIN_FOCUSED_PASSWORD_FORM_FOUND)) 205 BadMessageReason::CPMD_BAD_ORIGIN_FOCUSED_PASSWORD_FORM_FOUND))
207 return; 206 return;
208 GetPasswordManager()->OnPasswordFormForceSaveRequested(this, password_form); 207 GetPasswordManager()->OnPasswordFormForceSaveRequested(this, password_form);
209 } 208 }
210 209
211 void ContentPasswordManagerDriver::PasswordFieldVisibleInInsecureContext() { 210 void ContentPasswordManagerDriver::PasswordFieldVisibleInInsecureContext() {
212 // TODO(estark): notify the WebContents that a password field was 211 MaybeNotifyPasswordInputShownOnHttp(render_frame_host_);
213 // shown, which will downgrade the security UI
214 // appropriately. https://crbug.com/647560
215 } 212 }
216 213
217 void ContentPasswordManagerDriver::DidNavigateFrame( 214 void ContentPasswordManagerDriver::DidNavigateFrame(
218 const content::LoadCommittedDetails& details, 215 const content::LoadCommittedDetails& details,
219 const content::FrameNavigateParams& params) { 216 const content::FrameNavigateParams& params) {
220 // Clear page specific data after main frame navigation. 217 // Clear page specific data after main frame navigation.
221 if (!render_frame_host_->GetParent() && !details.is_in_page) { 218 if (!render_frame_host_->GetParent() && !details.is_in_page) {
222 GetPasswordManager()->DidNavigateMainFrame(); 219 GetPasswordManager()->DidNavigateMainFrame();
223 GetPasswordAutofillManager()->DidNavigateMainFrame(); 220 GetPasswordAutofillManager()->DidNavigateMainFrame();
224 } 221 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 ContentPasswordManagerDriver::GetPasswordGenerationAgent() { 322 ContentPasswordManagerDriver::GetPasswordGenerationAgent() {
326 if (!password_gen_agent_) { 323 if (!password_gen_agent_) {
327 render_frame_host_->GetRemoteInterfaces()->GetInterface( 324 render_frame_host_->GetRemoteInterfaces()->GetInterface(
328 mojo::GetProxy(&password_gen_agent_)); 325 mojo::GetProxy(&password_gen_agent_));
329 } 326 }
330 327
331 return password_gen_agent_; 328 return password_gen_agent_;
332 } 329 }
333 330
334 } // namespace password_manager 331 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698