[Autofill Assistant] Remove string for ValueExpression

This deprecates string value expressions favor of |ValueExpression|.

This is done for:
* AutofillValue
* AutofillValueRegexp
* RequiredField

The error reporting for RequiredFields is kept as a string value
expression. This is debug information that is not meant for processing.

Bug: b/186190903
Change-Id: Ic3e2f9c266d2afb0098d5aba550b2041f2521246
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2871605
Commit-Queue: Sandro Maggi <[email protected]>
Reviewed-by: Clemens Arbesser <[email protected]>
Reviewed-by: Stephane Zermatten <[email protected]>
Cr-Commit-Position: refs/heads/master@{#881421}
diff --git a/components/autofill_assistant/browser/field_formatter.h b/components/autofill_assistant/browser/field_formatter.h
index 74a9516..920fbfc 100644
--- a/components/autofill_assistant/browser/field_formatter.h
+++ b/components/autofill_assistant/browser/field_formatter.h
@@ -10,6 +10,8 @@
 #include "base/optional.h"
 #include "components/autofill/core/browser/data_model/autofill_profile.h"
 #include "components/autofill/core/browser/data_model/credit_card.h"
+#include "components/autofill_assistant/browser/action_value.pb.h"
+#include "components/autofill_assistant/browser/client_status.h"
 
 namespace autofill_assistant {
 namespace field_formatter {
@@ -24,6 +26,15 @@
     const std::map<std::string, std::string>& mappings,
     bool strict = true);
 
+// Turns a |value_expression| into a string, replacing |key| chunks with
+// corresponding values in |mappings|. This will fail if any of the keys are
+// not in |mappings|. If |quote_meta| the replacement pieces will be quoted.
+ClientStatus FormatExpression(
+    const ValueExpression& value_expression,
+    const std::map<std::string, std::string>& mappings,
+    bool quote_meta,
+    std::string* out_value);
+
 // Creates a lookup map for all non-empty autofill and custom
 // AutofillFormatProto::AutofillAssistantCustomField field types in
 // |autofill_data_model|.