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

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

Issue 196753002: [Hotword] Making enabling/disabling the setting enable/disable the hotword extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: undo profile resetter unittest change, but modify behavior when disabling extensions Created 6 years, 9 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 | Annotate | Revision Log
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/prefs/pref_change_registrar.h"
9 #include "components/keyed_service/core/keyed_service.h" 10 #include "components/keyed_service/core/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
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();
miket_OOO 2014/03/17 20:10:51 Teeny nit: Enable usually comes first in the pair.
rpetterson 2014/03/17 21:14:29 Done.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698