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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "components/autofill/content/browser/content_autofill_driver.h" | 9 #include "components/autofill/content/browser/content_autofill_driver.h" |
10 #include "components/autofill/core/common/form_data.h" | 10 #include "components/autofill/core/common/form_data.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 void ContentPasswordManagerDriver::ClearPreviewedForm() { | 130 void ContentPasswordManagerDriver::ClearPreviewedForm() { |
131 GetAutofillAgent()->ClearPreviewedForm(); | 131 GetAutofillAgent()->ClearPreviewedForm(); |
132 } | 132 } |
133 | 133 |
134 void ContentPasswordManagerDriver::ForceSavePassword() { | 134 void ContentPasswordManagerDriver::ForceSavePassword() { |
135 GetPasswordAutofillAgent()->FindFocusedPasswordForm( | 135 GetPasswordAutofillAgent()->FindFocusedPasswordForm( |
136 base::Bind(&ContentPasswordManagerDriver::OnFocusedPasswordFormFound, | 136 base::Bind(&ContentPasswordManagerDriver::OnFocusedPasswordFormFound, |
137 weak_factory_.GetWeakPtr())); | 137 weak_factory_.GetWeakPtr())); |
138 } | 138 } |
139 | 139 |
| 140 void ContentPasswordManagerDriver::ShowManualFallbackForSaving( |
| 141 const autofill::PasswordForm& password_form) { |
| 142 if (!CheckChildProcessSecurityPolicy( |
| 143 password_form.origin, |
| 144 BadMessageReason::CPMD_BAD_ORIGIN_SHOW_FALLBACK_FOR_SAVING)) |
| 145 return; |
| 146 GetPasswordManager()->ShowManualFallbackForSaving(this, password_form); |
| 147 } |
| 148 |
| 149 void ContentPasswordManagerDriver::HideManualFallbackForSaving() { |
| 150 GetPasswordManager()->HideManualFallbackForSaving(); |
| 151 } |
| 152 |
140 void ContentPasswordManagerDriver::GeneratePassword() { | 153 void ContentPasswordManagerDriver::GeneratePassword() { |
141 GetPasswordGenerationAgent()->UserTriggeredGeneratePassword(); | 154 GetPasswordGenerationAgent()->UserTriggeredGeneratePassword(); |
142 } | 155 } |
143 | 156 |
144 void ContentPasswordManagerDriver::SendLoggingAvailability() { | 157 void ContentPasswordManagerDriver::SendLoggingAvailability() { |
145 GetPasswordAutofillAgent()->SetLoggingState( | 158 GetPasswordAutofillAgent()->SetLoggingState( |
146 client_->GetLogManager()->IsLoggingActive()); | 159 client_->GetLogManager()->IsLoggingActive()); |
147 } | 160 } |
148 | 161 |
149 void ContentPasswordManagerDriver::AllowToRunFormClassifier() { | 162 void ContentPasswordManagerDriver::AllowToRunFormClassifier() { |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 const gfx::RectF& bounds_in_frame_coordinates) { | 366 const gfx::RectF& bounds_in_frame_coordinates) { |
354 content::RenderWidgetHostView* rwhv = render_frame_host_->GetView(); | 367 content::RenderWidgetHostView* rwhv = render_frame_host_->GetView(); |
355 if (!rwhv) | 368 if (!rwhv) |
356 return bounds_in_frame_coordinates; | 369 return bounds_in_frame_coordinates; |
357 return gfx::RectF(rwhv->TransformPointToRootCoordSpaceF( | 370 return gfx::RectF(rwhv->TransformPointToRootCoordSpaceF( |
358 bounds_in_frame_coordinates.origin()), | 371 bounds_in_frame_coordinates.origin()), |
359 bounds_in_frame_coordinates.size()); | 372 bounds_in_frame_coordinates.size()); |
360 } | 373 } |
361 | 374 |
362 } // namespace password_manager | 375 } // namespace password_manager |
OLD | NEW |