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_SEARCH_HOTWORD_SERVICE_H_
6 #define CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_
8 #include "base/basictypes.h"
9 #include "components/browser_context_keyed_service/browser_context_keyed_service.h"
13 namespace hotword_internal {
14 // Constants for the hotword field trial.
15 extern const char kHotwordFieldTrialName[];
16 extern const char kHotwordFieldTrialDisabledGroupName[];
17 } // namespace hotword_internal
19 // Provides an interface for the Hotword component that does voice triggered
21 class HotwordService : public BrowserContextKeyedService {
23 // Returns true if the hotword supports the current system language.
24 static bool DoesHotwordSupportLanguage(Profile* profile);
26 explicit HotwordService(Profile* profile);
27 virtual ~HotwordService();
29 bool ShouldShowOptInPopup();
31 // Used in testing to ensure that the popup is not shown more than this
32 // maximum number of times.
33 int MaxNumberTimesToShowOptInPopup();
35 // In addition to showing the popup, the preferences
36 // kHotwordOptInPopupTimesShown is also incremented.
37 void ShowOptInPopup();
39 // Checks for whether all the necessary files have downloaded to allow for
40 // using the extension.
41 virtual bool IsServiceAvailable();
43 // Determine if hotwording is allowed in this profile based on field trials
45 virtual bool IsHotwordAllowed();
50 DISALLOW_COPY_AND_ASSIGN(HotwordService);
53 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_