Chromium Code Reviews| 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 // An API for tab media streams. | 5 // An API for tab media streams. |
| 6 | 6 |
| 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? videoConstraints; | 40 MediaStreamConstraint? videoConstraints; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 callback GetTabMediaCallback = | 43 callback GetTabMediaCallback = |
| 44 void ([instanceOf=LocalMediaStream] object stream); | 44 void ([instanceOf=LocalMediaStream] object stream); |
| 45 | 45 |
| 46 callback GetCapturedTabsCallback = void (CaptureInfo[] result); | 46 callback GetCapturedTabsCallback = void (CaptureInfo[] result); |
| 47 | 47 |
| 48 interface Functions { | 48 interface Functions { |
| 49 // Captures the visible area of the currently active tab. | 49 // Captures the visible area of the currently active tab. |
| 50 // Extensions must have the "tabCapture" permission to use this method. | 50 // Extensions must have the "tabCapture" permission to use this method. Use |
|
not at google - send to devlin
2013/04/18 20:17:13
nit: "extensions must have the tabCapture permissi
justinlin
2013/04/18 21:06:44
Done.
| |
| 51 // of this method for the currently active tab can only be granted | |
| 52 // through a user action. See: | |
|
not at google - send to devlin
2013/04/18 20:17:13
"User action" isn't quite accurate; it might imply
justinlin
2013/04/18 21:06:44
Done, something similar.
| |
| 53 // http://developer.chrome.com/extensions/activeTab.html | |
|
not at google - send to devlin
2013/04/18 20:17:13
could you make this
<a href="activeTab.html">acti
| |
| 54 // Note that Chrome internal pages cannot be captured. | |
| 51 // |options| : Configures the returned media stream. | 55 // |options| : Configures the returned media stream. |
| 52 // |callback| : Callback with either the stream returned or null. | 56 // |callback| : Callback with either the stream returned or null. |
| 53 static void capture(CaptureOptions options, | 57 static void capture(CaptureOptions options, |
| 54 GetTabMediaCallback callback); | 58 GetTabMediaCallback callback); |
| 55 | 59 |
| 56 // 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 |
| 57 // captured, i.e. status != stopped and status != error. | 61 // captured, i.e. status != stopped and status != error. |
| 58 // 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 |
| 59 // 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 |
| 60 // to prevent redundant requests for the same tab). | 64 // to prevent redundant requests for the same tab). |
| 61 static void getCapturedTabs(GetCapturedTabsCallback callback); | 65 static void getCapturedTabs(GetCapturedTabsCallback callback); |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 interface Events { | 68 interface Events { |
| 65 // Event fired when the capture status of a tab changes. | 69 // Event fired when the capture status of a tab changes. |
| 66 // This allows extension authors to keep track of the capture status of | 70 // This allows extension authors to keep track of the capture status of |
| 67 // tabs to keep UI elements like page actions and infobars in sync. | 71 // tabs to keep UI elements like page actions and infobars in sync. |
| 68 static void onStatusChanged(CaptureInfo info); | 72 static void onStatusChanged(CaptureInfo info); |
| 69 }; | 73 }; |
| 70 | 74 |
| 71 }; | 75 }; |
| OLD | NEW |