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

Side by Side Diff: chrome/browser/resources/hotword/launcher_manager.js

Issue 685053002: Treat regular and always-on hotwording settings as mutually exclusive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/resources/hotword/page_audio_manager.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 cr.define('hotword', function() { 5 cr.define('hotword', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Class used to manage the interaction between hotwording and the launcher 9 * Class used to manage the interaction between hotwording and the launcher
10 * (app list). 10 * (app list).
11 * @param {!hotword.StateManager} stateManager 11 * @param {!hotword.StateManager} stateManager
12 * @constructor 12 * @constructor
13 * @extends {hotword.BaseSessionManager} 13 * @extends {hotword.BaseSessionManager}
14 */ 14 */
15 function LauncherManager(stateManager) { 15 function LauncherManager(stateManager) {
16 hotword.BaseSessionManager.call(this, 16 hotword.BaseSessionManager.call(this,
17 stateManager, 17 stateManager,
18 hotword.constants.SessionSource.LAUNCHER); 18 hotword.constants.SessionSource.LAUNCHER);
19 } 19 }
20 20
21 LauncherManager.prototype = { 21 LauncherManager.prototype = {
22 __proto__: hotword.BaseSessionManager.prototype, 22 __proto__: hotword.BaseSessionManager.prototype,
23 23
24 /** @override */ 24 /** @override */
25 enabled: function() { 25 enabled: function() {
26 return this.stateManager.isEnabled() && 26 return this.stateManager.isSometimesOnEnabled();
27 !this.stateManager.isAlwaysOnEnabled();
28 }, 27 },
29 28
30 /** @override */ 29 /** @override */
31 onSessionStop: function() { 30 onSessionStop: function() {
32 chrome.hotwordPrivate.setHotwordSessionState(false, function() {}); 31 chrome.hotwordPrivate.setHotwordSessionState(false, function() {});
33 } 32 }
34 }; 33 };
35 34
36 return { 35 return {
37 LauncherManager: LauncherManager 36 LauncherManager: LauncherManager
38 }; 37 };
39 }); 38 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/hotword/page_audio_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698