Protos to add LogData to Frames/Elements

PiperOrigin-RevId: 252120173
Change-Id: I3bf3af77f716f8d3d6742ac00b24431860c99287
diff --git a/src/main/proto/search/now/ui/piet/binding_refs.proto b/src/main/proto/search/now/ui/piet/binding_refs.proto
index e3db9db..3d1aa8b 100644
--- a/src/main/proto/search/now/ui/piet/binding_refs.proto
+++ b/src/main/proto/search/now/ui/piet/binding_refs.proto
@@ -95,7 +95,7 @@
 // VED binding references are always optional.
 message VedBindingRef {
   // The unique ID for this binding. See comments at the top of the file.
-  optional string binding_id = 1;
+  optional string binding_id = 1 [deprecated = true];
 }
 
 message TemplateBindingRef {
@@ -123,3 +123,9 @@
   // The unique ID for this binding. See comments at the top of the file.
   optional string binding_id = 1;
 }
+
+// LogData binding references are always optional.
+message LogDataBindingRef {
+  // The unique ID for this binding. See comments at the top of the file.
+  optional string binding_id = 1;
+}
diff --git a/src/main/proto/search/now/ui/piet/elements.proto b/src/main/proto/search/now/ui/piet/elements.proto
index 41ac302..d2e5d96 100644
--- a/src/main/proto/search/now/ui/piet/elements.proto
+++ b/src/main/proto/search/now/ui/piet/elements.proto
@@ -22,6 +22,7 @@
 import "src/main/proto/search/now/ui/piet/actions.proto";
 import "src/main/proto/search/now/ui/piet/binding_refs.proto";
 import "src/main/proto/search/now/ui/piet/images.proto";
+import "src/main/proto/search/now/ui/piet/log_data.proto";
 import "src/main/proto/search/now/ui/piet/styles.proto";
 import "src/main/proto/search/now/ui/piet/text.proto";
 
@@ -126,7 +127,7 @@
 // Element size expands to fill its container, unless the content is taller than
 // the container, and the container height is not specified explicitly. In that
 // case, the Element and the container both get the height of the content.
-// Next Id: 25
+// Next Id: 27
 message Element {
   // The specific content represented by this Element.
   oneof elements {
@@ -235,11 +236,11 @@
   oneof ved_value {
     // A base64 encoded serialized ClickTrackingCGI proto that identifies the
     // logged Visual Element corresponding to this piet Element.
-    string ved = 9;
+    string ved = 9 [deprecated = true];
 
     // A VedBindingRef to the VED that this Element will be bound to.
     // This is only meant to be used for Elements defined by a Template.
-    VedBindingRef ved_binding = 10;
+    VedBindingRef ved_binding = 10 [deprecated = true];
   }
 
   // Styles to apply to this Element. If any style_ids cannot be found,
@@ -248,6 +249,10 @@
 
   // Visibility state that can be controlled with binding.
   optional VisibilityState visibility_state = 23;
+  oneof log_data_value {
+    LogData log_data = 25;
+    LogDataBindingRef log_data_ref = 26;
+  }
 
   // Please use CL numbers you own for extension numbers.
   extensions 10000 to max;
@@ -542,7 +547,7 @@
 
 // A BindingValue is a name/value pair which provides a value to be substituted
 // wherever the specified `binding_id` is defined in the Template.
-// Next Id: 17
+// Next Id: 18
 message BindingValue {
   // The name of the binding within the Template where this BindingValue should
   // be substituted. Must be unique within a binding context.
@@ -652,6 +657,8 @@
     // A Base64-encoded serialized ClickTrackingCGI proto that identifies the
     // logged Visual Element corresponding to a bound Piet Template.
     string ved = 7;
+
+    LogData log_data = 17;
   }
 
   // Data to provide a host in order for host to fulfill a binding for Piet.
diff --git a/src/main/proto/search/now/ui/piet/log_data.proto b/src/main/proto/search/now/ui/piet/log_data.proto
new file mode 100644
index 0000000..eedd55d
--- /dev/null
+++ b/src/main/proto/search/now/ui/piet/log_data.proto
@@ -0,0 +1,29 @@
+// Copyright 2018 The Feed Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto2";
+
+package search.now.ui.piet;
+
+option optimize_for=LITE_RUNTIME;
+
+option java_package = "com.google.search.now.ui.piet";
+option java_outer_classname = "LogDataProto";
+option cc_enable_arenas = true;
+
+// LogData used to contain piet-agnostic information used for logging.
+message LogData {
+  // Please use CL numbers you own for extension numbers.
+  extensions 10000 to max;
+}
diff --git a/src/main/proto/search/now/ui/piet/piet.proto b/src/main/proto/search/now/ui/piet/piet.proto
index a84e74b..0baa7eb 100644
--- a/src/main/proto/search/now/ui/piet/piet.proto
+++ b/src/main/proto/search/now/ui/piet/piet.proto
@@ -14,15 +14,16 @@
 
 syntax = "proto2";
 
-import "src/main/proto/search/now/ui/piet/actions.proto";
-import "src/main/proto/search/now/ui/piet/elements.proto";
-import "src/main/proto/search/now/ui/piet/media_queries.proto";
-import "src/main/proto/search/now/ui/piet/styles.proto";
-
 package search.now.ui.piet;
 
 option optimize_for=LITE_RUNTIME;
 
+import "src/main/proto/search/now/ui/piet/actions.proto";
+import "src/main/proto/search/now/ui/piet/elements.proto";
+import "src/main/proto/search/now/ui/piet/log_data.proto";
+import "src/main/proto/search/now/ui/piet/media_queries.proto";
+import "src/main/proto/search/now/ui/piet/styles.proto";
+
 option java_package = "com.google.search.now.ui.piet";
 option java_outer_classname = "PietProto";
 option cc_enable_arenas = true;
@@ -79,7 +80,7 @@
 // A Frame is the top-level UI construct in Piet. Every layout is contained
 // within a Frame. Each frame defines the contents displayed to the user as a
 // single view, which may contain a complex set of child views.
-// NextId: 12
+// NextId: 13
 message Frame {
   // A string tag for the frame, currently used for debugging purposes. Need not
   // be unique.
@@ -143,7 +144,10 @@
 
   // A Base64-encoded serialized ClickTrackingCGI proto that identifies the
   // logged Visual Element corresponding to this Frame.
-  optional string ved = 8;
+  optional string ved = 8 [deprecated = true];
+
+  //
+  optional LogData log_data = 12;
 
   // Please use CL numbers you own for extension numbers.
   extensions 10000 to max;