#ifndef CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_
#include "base/prefs/pref_change_registrar.h"
#include "base/values.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/common/extensions/api/hotword_private.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
class Profile;
namespace extensions {
class HotwordPrivateEventService : public BrowserContextKeyedAPI {
public:
explicit HotwordPrivateEventService(content::BrowserContext* context);
virtual ~HotwordPrivateEventService();
virtual void Shutdown() OVERRIDE;
static BrowserContextKeyedAPIFactory<HotwordPrivateEventService>*
GetFactoryInstance();
static const char* service_name();
void OnEnabledChanged(const std::string& pref_name);
private:
friend class BrowserContextKeyedAPIFactory<HotwordPrivateEventService>;
void SignalEvent();
Profile* profile_;
PrefChangeRegistrar pref_change_registrar_;
};
class HotwordPrivateSetEnabledFunction : public ChromeSyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("hotwordPrivate.setEnabled",
HOTWORDPRIVATE_SETENABLED)
protected:
virtual ~HotwordPrivateSetEnabledFunction() {}
virtual bool RunImpl() OVERRIDE;
};
class HotwordPrivateSetAudioLoggingEnabledFunction
: public ChromeSyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("hotwordPrivate.setAudioLoggingEnabled",
HOTWORDPRIVATE_SETAUDIOLOGGINGENABLED)
protected:
virtual ~HotwordPrivateSetAudioLoggingEnabledFunction() {}
virtual bool RunImpl() OVERRIDE;
};
class HotwordPrivateGetStatusFunction : public ChromeSyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("hotwordPrivate.getStatus",
HOTWORDPRIVATE_GETSTATUS)
protected:
virtual ~HotwordPrivateGetStatusFunction() {}
virtual bool RunImpl() OVERRIDE;
};
}
#endif