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/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 } // namespace extensions | 25 } // namespace extensions |
26 | 26 |
27 namespace hotword_internal { | 27 namespace hotword_internal { |
28 // Constants for the hotword field trial. | 28 // Constants for the hotword field trial. |
29 extern const char kHotwordFieldTrialName[]; | 29 extern const char kHotwordFieldTrialName[]; |
30 extern const char kHotwordFieldTrialDisabledGroupName[]; | 30 extern const char kHotwordFieldTrialDisabledGroupName[]; |
31 } // namespace hotword_internal | 31 } // namespace hotword_internal |
32 | 32 |
33 // Provides an interface for the Hotword component that does voice triggered | 33 // Provides an interface for the Hotword component that does voice triggered |
34 // search. | 34 // search. |
35 class HotwordService : public content::NotificationObserver, | 35 class HotwordService : public extensions::ExtensionRegistryObserver, |
36 public extensions::ExtensionRegistryObserver, | |
37 public KeyedService { | 36 public KeyedService { |
38 public: | 37 public: |
39 // Returns true if the hotword supports the current system language. | 38 // Returns true if the hotword supports the current system language. |
40 static bool DoesHotwordSupportLanguage(Profile* profile); | 39 static bool DoesHotwordSupportLanguage(Profile* profile); |
41 | 40 |
42 // Returns true if the "enable-experimental-hotwording" flag is set. | 41 // Returns true if the "enable-experimental-hotwording" flag is set. |
43 static bool IsExperimentalHotwordingEnabled(); | 42 static bool IsExperimentalHotwordingEnabled(); |
44 | 43 |
45 explicit HotwordService(Profile* profile); | 44 explicit HotwordService(Profile* profile); |
46 virtual ~HotwordService(); | 45 virtual ~HotwordService(); |
47 | 46 |
48 // Overridden from content::NotificationObserver: | |
49 virtual void Observe(int type, | |
50 const content::NotificationSource& source, | |
51 const content::NotificationDetails& details) override; | |
52 | |
53 // Overridden from ExtensionRegisterObserver: | 47 // Overridden from ExtensionRegisterObserver: |
54 virtual void OnExtensionInstalled( | 48 virtual void OnExtensionInstalled( |
55 content::BrowserContext* browser_context, | 49 content::BrowserContext* browser_context, |
56 const extensions::Extension* extension, | 50 const extensions::Extension* extension, |
57 bool is_update) override; | 51 bool is_update) override; |
58 virtual void OnExtensionUninstalled( | 52 virtual void OnExtensionUninstalled( |
59 content::BrowserContext* browser_context, | 53 content::BrowserContext* browser_context, |
60 const extensions::Extension* extension, | 54 const extensions::Extension* extension, |
61 extensions::UninstallReason reason) override; | 55 extensions::UninstallReason reason) override; |
62 | 56 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 139 |
146 base::WeakPtrFactory<HotwordService> weak_factory_; | 140 base::WeakPtrFactory<HotwordService> weak_factory_; |
147 | 141 |
148 // Stores the launch mode for the Hotword Audio Verification App. | 142 // Stores the launch mode for the Hotword Audio Verification App. |
149 LaunchMode hotword_audio_verification_launch_mode_; | 143 LaunchMode hotword_audio_verification_launch_mode_; |
150 | 144 |
151 DISALLOW_COPY_AND_ASSIGN(HotwordService); | 145 DISALLOW_COPY_AND_ASSIGN(HotwordService); |
152 }; | 146 }; |
153 | 147 |
154 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 148 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
OLD | NEW |