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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 virtual bool UninstallHotwordExtension(ExtensionService* extension_service); | 103 virtual bool UninstallHotwordExtension(ExtensionService* extension_service); |
104 virtual void InstallHotwordExtensionFromWebstore(); | 104 virtual void InstallHotwordExtensionFromWebstore(); |
105 | 105 |
106 // Sets the pref value of the previous language. | 106 // Sets the pref value of the previous language. |
107 void SetPreviousLanguagePref(); | 107 void SetPreviousLanguagePref(); |
108 | 108 |
109 // Returns the current error message id. A value of 0 indicates | 109 // Returns the current error message id. A value of 0 indicates |
110 // no error. | 110 // no error. |
111 int error_message() { return error_message_; } | 111 int error_message() { return error_message_; } |
112 | 112 |
113 // These methods are for getting and setting the launch Mode of the | |
114 // Hotword Audio Verification App. The app needs to know the state of the | |
115 // Audio History and Hotword settings in order to know which opt-in flow | |
116 // to use. | |
117 // | |
118 // TODO(kcarattini): Remove this when | |
119 // https://code.google.com/p/chromium/issues/detail?id=165573 is fixed, | |
120 // at which time we can simply launch the app in the given mode instead of | |
121 // having to check for it here. | |
122 enum LaunchMode { | |
123 AUDIO_HISTORY_ONLY, | |
124 HOTWORD_ONLY, | |
125 HOTWORD_AND_AUDIO_HISTORY | |
126 }; | |
127 void SetHotwordAudioVerificationLaunchState(const std::string& pref_name); | |
128 LaunchMode GetHotwordAudioVerificationLaunchState(); | |
129 | |
113 private: | 130 private: |
114 Profile* profile_; | 131 Profile* profile_; |
115 | 132 |
116 PrefChangeRegistrar pref_registrar_; | 133 PrefChangeRegistrar pref_registrar_; |
117 | 134 |
118 content::NotificationRegistrar registrar_; | 135 content::NotificationRegistrar registrar_; |
119 | 136 |
120 // For observing the ExtensionRegistry. | 137 // For observing the ExtensionRegistry. |
121 ScopedObserver<extensions::ExtensionRegistry, | 138 ScopedObserver<extensions::ExtensionRegistry, |
122 extensions::ExtensionRegistryObserver> | 139 extensions::ExtensionRegistryObserver> |
123 extension_registry_observer_; | 140 extension_registry_observer_; |
124 | 141 |
125 scoped_refptr<extensions::WebstoreStandaloneInstaller> installer_; | 142 scoped_refptr<extensions::WebstoreStandaloneInstaller> installer_; |
126 | 143 |
127 HotwordClient* client_; | 144 HotwordClient* client_; |
128 int error_message_; | 145 int error_message_; |
129 bool reinstall_pending_; | 146 bool reinstall_pending_; |
130 | 147 |
131 base::WeakPtrFactory<HotwordService> weak_factory_; | 148 base::WeakPtrFactory<HotwordService> weak_factory_; |
132 | 149 |
150 // Stores a bit of state for the Hotword Audio Verification App. | |
benwells
2014/09/09 20:57:31
Super nit: a bit? Meaning 0 or 1?
kcarattini
2014/09/10 08:14:28
Done.
| |
151 LaunchMode hotword_audio_verification_launch_state_; | |
152 | |
133 DISALLOW_COPY_AND_ASSIGN(HotwordService); | 153 DISALLOW_COPY_AND_ASSIGN(HotwordService); |
134 }; | 154 }; |
135 | 155 |
136 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 156 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
OLD | NEW |