Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / desktop_capture_delegate / background.js
blob7296cfe8694197440f4ecc4080cba4045ab42c6c
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
3 // found in the LICENSE file.
5 chrome.runtime.onMessageExternal.addListener(
6     function(message, sender, sendResponse) {
7   if (message[0] == "getStream") {
8     chrome.desktopCapture.chooseDesktopMedia(
9         ["screen", "window"],
10         sender.tab,
11         function(id) {
12           sendResponse({"id": id});
13         });
14     return true;
15   } else if (message[0] == "getStreamNoWait") {
16     chrome.desktopCapture.chooseDesktopMedia(
17         ["screen", "window"],
18         sender.tab, function() {});
19     sendResponse({});
20   } else {
21     sendResponse({"error": "invalid message"});
22   }
23 });