password_manager_ios_util.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2017 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_IOS_UTIL_H_
  5. #define COMPONENTS_PASSWORD_MANAGER_IOS_PASSWORD_MANAGER_IOS_UTIL_H_
  6. #import <Foundation/Foundation.h>
  7. #include "url/gurl.h"
  8. namespace web {
  9. class WebState;
  10. }
  11. namespace autofill {
  12. struct FormData;
  13. }
  14. namespace password_manager {
  15. // Checks if |web_state|'s content is a secure HTML. This is done in order to
  16. // ignore API calls from insecure context.
  17. bool WebStateContentIsSecureHtml(const web::WebState* web_state);
  18. // Extracts password form data from |json_string| to |form_data| and returns
  19. // whether the xtraction was successful.
  20. bool JsonStringToFormData(NSString* json_string,
  21. autofill::FormData* form_data,
  22. GURL page_url);
  23. } // namespace password_manager
  24. #endif // COMPONENTS_PASSWORD_MANAGER_IOS_PASSWORD_MANAGER_IOS_UTIL_H_