[sql] Remove _HAS_EXCEPTIONS=0 from build info.
[chromium-blink-merge.git] / chrome / browser / resources / hotword / always_on_manager.js
blob042a8d2d7e1a095c0486c95dfec7d935e0799325
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
3 // found in the LICENSE file.
5 cr.define('hotword', function() {
6 'use strict';
8 /**
9 * Class used to manage always-on hotwording. Automatically starts hotwording
10 * on startup, if always-on is enabled, and starts/stops hotwording at
11 * appropriate times.
12 * @param {!hotword.StateManager} stateManager
13 * @constructor
14 * @extends {hotword.BaseSessionManager}
16 function AlwaysOnManager(stateManager) {
17 hotword.BaseSessionManager.call(this,
18 stateManager,
19 hotword.constants.SessionSource.ALWAYS);
22 AlwaysOnManager.prototype = {
23 __proto__: hotword.BaseSessionManager.prototype,
25 /** @override */
26 enabled: function() {
27 return this.stateManager.isAlwaysOnEnabled();
30 /** @override */
31 updateListeners: function() {
32 hotword.BaseSessionManager.prototype.updateListeners.call(this);
33 if (this.enabled())
34 this.startSession();
38 return {
39 AlwaysOnManager: AlwaysOnManager
41 });