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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/media_automation_handler.js

Issue 2601333002: Update json_schema_compiler to handle the Automation extension API (Closed)
Patch Set: Rebase Created 3 years, 11 months 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @fileoverview Handles media automation events. Note that to perform any of 6 * @fileoverview Handles media automation events. Note that to perform any of
7 * the actions below such as ducking, and suspension of media sessions, the 7 * the actions below such as ducking, and suspension of media sessions, the
8 * --enable-default-media-session flag must be passed at the command line. 8 * --enable-default-media-session flag must be passed at the command line.
9 */ 9 */
10 10
(...skipping 18 matching lines...) Expand all
29 this.mediaRoots_ = new Set(); 29 this.mediaRoots_ = new Set();
30 30
31 /** @type {Date} @private */ 31 /** @type {Date} @private */
32 this.lastTtsEvent_ = new Date(); 32 this.lastTtsEvent_ = new Date();
33 33
34 cvox.ChromeVox.tts.addCapturingEventListener(this); 34 cvox.ChromeVox.tts.addCapturingEventListener(this);
35 35
36 chrome.automation.getDesktop(function(node) { 36 chrome.automation.getDesktop(function(node) {
37 BaseAutomationHandler.call(this, node); 37 BaseAutomationHandler.call(this, node);
38 38
39 var e = EventType; 39 this.addListener_(EventType.MEDIA_STARTED_PLAYING,
40 this.addListener_(e.mediaStartedPlaying, this.onMediaStartedPlaying); 40 this.onMediaStartedPlaying);
41 this.addListener_(e.mediaStoppedPlaying, this.onMediaStoppedPlaying); 41 this.addListener_(EventType.MEDIA_STOPPED_PLAYING,
42 this.onMediaStoppedPlaying);
42 }.bind(this)); 43 }.bind(this));
43 }; 44 };
44 45
45 /** @type {number} */ 46 /** @type {number} */
46 MediaAutomationHandler.MIN_WAITTIME_MS = 1000; 47 MediaAutomationHandler.MIN_WAITTIME_MS = 1000;
47 48
48 MediaAutomationHandler.prototype = { 49 MediaAutomationHandler.prototype = {
49 __proto__: BaseAutomationHandler.prototype, 50 __proto__: BaseAutomationHandler.prototype,
50 51
51 /** @override */ 52 /** @override */
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 root.resumeMedia(); 112 root.resumeMedia();
112 } 113 }
113 item = it.next(); 114 item = it.next();
114 } 115 }
115 } 116 }
116 }; 117 };
117 118
118 }); // goog.scope 119 }); // goog.scope
119 120
120 new MediaAutomationHandler(); 121 new MediaAutomationHandler();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698