| OLD | NEW |
| 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 #import "ios/chrome/browser/passwords/password_generation_agent.h" | 5 #import "ios/chrome/browser/passwords/password_generation_agent.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #include "base/mac/scoped_block.h" | 10 #include "base/mac/scoped_block.h" |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 [self hideAlert]; | 349 [self hideAlert]; |
| 350 __weak PasswordGenerationAgent* weakSelf = self; | 350 __weak PasswordGenerationAgent* weakSelf = self; |
| 351 id completionHandler = ^(BOOL success) { | 351 id completionHandler = ^(BOOL success) { |
| 352 if (!success) | 352 if (!success) |
| 353 return; | 353 return; |
| 354 PasswordGenerationAgent* strongSelf = weakSelf; | 354 PasswordGenerationAgent* strongSelf = weakSelf; |
| 355 if (!strongSelf) | 355 if (!strongSelf) |
| 356 return; | 356 return; |
| 357 if (strongSelf->_passwordManager) { | 357 if (strongSelf->_passwordManager) { |
| 358 // Might be null in tests. | 358 // Might be null in tests. |
| 359 strongSelf->_passwordManager->SetHasGeneratedPasswordForForm( | 359 strongSelf->_passwordManager->OnPresaveGeneratedPassword( |
| 360 strongSelf->_passwordManagerDriver, | 360 *strongSelf->_possibleAccountCreationForm); |
| 361 *strongSelf->_possibleAccountCreationForm, true); | |
| 362 } | 361 } |
| 363 if (strongSelf->_accessoryViewReadyCompletion) { | 362 if (strongSelf->_accessoryViewReadyCompletion) { |
| 364 strongSelf->_accessoryViewReadyCompletion( | 363 strongSelf->_accessoryViewReadyCompletion( |
| 365 [strongSelf currentAccessoryView], strongSelf); | 364 [strongSelf currentAccessoryView], strongSelf); |
| 366 } | 365 } |
| 367 }; | 366 }; |
| 368 [_javaScriptPasswordManager fillPasswordForm:[self passwordGenerationFormName] | 367 [_javaScriptPasswordManager fillPasswordForm:[self passwordGenerationFormName] |
| 369 withGeneratedPassword:_generatedPassword | 368 withGeneratedPassword:_generatedPassword |
| 370 completionHandler:completionHandler]; | 369 completionHandler:completionHandler]; |
| 371 } | 370 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 DCHECK(_accessoryViewReadyCompletion); | 435 DCHECK(_accessoryViewReadyCompletion); |
| 437 _accessoryViewReadyCompletion([self currentAccessoryView], self); | 436 _accessoryViewReadyCompletion([self currentAccessoryView], self); |
| 438 } | 437 } |
| 439 | 438 |
| 440 - (BOOL)getLogKeyboardAccessoryMetrics { | 439 - (BOOL)getLogKeyboardAccessoryMetrics { |
| 441 // Only store metrics for regular Autofill, not passwords. | 440 // Only store metrics for regular Autofill, not passwords. |
| 442 return NO; | 441 return NO; |
| 443 } | 442 } |
| 444 | 443 |
| 445 @end | 444 @end |
| OLD | NEW |