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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_
6 #define CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/public/browser/notification_observer.h"
11 #include "content/public/browser/notification_registrar.h"
14 class ExtensionsActivity
;
17 namespace browser_sync
{
19 // Observe and record usage of extension bookmark API.
20 class ExtensionsActivityMonitor
: public content::NotificationObserver
{
22 ExtensionsActivityMonitor();
23 ~ExtensionsActivityMonitor() override
;
25 // content::NotificationObserver implementation.
26 void Observe(int type
,
27 const content::NotificationSource
& source
,
28 const content::NotificationDetails
& details
) override
;
30 const scoped_refptr
<syncer::ExtensionsActivity
>& GetExtensionsActivity();
33 scoped_refptr
<syncer::ExtensionsActivity
> extensions_activity_
;
35 #if defined(ENABLE_EXTENSIONS)
36 // Used only on UI loop.
37 content::NotificationRegistrar registrar_
;
40 DISALLOW_COPY_AND_ASSIGN(ExtensionsActivityMonitor
);
43 } // namespace browser_sync
45 #endif // CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_