| 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" |
| 11 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" | 11 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" |
| 12 #include "components/password_manager/content/browser/visible_password_observer.
h" | 12 #include "components/password_manager/content/browser/visible_password_observer.
h" |
| 13 #include "components/password_manager/core/browser/log_manager.h" | 13 #include "components/password_manager/core/browser/log_manager.h" |
| 14 #include "components/password_manager/core/browser/password_manager.h" | 14 #include "components/password_manager/core/browser/password_manager.h" |
| 15 #include "components/password_manager/core/browser/password_manager_client.h" | 15 #include "components/password_manager/core/browser/password_manager_client.h" |
| 16 #include "content/public/browser/browser_context.h" | 16 #include "content/public/browser/browser_context.h" |
| 17 #include "content/public/browser/child_process_security_policy.h" | 17 #include "content/public/browser/child_process_security_policy.h" |
| 18 #include "content/public/browser/navigation_entry.h" | 18 #include "content/public/browser/navigation_entry.h" |
| 19 #include "content/public/browser/navigation_handle.h" | 19 #include "content/public/browser/navigation_handle.h" |
| 20 #include "content/public/browser/render_frame_host.h" | 20 #include "content/public/browser/render_frame_host.h" |
| 21 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
| 22 #include "content/public/browser/render_view_host.h" | 22 #include "content/public/browser/render_view_host.h" |
| 23 #include "content/public/browser/render_widget_host_view.h" |
| 23 #include "content/public/browser/site_instance.h" | 24 #include "content/public/browser/site_instance.h" |
| 24 #include "content/public/browser/ssl_status.h" | 25 #include "content/public/browser/ssl_status.h" |
| 25 #include "content/public/browser/web_contents.h" | 26 #include "content/public/browser/web_contents.h" |
| 26 #include "net/cert/cert_status_flags.h" | 27 #include "net/cert/cert_status_flags.h" |
| 27 #include "services/service_manager/public/cpp/interface_provider.h" | 28 #include "services/service_manager/public/cpp/interface_provider.h" |
| 28 | 29 |
| 29 namespace password_manager { | 30 namespace password_manager { |
| 30 | 31 |
| 31 ContentPasswordManagerDriver::ContentPasswordManagerDriver( | 32 ContentPasswordManagerDriver::ContentPasswordManagerDriver( |
| 32 content::RenderFrameHost* render_frame_host, | 33 content::RenderFrameHost* render_frame_host, |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 password_form, generation_field); | 276 password_form, generation_field); |
| 276 } | 277 } |
| 277 | 278 |
| 278 void ContentPasswordManagerDriver::ShowPasswordSuggestions( | 279 void ContentPasswordManagerDriver::ShowPasswordSuggestions( |
| 279 int key, | 280 int key, |
| 280 base::i18n::TextDirection text_direction, | 281 base::i18n::TextDirection text_direction, |
| 281 const base::string16& typed_username, | 282 const base::string16& typed_username, |
| 282 int options, | 283 int options, |
| 283 const gfx::RectF& bounds) { | 284 const gfx::RectF& bounds) { |
| 284 password_autofill_manager_.OnShowPasswordSuggestions( | 285 password_autofill_manager_.OnShowPasswordSuggestions( |
| 285 key, text_direction, typed_username, options, bounds); | 286 key, text_direction, typed_username, options, |
| 287 TransformToRootCoordinates(bounds)); |
| 286 } | 288 } |
| 287 | 289 |
| 288 void ContentPasswordManagerDriver::ShowNotSecureWarning( | 290 void ContentPasswordManagerDriver::ShowNotSecureWarning( |
| 289 base::i18n::TextDirection text_direction, | 291 base::i18n::TextDirection text_direction, |
| 290 const gfx::RectF& bounds) { | 292 const gfx::RectF& bounds) { |
| 291 password_autofill_manager_.OnShowNotSecureWarning(text_direction, bounds); | 293 password_autofill_manager_.OnShowNotSecureWarning( |
| 294 text_direction, TransformToRootCoordinates(bounds)); |
| 292 } | 295 } |
| 293 | 296 |
| 294 void ContentPasswordManagerDriver::RecordSavePasswordProgress( | 297 void ContentPasswordManagerDriver::RecordSavePasswordProgress( |
| 295 const std::string& log) { | 298 const std::string& log) { |
| 296 client_->GetLogManager()->LogSavePasswordProgress(log); | 299 client_->GetLogManager()->LogSavePasswordProgress(log); |
| 297 } | 300 } |
| 298 | 301 |
| 299 bool ContentPasswordManagerDriver::CheckChildProcessSecurityPolicy( | 302 bool ContentPasswordManagerDriver::CheckChildProcessSecurityPolicy( |
| 300 const GURL& url, | 303 const GURL& url, |
| 301 BadMessageReason reason) { | 304 BadMessageReason reason) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 const autofill::mojom::PasswordGenerationAgentPtr& | 340 const autofill::mojom::PasswordGenerationAgentPtr& |
| 338 ContentPasswordManagerDriver::GetPasswordGenerationAgent() { | 341 ContentPasswordManagerDriver::GetPasswordGenerationAgent() { |
| 339 if (!password_gen_agent_) { | 342 if (!password_gen_agent_) { |
| 340 render_frame_host_->GetRemoteInterfaces()->GetInterface( | 343 render_frame_host_->GetRemoteInterfaces()->GetInterface( |
| 341 mojo::MakeRequest(&password_gen_agent_)); | 344 mojo::MakeRequest(&password_gen_agent_)); |
| 342 } | 345 } |
| 343 | 346 |
| 344 return password_gen_agent_; | 347 return password_gen_agent_; |
| 345 } | 348 } |
| 346 | 349 |
| 350 gfx::RectF ContentPasswordManagerDriver::TransformToRootCoordinates( |
| 351 const gfx::RectF& bounds_in_frame_coordinates) { |
| 352 content::RenderWidgetHostView* rwhv = render_frame_host_->GetView(); |
| 353 if (!rwhv) |
| 354 return bounds_in_frame_coordinates; |
| 355 return gfx::RectF(rwhv->TransformPointToRootCoordSpaceF( |
| 356 bounds_in_frame_coordinates.origin()), |
| 357 bounds_in_frame_coordinates.size()); |
| 358 } |
| 359 |
| 347 } // namespace password_manager | 360 } // namespace password_manager |
| OLD | NEW |