Fix Security.TimeOnPage histograms

The PageLoadMetricsDelegate now keeps track of foreground duration,
so observers don't need to do so on their own.

This fixes a bug, since in the current code foreground_duration_ is
only updated in OnHidden.

Bug: 942326
Change-Id: I34d64b0369c033a8545ddd2552a7e5dd061c0ef3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1525193
Reviewed-by: Christopher Thompson <cthomp@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#641209}
4 files changed