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

Side by Side Diff: chrome/browser/resources/hotword/page_audio_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
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 9 * Class used to manage the interaction between hotwording and the
10 * NTP/google.com. Injects a content script to interact with NTP/google.com 10 * NTP/google.com. Injects a content script to interact with NTP/google.com
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 chrome.tabs.onActivated.removeListener(this.tabActivatedListener_); 409 chrome.tabs.onActivated.removeListener(this.tabActivatedListener_);
410 chrome.windows.onFocusChanged.removeListener( 410 chrome.windows.onFocusChanged.removeListener(
411 this.windowFocusChangedListener_); 411 this.windowFocusChangedListener_);
412 }, 412 },
413 413
414 /** 414 /**
415 * Update event listeners based on the current hotwording state. 415 * Update event listeners based on the current hotwording state.
416 * @private 416 * @private
417 */ 417 */
418 updateListeners_: function() { 418 updateListeners_: function() {
419 var enabled = this.stateManager_.isEnabled() && 419 if (this.stateManager_.isSometimesOnEnabled()) {
420 !this.stateManager_.isAlwaysOnEnabled();
421 if (enabled) {
422 this.setupListeners_(); 420 this.setupListeners_();
423 } else { 421 } else {
424 this.removeListeners_(); 422 this.removeListeners_();
425 this.stopHotwording_(); 423 this.stopHotwording_();
426 this.disconnectAllClients_(); 424 this.disconnectAllClients_();
427 } 425 }
428 } 426 }
429 }; 427 };
430 428
431 return { 429 return {
432 PageAudioManager: PageAudioManager 430 PageAudioManager: PageAudioManager
433 }; 431 };
434 }); 432 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/hotword/launcher_manager.js ('k') | chrome/browser/resources/hotword/state_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698