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

Side by Side Diff: chrome/common/extensions/api/tab_capture.idl

Issue 11038021: Implement Chrome Extension TabCapture API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Media class renames/moves Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
(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 // An API for tab media streams.
6
7 namespace tabCapture {
8
9 enum TabCaptureState {
10 requested,
11 pending,
12 active,
13 stopped,
14 error
15 };
16
17 dictionary CaptureInfo {
18 // The id of the tab whose status changed.
19 long tabId;
20
21 // The new capture status of the tab.
22 TabCaptureState status;
23 };
24
25 dictionary CaptureOptions {
26 boolean? audio;
27 boolean? video;
28 };
29
30 callback GetTabMediaCallback =
31 void ([instanceOf=LocalMediaStream] optional object stream);
32
33 callback GetCapturedTabsCallback =
34 void (CaptureInfo[] result);
35
36 interface Functions {
37 // Captures the visible area of the tab with the given tabId.
38 // Extensions must have the host permission for the given tab as well as
39 // the "tabs" permission to use this method.
40 // |tabId| : The tabId of the tab to capture. Defaults to the active tab.
41 // |options| : Configures the returned media stream.
42 // |callback| : Callback with either the stream returned or null.
43 static void capture(optional long tabId,
44 optional CaptureOptions options,
45 GetTabMediaCallback callback);
46
47 // Returns a list of tabs that have requested capture or are being
48 // captured, i.e. status != stopped and status != cancelled.
49 // This allows extensions to inform the user that there is an existing
50 // tab capture that would prevent a new tab capture from succeeding (or
51 // to prevent redundant requests for the same tab).
52 static void getCapturedTabs(GetCapturedTabsCallback callback);
53
54 };
55
56 interface Events {
57 // Event fired when the capture status of a tab changes.
58 // This allows extension authors to keep track of the capture status of
59 // tabs to keep UI elements like page actions and infobars in sync.
60 static void onStatusChanged(CaptureInfo info);
61 };
62
63 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698