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

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

Issue 741873002: Avoid loading the chime when the hotword background page is opened. (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 | no next file » | 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 * Trivial container class for session information. 9 * Trivial container class for session information.
10 * @param {!hotword.constants.SessionSource} source Source of the hotword 10 * @param {!hotword.constants.SessionSource} source Source of the hotword
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 * This is tracked separately from hotwordStatus_ because we need to restart 99 * This is tracked separately from hotwordStatus_ because we need to restart
100 * the hotword detector when this value changes. 100 * the hotword detector when this value changes.
101 * @private {boolean} 101 * @private {boolean}
102 */ 102 */
103 this.loggingEnabled_ = false; 103 this.loggingEnabled_ = false;
104 104
105 // Get the initial status. 105 // Get the initial status.
106 chrome.hotwordPrivate.getStatus(this.handleStatus_.bind(this)); 106 chrome.hotwordPrivate.getStatus(this.handleStatus_.bind(this));
107 107
108 // Setup the chime and insert into the page. 108 // Setup the chime and insert into the page.
109 // Set preload=none to prevent an audio output stream from being created
110 // when the extension loads.
111 this.chime_.preload = 'none';
109 this.chime_.src = chrome.extension.getURL( 112 this.chime_.src = chrome.extension.getURL(
110 hotword.constants.SHARED_MODULE_ROOT + '/audio/chime.wav'); 113 hotword.constants.SHARED_MODULE_ROOT + '/audio/chime.wav');
111 document.body.appendChild(this.chime_); 114 document.body.appendChild(this.chime_);
112 } 115 }
113 116
114 /** 117 /**
115 * @enum {number} 118 * @enum {number}
116 * @private 119 * @private
117 */ 120 */
118 StateManager.State_ = { 121 StateManager.State_ = {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 472
470 if (oldLocked != this.isLocked_) 473 if (oldLocked != this.isLocked_)
471 this.updateStateFromStatus_(); 474 this.updateStateFromStatus_();
472 } 475 }
473 }; 476 };
474 477
475 return { 478 return {
476 StateManager: StateManager 479 StateManager: StateManager
477 }; 480 };
478 }); 481 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698