| OLD | NEW |
| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 void ContentPasswordManagerDriver::ClearPreviewedForm() { | 138 void ContentPasswordManagerDriver::ClearPreviewedForm() { |
| 139 GetAutofillAgent()->ClearPreviewedForm(); | 139 GetAutofillAgent()->ClearPreviewedForm(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void ContentPasswordManagerDriver::ForceSavePassword() { | 142 void ContentPasswordManagerDriver::ForceSavePassword() { |
| 143 GetPasswordAutofillAgent()->FindFocusedPasswordForm( | 143 GetPasswordAutofillAgent()->FindFocusedPasswordForm( |
| 144 base::Bind(&ContentPasswordManagerDriver::OnFocusedPasswordFormFound, | 144 base::Bind(&ContentPasswordManagerDriver::OnFocusedPasswordFormFound, |
| 145 weak_factory_.GetWeakPtr())); | 145 weak_factory_.GetWeakPtr())); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void ContentPasswordManagerDriver::ShowManualFallback( |
| 149 const autofill::PasswordForm& password_form) { |
| 150 if (!CheckChildProcessSecurityPolicy( |
| 151 password_form.origin, |
| 152 BadMessageReason::CPMD_BAD_ORIGIN_SHOW_FALLBACK_FOR_SAVING)) |
| 153 return; |
| 154 GetPasswordManager()->ShowManualFallback(this, password_form); |
| 155 } |
| 156 |
| 157 void ContentPasswordManagerDriver::HideManualFallback() { |
| 158 GetPasswordManager()->HideManualFallback(); |
| 159 } |
| 160 |
| 148 void ContentPasswordManagerDriver::GeneratePassword() { | 161 void ContentPasswordManagerDriver::GeneratePassword() { |
| 149 GetPasswordGenerationAgent()->UserTriggeredGeneratePassword(); | 162 GetPasswordGenerationAgent()->UserTriggeredGeneratePassword(); |
| 150 } | 163 } |
| 151 | 164 |
| 152 void ContentPasswordManagerDriver::SendLoggingAvailability() { | 165 void ContentPasswordManagerDriver::SendLoggingAvailability() { |
| 153 GetPasswordAutofillAgent()->SetLoggingState( | 166 GetPasswordAutofillAgent()->SetLoggingState( |
| 154 client_->GetLogManager()->IsLoggingActive()); | 167 client_->GetLogManager()->IsLoggingActive()); |
| 155 } | 168 } |
| 156 | 169 |
| 157 void ContentPasswordManagerDriver::AllowToRunFormClassifier() { | 170 void ContentPasswordManagerDriver::AllowToRunFormClassifier() { |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 const gfx::RectF& bounds_in_frame_coordinates) { | 387 const gfx::RectF& bounds_in_frame_coordinates) { |
| 375 content::RenderWidgetHostView* rwhv = render_frame_host_->GetView(); | 388 content::RenderWidgetHostView* rwhv = render_frame_host_->GetView(); |
| 376 if (!rwhv) | 389 if (!rwhv) |
| 377 return bounds_in_frame_coordinates; | 390 return bounds_in_frame_coordinates; |
| 378 return gfx::RectF(rwhv->TransformPointToRootCoordSpaceF( | 391 return gfx::RectF(rwhv->TransformPointToRootCoordSpaceF( |
| 379 bounds_in_frame_coordinates.origin()), | 392 bounds_in_frame_coordinates.origin()), |
| 380 bounds_in_frame_coordinates.size()); | 393 bounds_in_frame_coordinates.size()); |
| 381 } | 394 } |
| 382 | 395 |
| 383 } // namespace password_manager | 396 } // namespace password_manager |
| OLD | NEW |