#ifndef CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_WATCHER_H_
#define CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_WATCHER_H_
#include "base/observer_list.h"
#include "base/observer_list_types.h"
#include "build/build_config.h"
#include "components/keyed_service/core/keyed_service.h"
#include "extensions/buildflags/buildflags.h"
static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE));
namespace content {
class BrowserContext;
}
class ExtensionFunction;
namespace extensions {
class BookmarksApiWatcher : public KeyedService {
public:
class Observer : public base::CheckedObserver {
public:
virtual void OnBookmarksApiInvoked(const ExtensionFunction* func) {}
};
static BookmarksApiWatcher* GetForBrowserContext(
content::BrowserContext* browser_context);
BookmarksApiWatcher();
~BookmarksApiWatcher() override;
BookmarksApiWatcher(const BookmarksApiWatcher&) = delete;
BookmarksApiWatcher& operator=(const BookmarksApiWatcher&) = delete;
void NotifyApiInvoked(const ExtensionFunction* func);
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
static void EnsureFactoryBuilt();
private:
base::ObserverList<Observer> observers_;
};
}
#endif