password_manager_driver_bridge.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_PASSWORD_MANAGER_IOS_PASSWORD_MANAGER_DRIVER_BRIDGE_H_
  5. #define COMPONENTS_PASSWORD_MANAGER_IOS_PASSWORD_MANAGER_DRIVER_BRIDGE_H_
  6. #import <Foundation/Foundation.h>
  7. namespace autofill {
  8. struct PasswordFormFillData;
  9. struct PasswordFormGenerationData;
  10. } // namespace autofill
  11. class GURL;
  12. namespace password_manager {
  13. class PasswordGenerationFrameHelper;
  14. } // namespace password_manager
  15. // C++ to ObjC bridge for methods of PasswordManagerDriver.
  16. @protocol PasswordManagerDriverBridge
  17. @property(readonly, nonatomic) const GURL& lastCommittedURL;
  18. // Finds and fills the password form using the supplied |formData| to
  19. // match the password form and to populate the field values. Calls
  20. // |completionHandler| with YES if a form field has been filled, NO otherwise.
  21. // |completionHandler| can be nil.
  22. - (void)fillPasswordForm:(const autofill::PasswordFormFillData&)formData
  23. completionHandler:(void (^)(BOOL))completionHandler;
  24. // Informs delegate that there are no saved credentials for the current page.
  25. - (void)onNoSavedCredentials;
  26. // Gets the PasswordGenerationFrameHelper owned by this delegate.
  27. - (password_manager::PasswordGenerationFrameHelper*)passwordGenerationHelper;
  28. // Informs delegate of form for password generation found.
  29. - (void)formEligibleForGenerationFound:
  30. (const autofill::PasswordFormGenerationData&)form;
  31. @end
  32. #endif // COMPONENTS_PASSWORD_MANAGER_IOS_PASSWORD_MANAGER_DRIVER_BRIDGE_H_