Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: components/password_manager/content/browser/content_password_manager_driver.cc

Issue 2697803002: [M57] Eliminate PasswordAutofillAgentConstructed() in mojo interface PasswordManagerDriver (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Do not call the virtual method SendLoggingAvailability from a constructor
55 // here, inline its steps instead.
56 GetPasswordAutofillAgent()->SetLoggingState(
57 client_->GetLogManager()->IsLoggingActive());
58 }
46 } 59 }
47 60
48 ContentPasswordManagerDriver::~ContentPasswordManagerDriver() { 61 ContentPasswordManagerDriver::~ContentPasswordManagerDriver() {
49 } 62 }
50 63
51 // static 64 // static
52 ContentPasswordManagerDriver* 65 ContentPasswordManagerDriver*
53 ContentPasswordManagerDriver::GetForRenderFrameHost( 66 ContentPasswordManagerDriver::GetForRenderFrameHost(
54 content::RenderFrameHost* render_frame_host) { 67 content::RenderFrameHost* render_frame_host) {
55 ContentPasswordManagerDriverFactory* factory = 68 ContentPasswordManagerDriverFactory* factory =
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 password_autofill_manager_.OnShowPasswordSuggestions( 285 password_autofill_manager_.OnShowPasswordSuggestions(
273 key, text_direction, typed_username, options, bounds); 286 key, text_direction, typed_username, options, bounds);
274 } 287 }
275 288
276 void ContentPasswordManagerDriver::ShowNotSecureWarning( 289 void ContentPasswordManagerDriver::ShowNotSecureWarning(
277 base::i18n::TextDirection text_direction, 290 base::i18n::TextDirection text_direction,
278 const gfx::RectF& bounds) { 291 const gfx::RectF& bounds) {
279 password_autofill_manager_.OnShowNotSecureWarning(text_direction, bounds); 292 password_autofill_manager_.OnShowNotSecureWarning(text_direction, bounds);
280 } 293 }
281 294
282 void ContentPasswordManagerDriver::PasswordAutofillAgentConstructed() {
283 SendLoggingAvailability();
284 }
285
286 void ContentPasswordManagerDriver::RecordSavePasswordProgress( 295 void ContentPasswordManagerDriver::RecordSavePasswordProgress(
287 const std::string& log) { 296 const std::string& log) {
288 client_->GetLogManager()->LogSavePasswordProgress(log); 297 client_->GetLogManager()->LogSavePasswordProgress(log);
289 } 298 }
290 299
291 bool ContentPasswordManagerDriver::CheckChildProcessSecurityPolicy( 300 bool ContentPasswordManagerDriver::CheckChildProcessSecurityPolicy(
292 const GURL& url, 301 const GURL& url,
293 BadMessageReason reason) { 302 BadMessageReason reason) {
294 content::ChildProcessSecurityPolicy* policy = 303 content::ChildProcessSecurityPolicy* policy =
295 content::ChildProcessSecurityPolicy::GetInstance(); 304 content::ChildProcessSecurityPolicy::GetInstance();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 ContentPasswordManagerDriver::GetPasswordGenerationAgent() { 339 ContentPasswordManagerDriver::GetPasswordGenerationAgent() {
331 if (!password_gen_agent_) { 340 if (!password_gen_agent_) {
332 render_frame_host_->GetRemoteInterfaces()->GetInterface( 341 render_frame_host_->GetRemoteInterfaces()->GetInterface(
333 mojo::MakeRequest(&password_gen_agent_)); 342 mojo::MakeRequest(&password_gen_agent_));
334 } 343 }
335 344
336 return password_gen_agent_; 345 return password_gen_agent_;
337 } 346 }
338 347
339 } // namespace password_manager 348 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698