Update tabCapture API docs with browser action info.

BUG=230911

Review URL: https://chromiumcodereview.appspot.com/14107010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195178 0039d316-1c4b-4281-b951-d872f2087c98
parent a756427b
...@@ -41,7 +41,8 @@ const char kFindingTabError[] = "Error finding tab to capture."; ...@@ -41,7 +41,8 @@ const char kFindingTabError[] = "Error finding tab to capture.";
const char kNoAudioOrVideo[] = "Capture failed. No audio or video requested."; const char kNoAudioOrVideo[] = "Capture failed. No audio or video requested.";
const char kPermissionError[] = "Tab Capture API flag is not enabled."; const char kPermissionError[] = "Tab Capture API flag is not enabled.";
const char kGrantError[] = const char kGrantError[] =
"Capture of this tab must be granted by clicking on the extension icon."; "Extension has not been invoked for the current page (see activeTab "
"permission). Chrome pages cannot be captured.";
// Keys/values for media stream constraints. // Keys/values for media stream constraints.
const char kMediaStreamSource[] = "chromeMediaSource"; const char kMediaStreamSource[] = "chromeMediaSource";
......
...@@ -47,7 +47,10 @@ namespace tabCapture { ...@@ -47,7 +47,10 @@ namespace tabCapture {
interface Functions { interface Functions {
// Captures the visible area of the currently active tab. // Captures the visible area of the currently active tab.
// Extensions must have the "tabCapture" permission to use this method. // This method can only be used on the currently active page after the
// extension has been <em>invoked</em>, similar to the way that
// <a href="activeTab.html">activeTab</a> works.
// Note that Chrome internal pages cannot be captured.
// |options| : Configures the returned media stream. // |options| : Configures the returned media stream.
// |callback| : Callback with either the stream returned or null. // |callback| : Callback with either the stream returned or null.
static void capture(CaptureOptions options, static void capture(CaptureOptions options,
......
...@@ -28,7 +28,8 @@ var afterGrantPermission = function(msg) { ...@@ -28,7 +28,8 @@ var afterGrantPermission = function(msg) {
var afterOpenTab = function(msg) { var afterOpenTab = function(msg) {
chrome.tabCapture.capture({audio: true, video: true}, function(stream) { chrome.tabCapture.capture({audio: true, video: true}, function(stream) {
chrome.test.assertLastError( chrome.test.assertLastError(
'Capture of this tab must be granted by clicking on the extension icon.'); 'Extension has not been invoked for the current page (see activeTab ' +
'permission). Chrome pages cannot be captured.');
chrome.test.assertTrue(!stream); chrome.test.assertTrue(!stream);
chrome.test.sendMessage('ready2', afterGrantPermission); chrome.test.sendMessage('ready2', afterGrantPermission);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment