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" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 client_(client), | 36 client_(client), |
| 37 password_generation_manager_(client, this), | 37 password_generation_manager_(client, this), |
| 38 password_autofill_manager_(this, autofill_client), | 38 password_autofill_manager_(this, autofill_client), |
| 39 next_free_key_(0), | 39 next_free_key_(0), |
| 40 password_manager_binding_(this), | 40 password_manager_binding_(this), |
| 41 weak_factory_(this) { | 41 weak_factory_(this) { |
| 42 // Does nothing if a VisiblePasswordObserver has already been created | 42 // Does nothing if a VisiblePasswordObserver has already been created |
| 43 // for this WebContents. | 43 // for this WebContents. |
| 44 VisiblePasswordObserver::CreateForWebContents( | 44 VisiblePasswordObserver::CreateForWebContents( |
| 45 content::WebContents::FromRenderFrameHost(render_frame_host_)); | 45 content::WebContents::FromRenderFrameHost(render_frame_host_)); |
| 46 | |
| 47 // For some frames |this| may be instantiated before log manager creation, so | |
| 48 // here we can not send logging state to renderer process for them. For such | |
| 49 // cases, after the log manager got ready later, | |
| 50 // ContentPasswordManagerDriverFactory::RequestSendLoggingAvailability() will | |
| 51 // call ContentPasswordManagerDriver::SendLoggingAvailability() on |this| to | |
| 52 // do it actually. | |
| 53 if (client_->GetLogManager()) { | |
| 54 GetPasswordAutofillAgent()->SetLoggingState( | |
|
vabr (Chromium)
2017/02/12 18:48:12
I acknowledge that calling the SetLoggingState her
leonhsl(Using Gerrit)
2017/02/13 00:14:32
Done.
| |
| 55 client_->GetLogManager()->IsLoggingActive()); | |
| 56 } | |
| 46 } | 57 } |
| 47 | 58 |
| 48 ContentPasswordManagerDriver::~ContentPasswordManagerDriver() { | 59 ContentPasswordManagerDriver::~ContentPasswordManagerDriver() { |
| 49 } | 60 } |
| 50 | 61 |
| 51 // static | 62 // static |
| 52 ContentPasswordManagerDriver* | 63 ContentPasswordManagerDriver* |
| 53 ContentPasswordManagerDriver::GetForRenderFrameHost( | 64 ContentPasswordManagerDriver::GetForRenderFrameHost( |
| 54 content::RenderFrameHost* render_frame_host) { | 65 content::RenderFrameHost* render_frame_host) { |
| 55 ContentPasswordManagerDriverFactory* factory = | 66 ContentPasswordManagerDriverFactory* factory = |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 password_autofill_manager_.OnShowPasswordSuggestions( | 282 password_autofill_manager_.OnShowPasswordSuggestions( |
| 272 key, text_direction, typed_username, options, bounds); | 283 key, text_direction, typed_username, options, bounds); |
| 273 } | 284 } |
| 274 | 285 |
| 275 void ContentPasswordManagerDriver::ShowNotSecureWarning( | 286 void ContentPasswordManagerDriver::ShowNotSecureWarning( |
| 276 base::i18n::TextDirection text_direction, | 287 base::i18n::TextDirection text_direction, |
| 277 const gfx::RectF& bounds) { | 288 const gfx::RectF& bounds) { |
| 278 password_autofill_manager_.OnShowNotSecureWarning(text_direction, bounds); | 289 password_autofill_manager_.OnShowNotSecureWarning(text_direction, bounds); |
| 279 } | 290 } |
| 280 | 291 |
| 281 void ContentPasswordManagerDriver::PasswordAutofillAgentConstructed() { | |
| 282 SendLoggingAvailability(); | |
| 283 } | |
| 284 | |
| 285 void ContentPasswordManagerDriver::RecordSavePasswordProgress( | 292 void ContentPasswordManagerDriver::RecordSavePasswordProgress( |
| 286 const std::string& log) { | 293 const std::string& log) { |
| 287 client_->GetLogManager()->LogSavePasswordProgress(log); | 294 client_->GetLogManager()->LogSavePasswordProgress(log); |
| 288 } | 295 } |
| 289 | 296 |
| 290 bool ContentPasswordManagerDriver::CheckChildProcessSecurityPolicy( | 297 bool ContentPasswordManagerDriver::CheckChildProcessSecurityPolicy( |
| 291 const GURL& url, | 298 const GURL& url, |
| 292 BadMessageReason reason) { | 299 BadMessageReason reason) { |
| 293 content::ChildProcessSecurityPolicy* policy = | 300 content::ChildProcessSecurityPolicy* policy = |
| 294 content::ChildProcessSecurityPolicy::GetInstance(); | 301 content::ChildProcessSecurityPolicy::GetInstance(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 329 ContentPasswordManagerDriver::GetPasswordGenerationAgent() { | 336 ContentPasswordManagerDriver::GetPasswordGenerationAgent() { |
| 330 if (!password_gen_agent_) { | 337 if (!password_gen_agent_) { |
| 331 render_frame_host_->GetRemoteInterfaces()->GetInterface( | 338 render_frame_host_->GetRemoteInterfaces()->GetInterface( |
| 332 mojo::MakeRequest(&password_gen_agent_)); | 339 mojo::MakeRequest(&password_gen_agent_)); |
| 333 } | 340 } |
| 334 | 341 |
| 335 return password_gen_agent_; | 342 return password_gen_agent_; |
| 336 } | 343 } |
| 337 | 344 |
| 338 } // namespace password_manager | 345 } // namespace password_manager |
| OLD | NEW |