OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
11 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
| 12 #include "extensions/features/features.h" |
12 | 13 |
13 namespace syncer { | 14 namespace syncer { |
14 class ExtensionsActivity; | 15 class ExtensionsActivity; |
15 } | 16 } |
16 | 17 |
17 namespace browser_sync { | 18 namespace browser_sync { |
18 | 19 |
19 // Observe and record usage of extension bookmark API. | 20 // Observe and record usage of extension bookmark API. |
20 class ExtensionsActivityMonitor : public content::NotificationObserver { | 21 class ExtensionsActivityMonitor : public content::NotificationObserver { |
21 public: | 22 public: |
22 ExtensionsActivityMonitor(); | 23 ExtensionsActivityMonitor(); |
23 ~ExtensionsActivityMonitor() override; | 24 ~ExtensionsActivityMonitor() override; |
24 | 25 |
25 // content::NotificationObserver implementation. | 26 // content::NotificationObserver implementation. |
26 void Observe(int type, | 27 void Observe(int type, |
27 const content::NotificationSource& source, | 28 const content::NotificationSource& source, |
28 const content::NotificationDetails& details) override; | 29 const content::NotificationDetails& details) override; |
29 | 30 |
30 const scoped_refptr<syncer::ExtensionsActivity>& GetExtensionsActivity(); | 31 const scoped_refptr<syncer::ExtensionsActivity>& GetExtensionsActivity(); |
31 | 32 |
32 private: | 33 private: |
33 scoped_refptr<syncer::ExtensionsActivity> extensions_activity_; | 34 scoped_refptr<syncer::ExtensionsActivity> extensions_activity_; |
34 | 35 |
35 #if defined(ENABLE_EXTENSIONS) | 36 #if BUILDFLAG(ENABLE_EXTENSIONS) |
36 // Used only on UI loop. | 37 // Used only on UI loop. |
37 content::NotificationRegistrar registrar_; | 38 content::NotificationRegistrar registrar_; |
38 #endif | 39 #endif |
39 | 40 |
40 DISALLOW_COPY_AND_ASSIGN(ExtensionsActivityMonitor); | 41 DISALLOW_COPY_AND_ASSIGN(ExtensionsActivityMonitor); |
41 }; | 42 }; |
42 | 43 |
43 } // namespace browser_sync | 44 } // namespace browser_sync |
44 | 45 |
45 #endif // CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_ | 46 #endif // CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_ |
OLD | NEW |