Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * | |
| 7 * @constructor | |
| 8 */ | |
| 9 function WebClient() { | |
| 10 this.sessions_ = {}; | |
|
mnaganov (inactive)
2014/11/21 21:19:38
Wrong indentation.
SeRya
2014/11/24 11:10:06
Done.
| |
| 11 this.gcdClient_ = new GCDClient(); | |
| 12 } | |
| 13 | |
| 14 WebClient.prototype.startSession = function(deviceId) { | |
| 15 console.log("Starting session " + deviceId); | |
|
mnaganov (inactive)
2014/11/21 21:19:38
Please prefer using single quotes.
| |
| 16 this.sessions_[deviceId] = new ClientSession(deviceId, this.gcdClient_); | |
| 17 this.sessions_[deviceId].start(); | |
| 18 }; | |
| 19 | |
| 20 WebClient.prototype.stopSession = function(deviceId) { | |
| 21 console.log("Stopping session " + deviceId); | |
| 22 this.sessions_[deviceId].stop(); | |
| 23 delete this.sessions_[deviceId]; | |
| 24 }; | |
| 25 | |
| 26 window.addEventListener("load", function() { | |
| 27 window.WebClient.instance = new WebClient(); | |
| 28 if (chrome.send) | |
| 29 chrome.send('loaded'); | |
| 30 }); | |
| OLD | NEW |