OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 // Use the <code>chrome.tabCapture</code> API to interact with tab media | 5 // Use the <code>chrome.tabCapture</code> API to interact with tab media |
6 // streams. | 6 // streams. |
7 namespace tabCapture { | 7 namespace tabCapture { |
8 | 8 |
9 enum TabCaptureState { | 9 enum TabCaptureState { |
10 pending, | 10 pending, |
(...skipping 29 matching lines...) Expand all Loading... | |
40 MediaStreamConstraint? audioConstraints; | 40 MediaStreamConstraint? audioConstraints; |
41 MediaStreamConstraint? videoConstraints; | 41 MediaStreamConstraint? videoConstraints; |
42 }; | 42 }; |
43 | 43 |
44 callback GetTabMediaCallback = | 44 callback GetTabMediaCallback = |
45 void ([instanceOf=LocalMediaStream] object stream); | 45 void ([instanceOf=LocalMediaStream] object stream); |
46 | 46 |
47 callback GetCapturedTabsCallback = void (CaptureInfo[] result); | 47 callback GetCapturedTabsCallback = void (CaptureInfo[] result); |
48 | 48 |
49 interface Functions { | 49 interface Functions { |
50 // Captures the visible area of the currently active tab. | 50 // Captures the visible area of the currently active tab. This method can |
51 // This method can only be used on the currently active page after the | 51 // only be used on the currently active tab after the extension has been |
52 // extension has been <em>invoked</em>, similar to the way that | 52 // <em>invoked</em>, similar to the way that |
53 // <a href="activeTab.html">activeTab</a> works. | 53 // <a href="activeTab.html">activeTab</a> works. Capture is maintained |
54 // across page navigations within the tab, and stops when the tab is closed. | |
miu
2014/08/28 02:37:26
s/when the tab is closed/when the tab is closed by
not at google - send to devlin
2014/08/28 02:44:31
Are you sure it's maintained across page navigatio
mark a. foltz
2014/08/28 17:58:55
Yes. Removed reference to ActiveTab.
mark a. foltz
2014/08/28 17:58:55
Done.
not at google - send to devlin
2014/08/28 18:21:54
It seems to me from reading the code that tabCaptu
| |
54 // |options| : Configures the returned media stream. | 55 // |options| : Configures the returned media stream. |
55 // |callback| : Callback with either the stream returned or null. | 56 // |callback| : Callback with either the tab capture stream or |null|. |
not at google - send to devlin
2014/08/28 02:44:31
<code>null</code> looks better than |null| when re
mark a. foltz
2014/08/28 17:58:55
Done.
| |
56 static void capture(CaptureOptions options, | 57 static void capture(CaptureOptions options, |
57 GetTabMediaCallback callback); | 58 GetTabMediaCallback callback); |
58 | 59 |
59 // Returns a list of tabs that have requested capture or are being | 60 // Returns a list of tabs that have requested capture or are being |
60 // captured, i.e. status != stopped and status != error. | 61 // captured, i.e. status != stopped and status != error. |
61 // This allows extensions to inform the user that there is an existing | 62 // This allows extensions to inform the user that there is an existing |
62 // tab capture that would prevent a new tab capture from succeeding (or | 63 // tab capture that would prevent a new tab capture from succeeding (or |
63 // to prevent redundant requests for the same tab). | 64 // to prevent redundant requests for the same tab). |
65 // |callback| : Callback invoked with CaptureInfo[] for captured tabs. | |
64 static void getCapturedTabs(GetCapturedTabsCallback callback); | 66 static void getCapturedTabs(GetCapturedTabsCallback callback); |
65 }; | 67 }; |
66 | 68 |
67 interface Events { | 69 interface Events { |
68 // Event fired when the capture status of a tab changes. | 70 // Event fired when the capture status of a tab changes. |
69 // This allows extension authors to keep track of the capture status of | 71 // This allows extension authors to keep track of the capture status of |
70 // tabs to keep UI elements like page actions and infobars in sync. | 72 // tabs to keep UI elements like page actions and infobars in sync. |
73 // |info| : CaptureInfo with new capture status for the tab. | |
71 static void onStatusChanged(CaptureInfo info); | 74 static void onStatusChanged(CaptureInfo info); |
72 }; | 75 }; |
73 | 76 |
74 }; | 77 }; |
OLD | NEW |