Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(700)

Unified Diff: chrome/browser/metrics/desktop_engagement/desktop_engagement_service.h

Issue 2412133002: [M54] Merge DesktopEngagementService fixes. (Closed)
Patch Set: Unittest fixes. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/metrics/desktop_engagement/desktop_engagement_service.h
diff --git a/chrome/browser/metrics/desktop_engagement/desktop_engagement_service.h b/chrome/browser/metrics/desktop_engagement/desktop_engagement_service.h
index 789acec9300c0937d864059bd896f3b52757fe31..c94a83f5b8159bc7e35e18b5fd936fdecc626b01 100644
--- a/chrome/browser/metrics/desktop_engagement/desktop_engagement_service.h
+++ b/chrome/browser/metrics/desktop_engagement/desktop_engagement_service.h
@@ -31,8 +31,10 @@ class DesktopEngagementService : public AudibleContentsTracker::Observer {
// Called when user interaction with the browser is caught.
void OnUserEvent();
- // Called when visibility of the browser changes.
- void OnVisibilityChanged(bool visible);
+ // Called when visibility of the browser changes. These events can be delayed
+ // due to timeout logic, the extent of which can be communicated via
+ // |time_ago|. This time is used to correct the session duration.
+ void OnVisibilityChanged(bool visible, base::TimeDelta time_ago);
bool is_visible() const { return is_visible_; }
bool in_session() const { return in_session_; }
@@ -62,7 +64,9 @@ class DesktopEngagementService : public AudibleContentsTracker::Observer {
void StartSession();
// Ends the session and saves session information into histograms.
- void EndSession();
+ // |time_to_discount| contains the amount of time that should be removed from
+ // the apparent session length due to timeout logic.
+ void EndSession(base::TimeDelta time_to_discount);
// Sets |inactivity_timeout_| based on variation params.
void InitInactivityTimeout();

Powered by Google App Engine
This is Rietveld 408576698