Chromium Code Reviews| 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 "components/keyed_service/core/keyed_service.h" | |
| 11 | |
| 12 class Profile; | |
| 13 | |
| 14 namespace content { | |
| 15 class WebContents; | |
| 16 } // namespace content | |
| 17 | |
| 18 class MediaEngagementService : public KeyedService { | |
|
DaleCurtis
2017/04/25 16:57:59
I thought we used namespaces in chrome/ now?
mlamouri (slow - plz ping)
2017/04/25 17:14:41
I do not remember hearing about this and code arou
| |
| 19 public: | |
| 20 // Returns the instance attached to the given |profile|. | |
| 21 static MediaEngagementService* Get(Profile* profile); | |
| 22 | |
| 23 // Returns whether the feature is enabled. | |
| 24 static bool IsEnabled(); | |
| 25 | |
| 26 // Observe the given |web_contents| by creating an internal | |
| 27 // WebContentsObserver. | |
| 28 static void CreateWebContentsObserver(content::WebContents* web_contents); | |
| 29 | |
| 30 MediaEngagementService(Profile* profile); | |
|
DaleCurtis
2017/04/25 16:57:59
explicit
mlamouri (slow - plz ping)
2017/04/25 17:14:41
We need automatic checks for these. Too easy to ad
| |
| 31 ~MediaEngagementService() override; | |
| 32 | |
| 33 private: | |
| 34 class ContentsObserver; | |
| 35 | |
| 36 std::set<ContentsObserver*> contents_observers_; | |
|
DaleCurtis
2017/04/25 16:57:59
How many of these are expected? base::flat_set?
mlamouri (slow - plz ping)
2017/04/25 17:14:41
One per tab. I don't think flat_set is appropriate
| |
| 37 }; | |
|
DaleCurtis
2017/04/25 16:57:59
DISALLOW_COPY_AND_ASSIGN().
mlamouri (slow - plz ping)
2017/04/25 17:14:41
Done.
| |
| 38 | |
| 39 #endif // CHROME_BROWSER_MEDIA_MEDIA_ENGAGEMENT_SERVICE_H_ | |
| OLD | NEW |