| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 * A global object that gets used by the C++ interface. | 6 * A global object that gets used by the C++ interface. |
| 7 */ | 7 */ |
| 8 var media = (function() { | 8 var media = (function() { |
| 9 'use strict'; | 9 'use strict'; |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 BAR_HEIGHT: 25 | 32 BAR_HEIGHT: 25 |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * Users of |media| must call initialize prior to calling other methods. | 36 * Users of |media| must call initialize prior to calling other methods. |
| 37 */ | 37 */ |
| 38 media.initialize = function(theManager) { | 38 media.initialize = function(theManager) { |
| 39 manager = theManager; | 39 manager = theManager; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 media.onReceiveEverything = function(everything) { | 42 media.onReceiveAudioStreamData = function(everything) { |
| 43 for (var component in everything) { | 43 for (var component in everything) { |
| 44 media.updateAudioComponent(everything[component]); | 44 media.updateAudioComponent(everything[component]); |
| 45 } | 45 } |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 media.onReceiveConstants = function(constants) { | 48 media.onReceiveConstants = function(constants) { |
| 49 for (var key in constants.eventTypes) { | 49 for (var key in constants.eventTypes) { |
| 50 var value = constants.eventTypes[key]; | 50 var value = constants.eventTypes[key]; |
| 51 eventTypes[value] = key; | 51 eventTypes[value] = key; |
| 52 } | 52 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 source, event.ticksMillis, 'EVENT', event.type); | 175 source, event.ticksMillis, 'EVENT', event.type); |
| 176 } | 176 } |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 // |chrome| is not defined during tests. | 179 // |chrome| is not defined during tests. |
| 180 if (window.chrome && window.chrome.send) { | 180 if (window.chrome && window.chrome.send) { |
| 181 chrome.send('getEverything'); | 181 chrome.send('getEverything'); |
| 182 } | 182 } |
| 183 return media; | 183 return media; |
| 184 }()); | 184 }()); |
| OLD | NEW |