| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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 var chrome = chrome || {}; | |
| 6 (function() { | |
| 7 native function GetChromeHidden(); | |
| 8 native function GetIsInstalled(); | |
| 9 native function Install(); | |
| 10 native function GetDetails(); | |
| 11 native function GetDetailsForFrame(); | |
| 12 native function GetAppNotifyChannel(); | |
| 13 | |
| 14 var chromeHidden = GetChromeHidden(); | |
| 15 var callbacks = {}; | |
| 16 var nextCallbackId = 1; | |
| 17 | |
| 18 chrome.app = new function() { | |
| 19 this.__defineGetter__('isInstalled', GetIsInstalled); | |
| 20 this.install = Install; | |
| 21 this.getDetails = GetDetails; | |
| 22 this.getDetailsForFrame = GetDetailsForFrame; | |
| 23 }(); | |
| 24 | |
| 25 chrome.appNotifications = new function() { | |
| 26 this.getChannel = function(clientId, callback) { | |
| 27 var callbackId = 0; | |
| 28 if (callback) { | |
| 29 callbackId = nextCallbackId++; | |
| 30 callbacks[callbackId] = callback; | |
| 31 } | |
| 32 GetAppNotifyChannel(clientId, callbackId); | |
| 33 }; | |
| 34 }(); | |
| 35 | |
| 36 chromeHidden.app = {}; | |
| 37 chromeHidden.app.onGetAppNotifyChannelResponse = | |
| 38 function(channelId, error, callbackId) { | |
| 39 if (callbackId) { | |
| 40 callbacks[callbackId](channelId, error); | |
| 41 delete callbacks[callbackId]; | |
| 42 } | |
| 43 }; | |
| 44 })(); | |
| OLD | NEW |