Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Side by Side Diff: chrome/browser/search/hotword_service.h

Issue 528113003: Hotword Audio Verification App: Adds to hotwordPrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@page-one
Patch Set: Rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 launching, and getting and setting the launch mode of
114 // the Hotword Audio Verification App.
115 //
116 // TODO(kcarattini): Remove this when
117 // https://code.google.com/p/chromium/issues/detail?id=165573 is fixed,
118 // at which time we can simply launch the app in the given mode instead of
119 // having to check for it here.
120 enum LaunchMode {
121 AUDIO_HISTORY_ONLY,
122 HOTWORD_ONLY,
123 HOTWORD_AND_AUDIO_HISTORY
124 };
125 void LaunchHotwordAudioVerificationApp(const LaunchMode& launch_mode);
126 virtual LaunchMode GetHotwordAudioVerificationLaunchMode();
127
113 private: 128 private:
114 Profile* profile_; 129 Profile* profile_;
115 130
116 PrefChangeRegistrar pref_registrar_; 131 PrefChangeRegistrar pref_registrar_;
117 132
118 content::NotificationRegistrar registrar_; 133 content::NotificationRegistrar registrar_;
119 134
120 // For observing the ExtensionRegistry. 135 // For observing the ExtensionRegistry.
121 ScopedObserver<extensions::ExtensionRegistry, 136 ScopedObserver<extensions::ExtensionRegistry,
122 extensions::ExtensionRegistryObserver> 137 extensions::ExtensionRegistryObserver>
123 extension_registry_observer_; 138 extension_registry_observer_;
124 139
125 scoped_refptr<extensions::WebstoreStandaloneInstaller> installer_; 140 scoped_refptr<extensions::WebstoreStandaloneInstaller> installer_;
126 141
127 HotwordClient* client_; 142 HotwordClient* client_;
128 int error_message_; 143 int error_message_;
129 bool reinstall_pending_; 144 bool reinstall_pending_;
130 145
131 base::WeakPtrFactory<HotwordService> weak_factory_; 146 base::WeakPtrFactory<HotwordService> weak_factory_;
132 147
148 // Stores the launch mode for the Hotword Audio Verification App.
149 LaunchMode hotword_audio_verification_launch_mode_;
150
133 DISALLOW_COPY_AND_ASSIGN(HotwordService); 151 DISALLOW_COPY_AND_ASSIGN(HotwordService);
134 }; 152 };
135 153
136 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ 154 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698