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.
4
5#ifndef CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_
6#define CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_
7
8#include "base/compiler_specific.h"
9#include "base/memory/ref_counted.h"
10#include "content/public/browser/notification_observer.h"
11#include "content/public/browser/notification_registrar.h"
12
13namespace syncer {
14class ExtensionsActivity;
15}
16
17namespace browser_sync {
18
19// Observe and record usage of extension bookmark API.
20class ExtensionsActivityMonitor : public content::NotificationObserver {
21 public:
22  ExtensionsActivityMonitor();
23  virtual ~ExtensionsActivityMonitor();
24
25  // content::NotificationObserver implementation.
26  virtual void Observe(int type,
27                       const content::NotificationSource& source,
28                       const content::NotificationDetails& details) OVERRIDE;
29
30  const scoped_refptr<syncer::ExtensionsActivity>& GetExtensionsActivity();
31
32 private:
33  scoped_refptr<syncer::ExtensionsActivity> extensions_activity_;
34
35  // Used only on UI loop.
36  content::NotificationRegistrar registrar_;
37};
38
39}  // namespace browser_sync
40
41#endif  // CHROME_BROWSER_SYNC_GLUE_EXTENSIONS_ACTIVITY_MONITOR_H_
42