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

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

Issue 1852093002: components/password_manager: scoped_ptr -> unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and revert an accidental .proto change 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 "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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 const password_manager::CredentialInfo& credential) { 57 const password_manager::CredentialInfo& credential) {
58 DCHECK(credential.type != CredentialType::CREDENTIAL_TYPE_EMPTY); 58 DCHECK(credential.type != CredentialType::CREDENTIAL_TYPE_EMPTY);
59 DCHECK(request_id); 59 DCHECK(request_id);
60 web_contents()->GetRenderViewHost()->Send( 60 web_contents()->GetRenderViewHost()->Send(
61 new CredentialManagerMsg_AcknowledgeStore( 61 new CredentialManagerMsg_AcknowledgeStore(
62 web_contents()->GetRenderViewHost()->GetRoutingID(), request_id)); 62 web_contents()->GetRenderViewHost()->GetRoutingID(), request_id));
63 63
64 if (!client_->IsSavingAndFillingEnabledForCurrentPage()) 64 if (!client_->IsSavingAndFillingEnabledForCurrentPage())
65 return; 65 return;
66 66
67 scoped_ptr<autofill::PasswordForm> form(CreatePasswordFormFromCredentialInfo( 67 std::unique_ptr<autofill::PasswordForm> form(
68 credential, web_contents()->GetLastCommittedURL().GetOrigin())); 68 CreatePasswordFormFromCredentialInfo(
69 credential, web_contents()->GetLastCommittedURL().GetOrigin()));
69 form->skip_zero_click = !IsZeroClickAllowed(); 70 form->skip_zero_click = !IsZeroClickAllowed();
70 71
71 form_manager_.reset(new CredentialManagerPasswordFormManager( 72 form_manager_.reset(new CredentialManagerPasswordFormManager(
72 client_, GetDriver(), *form, this)); 73 client_, GetDriver(), *form, this));
73 } 74 }
74 75
75 void CredentialManagerDispatcher::OnProvisionalSaveComplete() { 76 void CredentialManagerDispatcher::OnProvisionalSaveComplete() {
76 DCHECK(form_manager_); 77 DCHECK(form_manager_);
77 DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage()); 78 DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage());
78 79
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 DCHECK(pending_require_user_mediation_); 274 DCHECK(pending_require_user_mediation_);
274 pending_require_user_mediation_.reset(); 275 pending_require_user_mediation_.reset();
275 } 276 }
276 277
277 bool CredentialManagerDispatcher::IsUpdatingCredentialAllowed() const { 278 bool CredentialManagerDispatcher::IsUpdatingCredentialAllowed() const {
278 return !client_->DidLastPageLoadEncounterSSLErrors() && 279 return !client_->DidLastPageLoadEncounterSSLErrors() &&
279 !client_->IsOffTheRecord(); 280 !client_->IsOffTheRecord();
280 } 281 }
281 282
282 } // namespace password_manager 283 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698