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

Side by Side Diff: ios/chrome/browser/passwords/credential_manager.mm

Issue 1960653002: Fix blacklisting password forms with Credential Manager API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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
« no previous file with comments | « components/password_manager/core/common/credential_manager_types_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #import "ios/chrome/browser/passwords/credential_manager.h" 5 #import "ios/chrome/browser/passwords/credential_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/ios/ios_util.h" 9 #include "base/ios/ios_util.h"
10 #import "base/ios/weak_nsobject.h" 10 #import "base/ios/weak_nsobject.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 std::unique_ptr<autofill::PasswordForm> form( 197 std::unique_ptr<autofill::PasswordForm> form(
198 password_manager::CreatePasswordFormFromCredentialInfo( 198 password_manager::CreatePasswordFormFromCredentialInfo(
199 CredentialInfoFromWebCredential(credential), page_url)); 199 CredentialInfoFromWebCredential(credential), page_url));
200 form->skip_zero_click = !IsZeroClickAllowed(); 200 form->skip_zero_click = !IsZeroClickAllowed();
201 201
202 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to 202 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to
203 // determine whether or not the credential exists, and calling UpdateLogin 203 // determine whether or not the credential exists, and calling UpdateLogin
204 // accordingly. 204 // accordingly.
205 form_manager_.reset( 205 form_manager_.reset(
206 new password_manager::CredentialManagerPasswordFormManager( 206 new password_manager::CredentialManagerPasswordFormManager(
207 client_, driver_->AsWeakPtr(), *form, this)); 207 client_, driver_->AsWeakPtr(),
208 *password_manager::CreateObservedPasswordFormFromOrigin(page_url),
209 std::move(form), this));
208 } 210 }
209 211
210 void CredentialManager::SignedOut(int request_id, const GURL& source_url) { 212 void CredentialManager::SignedOut(int request_id, const GURL& source_url) {
211 // Invoked when the page invokes navigator.credentials.notifySignedOut, this 213 // Invoked when the page invokes navigator.credentials.notifySignedOut, this
212 // function notifies the PasswordStore that zero-click sign-in should be 214 // function notifies the PasswordStore that zero-click sign-in should be
213 // disabled for the current page origin. 215 // disabled for the current page origin.
214 DCHECK_GE(request_id, 0); 216 DCHECK_GE(request_id, 0);
215 217
216 // Requests from untrusted origins should be rejected. 218 // Requests from untrusted origins should be rejected.
217 GURL page_url; 219 GURL page_url;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 bool CredentialManager::GetUrlWithAbsoluteTrust(GURL* page_url) { 371 bool CredentialManager::GetUrlWithAbsoluteTrust(GURL* page_url) {
370 web::URLVerificationTrustLevel trust_level = 372 web::URLVerificationTrustLevel trust_level =
371 web::URLVerificationTrustLevel::kNone; 373 web::URLVerificationTrustLevel::kNone;
372 const GURL possibly_untrusted_url(web_state()->GetCurrentURL(&trust_level)); 374 const GURL possibly_untrusted_url(web_state()->GetCurrentURL(&trust_level));
373 if (trust_level == web::URLVerificationTrustLevel::kAbsolute) { 375 if (trust_level == web::URLVerificationTrustLevel::kAbsolute) {
374 *page_url = possibly_untrusted_url; 376 *page_url = possibly_untrusted_url;
375 return true; 377 return true;
376 } 378 }
377 return false; 379 return false;
378 } 380 }
OLDNEW
« no previous file with comments | « components/password_manager/core/common/credential_manager_types_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698