Chromium Code Reviews| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 password_form, generation_field); | 278 password_form, generation_field); |
| 278 } | 279 } |
| 279 | 280 |
| 280 void ContentPasswordManagerDriver::ShowPasswordSuggestions( | 281 void ContentPasswordManagerDriver::ShowPasswordSuggestions( |
| 281 int key, | 282 int key, |
| 282 base::i18n::TextDirection text_direction, | 283 base::i18n::TextDirection text_direction, |
| 283 const base::string16& typed_username, | 284 const base::string16& typed_username, |
| 284 int options, | 285 int options, |
| 285 const gfx::RectF& bounds) { | 286 const gfx::RectF& bounds) { |
| 286 password_autofill_manager_.OnShowPasswordSuggestions( | 287 password_autofill_manager_.OnShowPasswordSuggestions( |
| 287 key, text_direction, typed_username, options, bounds); | 288 key, text_direction, typed_username, options, bounds); |
|
Charlie Reis
2017/03/16 16:51:49
This likely has the same bug, right?
estark
2017/03/16 17:14:38
+1, in my testing I saw this happen on regular aut
EhsanK
2017/03/16 20:39:00
Implemented the same code. Would it be worthwhile
| |
| 288 } | 289 } |
| 289 | 290 |
| 290 void ContentPasswordManagerDriver::ShowNotSecureWarning( | 291 void ContentPasswordManagerDriver::ShowNotSecureWarning( |
| 291 base::i18n::TextDirection text_direction, | 292 base::i18n::TextDirection text_direction, |
| 292 const gfx::RectF& bounds) { | 293 const gfx::RectF& bounds) { |
| 293 password_autofill_manager_.OnShowNotSecureWarning(text_direction, bounds); | 294 content::RenderWidgetHostView* rwhv = render_frame_host_->GetView(); |
|
EhsanK
2017/03/16 07:06:58
Not sure yet if |rwhv| can be nullptr.
vabr (Chromium)
2017/03/16 08:25:49
Looking at ContentAutofillDriver::TransformBoundin
EhsanK
2017/03/16 20:39:00
Agreed. We should check. But not sure how this can
| |
| 295 gfx::RectF transformed_bounds( | |
| 296 rwhv->TransformPointToRootCoordSpaceF(bounds.origin()), bounds.size()); | |
| 297 password_autofill_manager_.OnShowNotSecureWarning(text_direction, | |
|
EhsanK
2017/03/16 06:47:33
I looked to me better to apply the transform here
vabr (Chromium)
2017/03/16 08:25:49
The browser process and the driver in particular s
EhsanK
2017/03/16 20:39:00
Acknowledged.
| |
| 298 transformed_bounds); | |
| 294 } | 299 } |
| 295 | 300 |
| 296 void ContentPasswordManagerDriver::RecordSavePasswordProgress( | 301 void ContentPasswordManagerDriver::RecordSavePasswordProgress( |
| 297 const std::string& log) { | 302 const std::string& log) { |
| 298 client_->GetLogManager()->LogSavePasswordProgress(log); | 303 client_->GetLogManager()->LogSavePasswordProgress(log); |
| 299 } | 304 } |
| 300 | 305 |
| 301 bool ContentPasswordManagerDriver::CheckChildProcessSecurityPolicy( | 306 bool ContentPasswordManagerDriver::CheckChildProcessSecurityPolicy( |
| 302 const GURL& url, | 307 const GURL& url, |
| 303 BadMessageReason reason) { | 308 BadMessageReason reason) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 ContentPasswordManagerDriver::GetPasswordGenerationAgent() { | 345 ContentPasswordManagerDriver::GetPasswordGenerationAgent() { |
| 341 if (!password_gen_agent_) { | 346 if (!password_gen_agent_) { |
| 342 render_frame_host_->GetRemoteInterfaces()->GetInterface( | 347 render_frame_host_->GetRemoteInterfaces()->GetInterface( |
| 343 mojo::MakeRequest(&password_gen_agent_)); | 348 mojo::MakeRequest(&password_gen_agent_)); |
| 344 } | 349 } |
| 345 | 350 |
| 346 return password_gen_agent_; | 351 return password_gen_agent_; |
| 347 } | 352 } |
| 348 | 353 |
| 349 } // namespace password_manager | 354 } // namespace password_manager |
| OLD | NEW |