#ifndef CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_
#define CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_
#include "base/basictypes.h"
#include "base/prefs/pref_change_registrar.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
class ExtensionService;
class Profile;
namespace hotword_internal {
extern const char kHotwordFieldTrialName[];
extern const char kHotwordFieldTrialDisabledGroupName[];
}
class HotwordService : public content::NotificationObserver,
public KeyedService {
public:
static bool DoesHotwordSupportLanguage(Profile* profile);
explicit HotwordService(Profile* profile);
virtual ~HotwordService();
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
bool ShouldShowOptInPopup();
int MaxNumberTimesToShowOptInPopup();
void ShowOptInPopup();
virtual bool IsServiceAvailable();
virtual bool IsHotwordAllowed();
bool IsOptedIntoAudioLogging();
virtual bool RetryHotwordExtension();
void EnableHotwordExtension(ExtensionService* extension_service);
void DisableHotwordExtension(ExtensionService* extension_service);
void OnHotwordSearchEnabledChanged(const std::string& pref_name);
private:
Profile* profile_;
PrefChangeRegistrar pref_registrar_;
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(HotwordService);
};
#endif