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-by: Christopher Thompson <>
Commit-Queue: Charlie Harrison <>
Cr-Commit-Position: refs/heads/master@{#641209}
4 files changed