| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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_MEDIA_MEDIA_ENGAGEMENT_SERVICE_H_ |
| 6 #define CHROME_BROWSER_MEDIA_MEDIA_ENGAGEMENT_SERVICE_H_ |
| 7 |
| 8 #include <set> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "components/keyed_service/core/keyed_service.h" |
| 12 |
| 13 class Profile; |
| 14 |
| 15 namespace content { |
| 16 class WebContents; |
| 17 } // namespace content |
| 18 |
| 19 class MediaEngagementService : public KeyedService { |
| 20 public: |
| 21 // Returns the instance attached to the given |profile|. |
| 22 static MediaEngagementService* Get(Profile* profile); |
| 23 |
| 24 // Returns whether the feature is enabled. |
| 25 static bool IsEnabled(); |
| 26 |
| 27 // Observe the given |web_contents| by creating an internal |
| 28 // WebContentsObserver. |
| 29 static void CreateWebContentsObserver(content::WebContents* web_contents); |
| 30 |
| 31 explicit MediaEngagementService(Profile* profile); |
| 32 ~MediaEngagementService() override; |
| 33 |
| 34 private: |
| 35 class ContentsObserver; |
| 36 |
| 37 std::set<ContentsObserver*> contents_observers_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(MediaEngagementService); |
| 40 }; |
| 41 |
| 42 #endif // CHROME_BROWSER_MEDIA_MEDIA_ENGAGEMENT_SERVICE_H_ |
| OLD | NEW |