Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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 action_counter = 0; | |
| 6 | |
| 7 chrome.rtcPrivate.onLaunch.addListener(function(launchData) { | |
| 8 if(!launchData) { | |
| 9 console.log('HANDLER: got default action'); | |
| 10 action_counter++; | |
| 11 return; | |
| 12 } | |
| 13 | |
| 14 var action = launchData.intent.action; | |
| 15 if (action == 'chat' || action == 'video' || action == 'voice') { | |
|
Dmitry Titov
2012/09/05 21:47:47
The test sends emails and phone numbers, but the b
zel
2012/09/05 22:06:21
Done.
| |
| 16 var data = launchData.intent.data; | |
| 17 var type = launchData.intent.type; | |
| 18 console.log('HANDLER: Received ' + action + ', data = ' + data); | |
| 19 action_counter++; | |
| 20 } else { | |
| 21 console.log('HANDLER: unknown action - ' + action); | |
| 22 chrome.test.fail('HANDLER: No content changed!'); | |
| 23 return; | |
| 24 } | |
| 25 }); | |
| 26 | |
| 27 chrome.extension.onMessage.addListener( | |
| 28 function(request, sender, sendResponse) { | |
| 29 if (request.message == "getIntentsCount") | |
| 30 sendResponse({"count": action_counter}); | |
| 31 }); | |
| OLD | NEW |