OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
6 #define CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 6 #define CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/prefs/pref_change_registrar.h" |
9 #include "components/keyed_service/core/keyed_service.h" | 10 #include "components/keyed_service/core/keyed_service.h" |
10 | 11 |
| 12 class ExtensionService; |
11 class Profile; | 13 class Profile; |
12 | 14 |
13 namespace hotword_internal { | 15 namespace hotword_internal { |
14 // Constants for the hotword field trial. | 16 // Constants for the hotword field trial. |
15 extern const char kHotwordFieldTrialName[]; | 17 extern const char kHotwordFieldTrialName[]; |
16 extern const char kHotwordFieldTrialDisabledGroupName[]; | 18 extern const char kHotwordFieldTrialDisabledGroupName[]; |
17 } // namespace hotword_internal | 19 } // namespace hotword_internal |
18 | 20 |
19 // Provides an interface for the Hotword component that does voice triggered | 21 // Provides an interface for the Hotword component that does voice triggered |
20 // search. | 22 // search. |
(...skipping 22 matching lines...) Expand all Loading... |
43 // Determine if hotwording is allowed in this profile based on field trials | 45 // Determine if hotwording is allowed in this profile based on field trials |
44 // and language. | 46 // and language. |
45 virtual bool IsHotwordAllowed(); | 47 virtual bool IsHotwordAllowed(); |
46 | 48 |
47 // Used in the case of an error with the current hotword extension. Tries | 49 // Used in the case of an error with the current hotword extension. Tries |
48 // to reload the extension or in the case of failure, tries to re-download it. | 50 // to reload the extension or in the case of failure, tries to re-download it. |
49 // Returns true upon successful attempt at reload or if the extension has | 51 // Returns true upon successful attempt at reload or if the extension has |
50 // already loaded successfully by some other means. | 52 // already loaded successfully by some other means. |
51 virtual bool RetryHotwordExtension(); | 53 virtual bool RetryHotwordExtension(); |
52 | 54 |
| 55 // Control the state of the hotword extension. |
| 56 void EnableHotwordExtension(ExtensionService* extension_service); |
| 57 void DisableHotwordExtension(ExtensionService* extension_service); |
| 58 |
| 59 // Handles enabling/disabling the hotword extension when the user |
| 60 // turns it off via the settings menu. |
| 61 void OnHotwordSearchEnabledChanged(const std::string& pref_name); |
| 62 |
53 private: | 63 private: |
54 Profile* profile_; | 64 Profile* profile_; |
55 | 65 |
| 66 PrefChangeRegistrar pref_registrar_; |
| 67 |
56 DISALLOW_COPY_AND_ASSIGN(HotwordService); | 68 DISALLOW_COPY_AND_ASSIGN(HotwordService); |
57 }; | 69 }; |
58 | 70 |
59 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 71 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
OLD | NEW |