| OLD | NEW |
| 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 * @struct | 14 * @class |
| 15 */ | 15 */ |
| 16 function LauncherManager(stateManager) { | 16 function LauncherManager(stateManager) { |
| 17 hotword.BaseSessionManager.call(this, | 17 hotword.BaseSessionManager.call(this, |
| 18 stateManager, | 18 stateManager, |
| 19 hotword.constants.SessionSource.LAUNCHER); | 19 hotword.constants.SessionSource.LAUNCHER); |
| 20 } | 20 } |
| 21 | 21 |
| 22 LauncherManager.prototype = { | 22 LauncherManager.prototype = { |
| 23 __proto__: hotword.BaseSessionManager.prototype, | 23 __proto__: hotword.BaseSessionManager.prototype, |
| 24 | 24 |
| 25 /** @override */ | 25 /** @override */ |
| 26 enabled: function() { | 26 enabled: function() { |
| 27 return this.stateManager.isEnabled() && | 27 return this.stateManager.isEnabled() && |
| 28 !this.stateManager.isAlwaysOnEnabled(); | 28 !this.stateManager.isAlwaysOnEnabled(); |
| 29 }, | 29 }, |
| 30 | 30 |
| 31 /** @override */ | 31 /** @override */ |
| 32 onSessionStop: function() { | 32 onSessionStop: function() { |
| 33 chrome.hotwordPrivate.setHotwordSessionState(false, function() {}); | 33 chrome.hotwordPrivate.setHotwordSessionState(false, function() {}); |
| 34 } | 34 } |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 return { | 37 return { |
| 38 LauncherManager: LauncherManager | 38 LauncherManager: LauncherManager |
| 39 }; | 39 }; |
| 40 }); | 40 }); |
| OLD | NEW |