| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_METRICS_DESKTOP_ENGAGEMENT_SERVICE_H_ |
| 6 #define CHROME_BROWSER_METRICS_DESKTOP_ENGAGEMENT_SERVICE_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/macros.h" |
| 12 #include "base/time/time.h" |
| 13 #include "base/timer/timer.h" |
| 14 |
| 15 class DesktopEngagementService { |
| 16 public: |
| 17 static void Initialize(); |
| 18 |
| 19 void OnUserEvent(); |
| 20 |
| 21 void OnAudioStart(); |
| 22 void OnAudioEnd(); |
| 23 |
| 24 private: |
| 25 DesktopEngagementService(); |
| 26 |
| 27 void StartTimer(base::TimeDelta duration); |
| 28 void OnTimerFired(); |
| 29 |
| 30 void StartSession(); |
| 31 void EndSession(); |
| 32 |
| 33 base::TimeTicks session_start_; |
| 34 base::TimeTicks last_user_event_; |
| 35 |
| 36 bool in_session = false; |
| 37 bool is_audio_playing_ = false; |
| 38 |
| 39 base::OneShotTimer timer_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(DesktopEngagementService); |
| 42 }; |
| 43 |
| 44 #endif // CHROME_BROWSER_METRICS_DESKTOP_ENGAGEMENT_SERVICE_H_ |
| OLD | NEW |