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

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

Issue 1946563003: Fix blacklisting password forms with Credential Manager API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ios 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 std::unique_ptr<autofill::PasswordForm> form( 198 std::unique_ptr<autofill::PasswordForm> form(
199 password_manager::CreatePasswordFormFromCredentialInfo( 199 password_manager::CreatePasswordFormFromCredentialInfo(
200 CredentialInfoFromWebCredential(credential), page_url)); 200 CredentialInfoFromWebCredential(credential), page_url));
201 form->skip_zero_click = !IsZeroClickAllowed(); 201 form->skip_zero_click = !IsZeroClickAllowed();
202 202
203 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to 203 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to
204 // determine whether or not the credential exists, and calling UpdateLogin 204 // determine whether or not the credential exists, and calling UpdateLogin
205 // accordingly. 205 // accordingly.
206 form_manager_.reset( 206 form_manager_.reset(
207 new password_manager::CredentialManagerPasswordFormManager( 207 new password_manager::CredentialManagerPasswordFormManager(
208 client_, driver_->AsWeakPtr(), *form, this)); 208 client_, driver_->AsWeakPtr(),
209 *password_manager::CreateObservedPasswordFormFromOrigin(page_url),
210 std::move(form), this));
209 } 211 }
210 212
211 void CredentialManager::SignedOut(int request_id, const GURL& source_url) { 213 void CredentialManager::SignedOut(int request_id, const GURL& source_url) {
212 // Invoked when the page invokes navigator.credentials.notifySignedOut, this 214 // Invoked when the page invokes navigator.credentials.notifySignedOut, this
213 // function notifies the PasswordStore that zero-click sign-in should be 215 // function notifies the PasswordStore that zero-click sign-in should be
214 // disabled for the current page origin. 216 // disabled for the current page origin.
215 DCHECK_GE(request_id, 0); 217 DCHECK_GE(request_id, 0);
216 218
217 // Requests from untrusted origins should be rejected. 219 // Requests from untrusted origins should be rejected.
218 GURL page_url; 220 GURL page_url;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 bool CredentialManager::GetUrlWithAbsoluteTrust(GURL* page_url) { 379 bool CredentialManager::GetUrlWithAbsoluteTrust(GURL* page_url) {
378 web::URLVerificationTrustLevel trust_level = 380 web::URLVerificationTrustLevel trust_level =
379 web::URLVerificationTrustLevel::kNone; 381 web::URLVerificationTrustLevel::kNone;
380 const GURL possibly_untrusted_url(web_state()->GetCurrentURL(&trust_level)); 382 const GURL possibly_untrusted_url(web_state()->GetCurrentURL(&trust_level));
381 if (trust_level == web::URLVerificationTrustLevel::kAbsolute) { 383 if (trust_level == web::URLVerificationTrustLevel::kAbsolute) {
382 *page_url = possibly_untrusted_url; 384 *page_url = possibly_untrusted_url;
383 return true; 385 return true;
384 } 386 }
385 return false; 387 return false;
386 } 388 }
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