17d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
57d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#ifndef COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_PREDICTIONS_H__
67d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#define COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_PREDICTIONS_H__
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <vector>
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
117d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "components/autofill/core/common/form_data.h"
127d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "components/autofill/core/common/form_field_data_predictions.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
14c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)namespace autofill {
15c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Holds information about a form to be filled and/or submitted.
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)struct FormDataPredictions {
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Data for this form.
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  FormData data;
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The form signature for communication with the crowdsourcing server.
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  std::string signature;
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The experiment id for the server predictions.
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  std::string experiment_id;
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The form fields and their predicted field types.
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  std::vector<FormFieldDataPredictions> fields;
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  FormDataPredictions();
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  FormDataPredictions(const FormDataPredictions& other);
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  ~FormDataPredictions();
30eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
31eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  // Added for the sake of testing.
32eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  bool operator==(const FormDataPredictions& predictions) const;
33eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  bool operator!=(const FormDataPredictions& predictions) const;
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
36c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)}  // namespace autofill
37c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
387d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#endif  // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_PREDICTIONS_H__
39