| 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/browser_context_keyed_service/browser_context_keyed_service
.h" | 10 #include "components/browser_context_keyed_service/browser_context_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 16 matching lines...) Expand all Loading... |
| 37 void ShowOptInPopup(); | 39 void ShowOptInPopup(); |
| 38 | 40 |
| 39 // Checks for whether all the necessary files have downloaded to allow for | 41 // Checks for whether all the necessary files have downloaded to allow for |
| 40 // using the extension. | 42 // using the extension. |
| 41 virtual bool IsServiceAvailable(); | 43 virtual bool IsServiceAvailable(); |
| 42 | 44 |
| 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 |
| 49 // Control the state of the hotword extension. |
| 50 void EnableHotwordExtension(ExtensionService* extension_service); |
| 51 void DisableHotwordExtension(ExtensionService* extension_service); |
| 52 |
| 53 // Handles enabling/disabling the hotword extension when the user |
| 54 // turns it off via the settings menu. |
| 55 void OnHotwordSearchEnabledChanged(const std::string& pref_name); |
| 56 |
| 47 private: | 57 private: |
| 48 Profile* profile_; | 58 Profile* profile_; |
| 49 | 59 |
| 60 PrefChangeRegistrar pref_registrar_; |
| 61 |
| 50 DISALLOW_COPY_AND_ASSIGN(HotwordService); | 62 DISALLOW_COPY_AND_ASSIGN(HotwordService); |
| 51 }; | 63 }; |
| 52 | 64 |
| 53 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 65 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
| OLD | NEW |