OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 | |
5 function recordDevice(device) { | 4 function recordDevice(device) { |
6 console.log("recordDevice"); | 5 console.log("recordDevice"); |
7 } | 6 } |
8 | 7 |
9 chrome.app.runtime.onLaunched.addListener(function() { | 8 chrome.app.runtime.onLaunched.addListener(function() { |
10 chrome.app.window.create('window.html', {'width': 400,'height': 500}); | 9 chrome.app.window.create('window.html', {'width': 400,'height': 500}); |
11 chrome.bluetooth.startDiscovery({deviceCallback: recordDevice}); | 10 chrome.bluetooth.startDiscovery({deviceCallback: recordDevice}); |
12 chrome.bluetooth.stopDiscovery(); | 11 chrome.bluetooth.stopDiscovery(); |
13 }); | 12 }); |
| 13 |
| 14 chrome.runtime.onMessageExternal.addListener(function(message, sender, response)
{ |
| 15 response(); |
| 16 }); |
| 17 |
| 18 chrome.runtime.onConnectExternal.addListener(function(port) { |
| 19 console.log("connected"); |
| 20 }); |
OLD | NEW |