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

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

Issue 687323003: Adds a Training Manager to the hotword extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tp3-api
Patch Set: Rebase 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
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 (function() { 5 (function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * @fileoverview This extension provides hotword triggering capabilites to 9 * @fileoverview This extension provides hotword triggering capabilites to
10 * Chrome. 10 * Chrome.
11 * 11 *
12 * This extension contains all the JavaScript for loading and managing the 12 * This extension contains all the JavaScript for loading and managing the
13 * hotword detector. The hotword detector and language model data will be 13 * hotword detector. The hotword detector and language model data will be
14 * provided by a shared module loaded from the web store. 14 * provided by a shared module loaded from the web store.
15 * 15 *
16 * IMPORTANT! Whenever adding new events, the extension version number MUST be 16 * IMPORTANT! Whenever adding new events, the extension version number MUST be
17 * incremented. 17 * incremented.
18 */ 18 */
19 19
20 // Hotwording state. 20 // Hotwording state.
21 var stateManager = new hotword.StateManager(); 21 var stateManager = new hotword.StateManager();
22 var pageAudioManager = new hotword.PageAudioManager(stateManager); 22 var pageAudioManager = new hotword.PageAudioManager(stateManager);
23 var alwaysOnManager = new hotword.AlwaysOnManager(stateManager); 23 var alwaysOnManager = new hotword.AlwaysOnManager(stateManager);
24 var launcherManager = new hotword.LauncherManager(stateManager); 24 var launcherManager = new hotword.LauncherManager(stateManager);
25 var trainingManager = new hotword.TrainingManager(stateManager);
25 26
26 // Detect Chrome startup and make sure we get a chance to run. 27 // Detect Chrome startup and make sure we get a chance to run.
27 chrome.runtime.onStartup.addListener(function() { 28 chrome.runtime.onStartup.addListener(function() {
28 stateManager.updateStatus(); 29 stateManager.updateStatus();
29 }); 30 });
30 31
31 // Detect when hotword settings have changed. 32 // Detect when hotword settings have changed.
32 chrome.hotwordPrivate.onEnabledChanged.addListener(function() { 33 chrome.hotwordPrivate.onEnabledChanged.addListener(function() {
33 stateManager.updateStatus(); 34 stateManager.updateStatus();
34 }); 35 });
35 36
36 // Detect when the shared module containing the NaCL module and language model 37 // Detect when the shared module containing the NaCL module and language model
37 // is installed. 38 // is installed.
38 chrome.management.onInstalled.addListener(function(info) { 39 chrome.management.onInstalled.addListener(function(info) {
39 if (info.id == hotword.constants.SHARED_MODULE_ID) { 40 if (info.id == hotword.constants.SHARED_MODULE_ID) {
40 hotword.debug('Shared module installed, reloading extension.'); 41 hotword.debug('Shared module installed, reloading extension.');
41 chrome.runtime.reload(); 42 chrome.runtime.reload();
42 } 43 }
43 }); 44 });
44 }()); 45 }());
OLDNEW
« no previous file with comments | « chrome/browser/resources/hotword/constants.js ('k') | chrome/browser/resources/hotword/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698