| 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 |
| 11 class Profile; | 12 class Profile; |
| 12 | 13 |
| 13 namespace hotword_internal { | 14 namespace hotword_internal { |
| 14 // Constants for the hotword field trial. | 15 // Constants for the hotword field trial. |
| 15 extern const char kHotwordFieldTrialName[]; | 16 extern const char kHotwordFieldTrialName[]; |
| 16 extern const char kHotwordFieldTrialDisabledGroupName[]; | 17 extern const char kHotwordFieldTrialDisabledGroupName[]; |
| 17 } // namespace hotword_internal | 18 } // namespace hotword_internal |
| 18 | 19 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 43 // Determine if hotwording is allowed in this profile based on field trials | 44 // Determine if hotwording is allowed in this profile based on field trials |
| 44 // and language. | 45 // and language. |
| 45 virtual bool IsHotwordAllowed(); | 46 virtual bool IsHotwordAllowed(); |
| 46 | 47 |
| 47 // Used in the case of an error with the current hotword extension. Tries | 48 // 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. | 49 // 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 | 50 // Returns true upon successful attempt at reload or if the extension has |
| 50 // already loaded successfully by some other means. | 51 // already loaded successfully by some other means. |
| 51 virtual bool RetryHotwordExtension(); | 52 virtual bool RetryHotwordExtension(); |
| 52 | 53 |
| 54 // Control the state of the hotword extension. |
| 55 void DisableHotwordExtension(); |
| 56 void EnableHotwordExtension(); |
| 57 |
| 58 // Handles enabling/disabling the hotword extension when the user |
| 59 // turns it off via the settings menu. |
| 60 void OnHotwordSearchEnabledChanged(const std::string& pref_name); |
| 61 |
| 53 private: | 62 private: |
| 54 Profile* profile_; | 63 Profile* profile_; |
| 55 | 64 |
| 65 PrefChangeRegistrar pref_registrar_; |
| 66 |
| 56 DISALLOW_COPY_AND_ASSIGN(HotwordService); | 67 DISALLOW_COPY_AND_ASSIGN(HotwordService); |
| 57 }; | 68 }; |
| 58 | 69 |
| 59 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 70 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
| OLD | NEW |