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

Side by Side Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 1762603002: Switch components/password_manager code from IPC messages to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase only Created 4 years, 8 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 "chrome/browser/password_manager/chrome_password_manager_client.h" 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 15 matching lines...) Expand all
26 #include "chrome/common/features.h" 26 #include "chrome/common/features.h"
27 #include "chrome/common/url_constants.h" 27 #include "chrome/common/url_constants.h"
28 #include "components/autofill/content/browser/content_autofill_driver.h" 28 #include "components/autofill/content/browser/content_autofill_driver.h"
29 #include "components/autofill/content/browser/content_autofill_driver_factory.h" 29 #include "components/autofill/content/browser/content_autofill_driver_factory.h"
30 #include "components/autofill/content/common/autofill_messages.h" 30 #include "components/autofill/content/common/autofill_messages.h"
31 #include "components/autofill/core/browser/password_generator.h" 31 #include "components/autofill/core/browser/password_generator.h"
32 #include "components/autofill/core/common/password_form.h" 32 #include "components/autofill/core/common/password_form.h"
33 #include "components/browser_sync/browser/profile_sync_service.h" 33 #include "components/browser_sync/browser/profile_sync_service.h"
34 #include "components/password_manager/content/browser/content_password_manager_d river.h" 34 #include "components/password_manager/content/browser/content_password_manager_d river.h"
35 #include "components/password_manager/content/browser/password_manager_internals _service_factory.h" 35 #include "components/password_manager/content/browser/password_manager_internals _service_factory.h"
36 #include "components/password_manager/content/common/credential_manager_messages .h"
37 #include "components/password_manager/core/browser/browser_save_password_progres s_logger.h" 36 #include "components/password_manager/core/browser/browser_save_password_progres s_logger.h"
38 #include "components/password_manager/core/browser/log_manager.h" 37 #include "components/password_manager/core/browser/log_manager.h"
39 #include "components/password_manager/core/browser/log_receiver.h" 38 #include "components/password_manager/core/browser/log_receiver.h"
40 #include "components/password_manager/core/browser/password_bubble_experiment.h" 39 #include "components/password_manager/core/browser/password_bubble_experiment.h"
41 #include "components/password_manager/core/browser/password_form_manager.h" 40 #include "components/password_manager/core/browser/password_form_manager.h"
42 #include "components/password_manager/core/browser/password_manager_internals_se rvice.h" 41 #include "components/password_manager/core/browser/password_manager_internals_se rvice.h"
43 #include "components/password_manager/core/browser/password_manager_metrics_util .h" 42 #include "components/password_manager/core/browser/password_manager_metrics_util .h"
44 #include "components/password_manager/core/browser/password_manager_settings_mig ration_experiment.h" 43 #include "components/password_manager/core/browser/password_manager_settings_mig ration_experiment.h"
45 #include "components/password_manager/core/browser/password_manager_util.h" 44 #include "components/password_manager/core/browser/password_manager_util.h"
46 #include "components/password_manager/core/common/credential_manager_types.h" 45 #include "components/password_manager/core/common/credential_manager_types.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 new ChromePasswordManagerClient(contents, autofill_client)); 133 new ChromePasswordManagerClient(contents, autofill_client));
135 } 134 }
136 135
137 ChromePasswordManagerClient::ChromePasswordManagerClient( 136 ChromePasswordManagerClient::ChromePasswordManagerClient(
138 content::WebContents* web_contents, 137 content::WebContents* web_contents,
139 autofill::AutofillClient* autofill_client) 138 autofill::AutofillClient* autofill_client)
140 : content::WebContentsObserver(web_contents), 139 : content::WebContentsObserver(web_contents),
141 profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())), 140 profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())),
142 password_manager_(this), 141 password_manager_(this),
143 driver_factory_(nullptr), 142 driver_factory_(nullptr),
144 credential_manager_dispatcher_(web_contents, this), 143 credential_manager_impl_(web_contents, this),
145 observer_(nullptr), 144 observer_(nullptr),
146 credentials_filter_(this, 145 credentials_filter_(this,
147 base::Bind(&GetSyncService, profile_), 146 base::Bind(&GetSyncService, profile_),
148 base::Bind(&GetSigninManager, profile_)) { 147 base::Bind(&GetSigninManager, profile_)) {
149 ContentPasswordManagerDriverFactory::CreateForWebContents(web_contents, this, 148 ContentPasswordManagerDriverFactory::CreateForWebContents(web_contents, this,
150 autofill_client); 149 autofill_client);
151 driver_factory_ = 150 driver_factory_ =
152 ContentPasswordManagerDriverFactory::FromWebContents(web_contents); 151 ContentPasswordManagerDriverFactory::FromWebContents(web_contents);
153 log_manager_ = password_manager::LogManager::Create( 152 log_manager_ = password_manager::LogManager::Create(
154 password_manager::PasswordManagerInternalsServiceFactory:: 153 password_manager::PasswordManagerInternalsServiceFactory::
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 321
323 void ChromePasswordManagerClient::NotifySuccessfulLoginWithExistingPassword( 322 void ChromePasswordManagerClient::NotifySuccessfulLoginWithExistingPassword(
324 const autofill::PasswordForm& form) { 323 const autofill::PasswordForm& form) {
325 if (!possible_auto_sign_in_) 324 if (!possible_auto_sign_in_)
326 return; 325 return;
327 326
328 if (possible_auto_sign_in_->username_value == form.username_value && 327 if (possible_auto_sign_in_->username_value == form.username_value &&
329 possible_auto_sign_in_->password_value == form.password_value && 328 possible_auto_sign_in_->password_value == form.password_value &&
330 possible_auto_sign_in_->origin == form.origin) { 329 possible_auto_sign_in_->origin == form.origin) {
331 PromptUserToEnableAutosigninIfNecessary(); 330 PromptUserToEnableAutosigninIfNecessary();
332 if (form.skip_zero_click && 331 if (form.skip_zero_click && credential_manager_impl_.IsZeroClickAllowed() &&
333 credential_manager_dispatcher_.IsZeroClickAllowed() &&
334 GetPasswordStore()) { 332 GetPasswordStore()) {
335 autofill::PasswordForm update(form); 333 autofill::PasswordForm update(form);
336 update.skip_zero_click = false; 334 update.skip_zero_click = false;
337 GetPasswordStore()->UpdateLogin(update); 335 GetPasswordStore()->UpdateLogin(update);
338 } 336 }
339 } 337 }
340 possible_auto_sign_in_.reset(); 338 possible_auto_sign_in_.reset();
341 } 339 }
342 340
343 void ChromePasswordManagerClient::AutomaticPasswordSave( 341 void ChromePasswordManagerClient::AutomaticPasswordSave(
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 603
606 const password_manager::CredentialsFilter* 604 const password_manager::CredentialsFilter*
607 ChromePasswordManagerClient::GetStoreResultFilter() const { 605 ChromePasswordManagerClient::GetStoreResultFilter() const {
608 return &credentials_filter_; 606 return &credentials_filter_;
609 } 607 }
610 608
611 const password_manager::LogManager* ChromePasswordManagerClient::GetLogManager() 609 const password_manager::LogManager* ChromePasswordManagerClient::GetLogManager()
612 const { 610 const {
613 return log_manager_.get(); 611 return log_manager_.get();
614 } 612 }
613
614 // static
615 void ChromePasswordManagerClient::BindCredentialManager(
616 content::RenderFrameHost* render_frame_host,
617 password_manager::mojom::CredentialManagerRequest request) {
618 content::WebContents* web_contents =
619 content::WebContents::FromRenderFrameHost(render_frame_host);
620 DCHECK(web_contents);
621
622 ChromePasswordManagerClient* instance =
623 ChromePasswordManagerClient::FromWebContents(web_contents);
624 DCHECK(instance);
625 instance->credential_manager_impl_.BindRequest(std::move(request));
626 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698