Add histograms for time to update.

This change adds histograms for the total time from when the update is
first seen by the client to when the update is downloaded (but before
the device has rebooted). There are two histograms, one for the total
time in minutes when the client has a time restriction policy for
updates, and one for when the client has no policy in place.

These two histograms are only reported for enterprise devices.

CL where the histogram is used:
https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1179230


BUG=chromium:852860
TEST=Run through scenarios and checked chrome://histograms

Change-Id: Ib4b8d0126087d5951b79d7f4d2022c2c776744a7
Reviewed-on: https://chromium-review.googlesource.com/1181649
Commit-Queue: May Lippert <maybelle@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587752}
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index e7a88dce..486667f8 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -109330,6 +109330,35 @@
   </summary>
 </histogram>
 
+<histogram
+    name="UpdateEngine.SuccessfulUpdate.DurationFromSeenDays.NoTimeRestriction"
+    units="days">
+  <owner>maybelle@chromium.org</owner>
+  <owner>zentaro@chromium.org</owner>
+  <summary>
+    The total number of days from when an update is first seen to when an update
+    is finished downloading (but before rebooting). This metric is recorded on
+    enterprise-enrolled devices that do not have the
+    DeviceAutoUpdateTimeRestrictions policy enabled.
+
+    This metric is specific to Chrome OS.
+  </summary>
+</histogram>
+
+<histogram
+    name="UpdateEngine.SuccessfulUpdate.DurationFromSeenDays.TimeRestricted"
+    units="days">
+  <owner>maybelle@chromium.org</owner>
+  <owner>zentaro@chromium.org</owner>
+  <summary>
+    The total number of days from when an update is first seen to when an update
+    is finished downloading (but before rebooting). This metric is recorded on
+    devices that have the DeviceAutoUpdateTimeRestrictions policy enabled.
+
+    This metric is specific to Chrome OS.
+  </summary>
+</histogram>
+
 <histogram name="UpdateEngine.SuccessfulUpdate.PayloadSizeMiB" units="MiB">
   <owner>zeuthen@chromium.org</owner>
   <summary>