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

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

Issue 1031153002: [Credential Management] Smart lock save Credentials bubble should not always pop up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 "components/password_manager/content/browser/credential_manager_dispatc her.h" 5 #include "components/password_manager/content/browser/credential_manager_dispatc her.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 229
230 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to 230 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to
231 // determine whether or not the credential exists, and calling UpdateLogin 231 // determine whether or not the credential exists, and calling UpdateLogin
232 // accordingly. 232 // accordingly.
233 form_manager_.reset(new CredentialManagerPasswordFormManager( 233 form_manager_.reset(new CredentialManagerPasswordFormManager(
234 client_, GetDriver(), *form, this)); 234 client_, GetDriver(), *form, this));
235 } 235 }
236 236
237 void CredentialManagerDispatcher::OnProvisionalSaveComplete() { 237 void CredentialManagerDispatcher::OnProvisionalSaveComplete() {
238 DCHECK(form_manager_); 238 DCHECK(form_manager_);
239 client_->PromptUserToSavePassword( 239 if (client_->IsEnabledForCurrentPage() && !form_manager_->IsBlacklisted()) {
240 form_manager_.Pass(), CredentialSourceType::CREDENTIAL_SOURCE_API); 240 client_->PromptUserToSavePassword(
241 form_manager_.Pass(), CredentialSourceType::CREDENTIAL_SOURCE_API);
242 }
241 } 243 }
242 244
243 void CredentialManagerDispatcher::OnNotifySignedOut(int request_id) { 245 void CredentialManagerDispatcher::OnNotifySignedOut(int request_id) {
244 DCHECK(request_id); 246 DCHECK(request_id);
245 247
246 PasswordStore* store = GetPasswordStore(); 248 PasswordStore* store = GetPasswordStore();
247 if (store) { 249 if (store) {
248 if (!pending_sign_out_) { 250 if (!pending_sign_out_) {
249 pending_sign_out_.reset(new PendingSignedOutTask( 251 pending_sign_out_.reset(new PendingSignedOutTask(
250 this, web_contents()->GetLastCommittedURL().GetOrigin())); 252 this, web_contents()->GetLastCommittedURL().GetOrigin()));
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 pending_request_->id(), info)); 343 pending_request_->id(), info));
342 pending_request_.reset(); 344 pending_request_.reset();
343 } 345 }
344 346
345 void CredentialManagerDispatcher::DoneSigningOut() { 347 void CredentialManagerDispatcher::DoneSigningOut() {
346 DCHECK(pending_sign_out_); 348 DCHECK(pending_sign_out_);
347 pending_sign_out_.reset(); 349 pending_sign_out_.reset();
348 } 350 }
349 351
350 } // namespace password_manager 352 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698