Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: chrome/common/extensions/docs/examples/api/desktopCapture/app.js

Issue 529293002: Fix DesktopMediaPickerViews to handle background parent_web_contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 4
5 function gotStream(stream) { 5 function gotStream(stream) {
6 console.log("Received local stream"); 6 console.log("Received local stream");
7 var video = document.querySelector("video"); 7 var video = document.querySelector("video");
8 video.src = URL.createObjectURL(stream); 8 video.src = URL.createObjectURL(stream);
9 localstream = stream; 9 localstream = stream;
10 stream.onended = function() { console.log("Ended"); }; 10 stream.onended = function() { console.log("Ended"); };
(...skipping 20 matching lines...) Expand all
31 document.querySelector('#start').addEventListener('click', function(e) { 31 document.querySelector('#start').addEventListener('click', function(e) {
32 pending_request_id = chrome.desktopCapture.chooseDesktopMedia( 32 pending_request_id = chrome.desktopCapture.chooseDesktopMedia(
33 ["screen", "window"], onAccessApproved); 33 ["screen", "window"], onAccessApproved);
34 }); 34 });
35 35
36 document.querySelector('#cancel').addEventListener('click', function(e) { 36 document.querySelector('#cancel').addEventListener('click', function(e) {
37 if (pending_request_id != null) { 37 if (pending_request_id != null) {
38 chrome.desktopCapture.cancelChooseDesktopMedia(pending_request_id); 38 chrome.desktopCapture.cancelChooseDesktopMedia(pending_request_id);
39 } 39 }
40 }); 40 });
41
42 document.querySelector('#startFromBackgroundPage')
43 .addEventListener('click', function(e) {
44 chrome.runtime.sendMessage(
45 {}, function(response) { console.log(response.farewell); });
46 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698