Merge m-c to inbound

This commit is contained in:
Wes Kocher 2014-03-18 19:48:29 -07:00
commit ab2d9e71a6
30 changed files with 162 additions and 56 deletions

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5bb95e384f8923963c1990a55cb297996a0f2645"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2346ad9002062d70b6b27978c6b942f04192bf1b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5bb95e384f8923963c1990a55cb297996a0f2645"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="2346ad9002062d70b6b27978c6b942f04192bf1b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="cb16958e41105d7c551d9941f522db97b8312538"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="485846b2a40d8ac7d6c1c5f8af6d15b0c10af19d"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="a9e08b91e9cd1f0930f16cfc49ec72f63575d5fe">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5bb95e384f8923963c1990a55cb297996a0f2645"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="2346ad9002062d70b6b27978c6b942f04192bf1b"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="cb16958e41105d7c551d9941f522db97b8312538"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5bb95e384f8923963c1990a55cb297996a0f2645"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2346ad9002062d70b6b27978c6b942f04192bf1b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>

View File

@ -4,6 +4,6 @@
"branch": "",
"revision": ""
},
"revision": "31b05353667b7ff223aa8761ad7f66996e75a313",
"revision": "ca4f67df676ef3ab0072b9e3fb97baee4d4bde36",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5bb95e384f8923963c1990a55cb297996a0f2645"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2346ad9002062d70b6b27978c6b942f04192bf1b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
@ -100,7 +100,7 @@
<project name="quic/lf/b2g/external/jsmin" path="external/jsmin" revision="cec896f0affaa0226c02605ad28d42df1bc0e393"/>
<project name="device/qcom/common" path="device/qcom/common" revision="d13aaf080177b7c48f243d51827db5c7a7873cd0"/>
<project name="platform/vendor/qcom/msm7627a" path="device/qcom/msm7627a" revision="f06bcacc6f13cec895dc5d4c2385c076396194ec"/>
<project name="android-device-hamachi" path="device/qcom/hamachi" remote="b2g" revision="9071ac8f0830979fe4a96ce47c7443d8adf0929d"/>
<project name="android-device-hamachi" path="device/qcom/hamachi" remote="b2g" revision="a9b1bbfb55c2b28e884a367f89855e31d86a328a"/>
<project name="kernel/msm" path="kernel" revision="a6578b9cacf9079f2dcf5bfe77c31b1be18809e3"/>
<project name="platform/hardware/qcom/camera" path="hardware/qcom/camera" revision="19933e5d182a4799c6217b19a18562193a419298"/>
<project name="platform/hardware/qcom/display" path="hardware/qcom/display" revision="5a58382180c70d0c446badc9c9837918ab69ec60"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5bb95e384f8923963c1990a55cb297996a0f2645"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2346ad9002062d70b6b27978c6b942f04192bf1b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5bb95e384f8923963c1990a55cb297996a0f2645"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2346ad9002062d70b6b27978c6b942f04192bf1b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5bb95e384f8923963c1990a55cb297996a0f2645"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2346ad9002062d70b6b27978c6b942f04192bf1b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5bb95e384f8923963c1990a55cb297996a0f2645"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="2346ad9002062d70b6b27978c6b942f04192bf1b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="cb16958e41105d7c551d9941f522db97b8312538"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="485846b2a40d8ac7d6c1c5f8af6d15b0c10af19d"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5bb95e384f8923963c1990a55cb297996a0f2645"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2346ad9002062d70b6b27978c6b942f04192bf1b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -639,12 +639,14 @@
<toolbarbutton id="back-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&backCmd.label;"
command="Browser:BackOrBackDuplicate"
cui-areatype="toolbar"
onclick="checkForMiddleClick(this, event);"
tooltip="back-button-tooltip"
context="backForwardMenu"/>
<toolbarbutton id="forward-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&forwardCmd.label;"
command="Browser:ForwardOrForwardDuplicate"
cui-areatype="toolbar"
onclick="checkForMiddleClick(this, event);"
tooltip="forward-button-tooltip"
context="backForwardMenu"/>
@ -893,14 +895,17 @@
<toolbarbutton id="nav-bar-overflow-button"
class="toolbarbutton-1 chromeclass-toolbar-additional overflow-button"
cui-areatype="toolbar"
skipintoolbarset="true"
tooltiptext="&navbarOverflow.label;"/>
<toolbaritem id="PanelUI-button"
class="chromeclass-toolbar-additional"
cui-areatype="toolbar"
removable="false">
<toolbarbutton id="PanelUI-menu-button"
class="toolbarbutton-1"
cui-areatype="toolbar"
label="&brandShortName;"
tooltiptext="&appmenu.tooltip;"/>
</toolbaritem>

View File

@ -73,6 +73,7 @@ function updateCombinedWidgetStyle(aNode, aArea, aModifyCloseMenu) {
if (aModifyCloseMenu) {
attrs.closemenu = inPanel ? "none" : null;
}
attrs["cui-areatype"] = aArea ? CustomizableUI.getAreaType(aArea) : null;
for (let i = 0, l = aNode.childNodes.length; i < l; ++i) {
if (aNode.childNodes[i].localName == "separator")
continue;
@ -431,32 +432,21 @@ const CustomizableWidgets = [{
let areaType = CustomizableUI.getAreaType(this.currentArea);
let inPanel = areaType == CustomizableUI.TYPE_MENU_PANEL;
let inToolbar = areaType == CustomizableUI.TYPE_TOOLBAR;
let closeMenu = inPanel ? "none" : null;
let cls = inPanel ? "panel-combined-button" : "toolbarbutton-1 toolbarbutton-combined";
if (!this.currentArea)
cls = null;
let buttons = [{
id: "zoom-out-button",
closemenu: closeMenu,
command: "cmd_fullZoomReduce",
class: cls,
label: true,
tooltiptext: "tooltiptext2",
shortcutId: "key_fullZoomReduce",
}, {
id: "zoom-reset-button",
closemenu: closeMenu,
command: "cmd_fullZoomReset",
class: cls,
tooltiptext: "tooltiptext2",
shortcutId: "key_fullZoomReset",
}, {
id: "zoom-in-button",
closemenu: closeMenu,
command: "cmd_fullZoomEnlarge",
class: cls,
label: true,
tooltiptext: "tooltiptext2",
shortcutId: "key_fullZoomEnlarge",
@ -515,6 +505,7 @@ const CustomizableWidgets = [{
}
updateZoomResetButton();
}
updateCombinedWidgetStyle(node, this.currentArea, true);
let listener = {
onWidgetAdded: function(aWidgetId, aArea, aPosition) {
@ -609,30 +600,21 @@ const CustomizableWidgets = [{
type: "custom",
defaultArea: CustomizableUI.AREA_PANEL,
onBuild: function(aDocument) {
let inPanel = (this.currentArea == CustomizableUI.AREA_PANEL);
let cls = inPanel ? "panel-combined-button" : "toolbarbutton-1 toolbarbutton-combined";
if (!this.currentArea)
cls = null;
let buttons = [{
id: "cut-button",
command: "cmd_cut",
class: cls,
label: true,
tooltiptext: "tooltiptext2",
shortcutId: "key_cut",
}, {
id: "copy-button",
command: "cmd_copy",
class: cls,
label: true,
tooltiptext: "tooltiptext2",
shortcutId: "key_copy",
}, {
id: "paste-button",
command: "cmd_paste",
class: cls,
label: true,
tooltiptext: "tooltiptext2",
shortcutId: "key_paste",
@ -656,6 +638,8 @@ const CustomizableWidgets = [{
node.appendChild(btnNode);
});
updateCombinedWidgetStyle(node, this.currentArea);
let listener = {
onWidgetAdded: function(aWidgetId, aArea, aPosition) {
if (aWidgetId != this.id)

View File

@ -272,6 +272,10 @@ Spectrum.prototype = {
},
updateHelperLocations: function() {
// If the UI hasn't been shown yet then none of the dimensions will be correct
if (!this.element.classList.contains('spectrum-show'))
return;
let h = this.hsv[0];
let s = this.hsv[1];
let v = this.hsv[2];

View File

@ -85,7 +85,7 @@ http://www.briangrinstead.com/blog/keep-aspect-ratio-with-html-and-css */
}
.spectrum-dragger, .spectrum-slider {
user-select: none;
-moz-user-select: none;
}
.spectrum-alpha {

View File

@ -746,8 +746,8 @@ toolbar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-ic
list-style-image: url("chrome://browser/skin/Toolbar@2x.png");
}
:-moz-any(@primaryToolbarButtons@):-moz-lwtheme-brighttext,
#bookmarks-menu-button[cui-areatype="toolbar"]:-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
:-moz-any(@primaryToolbarButtons@):not(@inAnyPanel@):-moz-lwtheme-brighttext,
#bookmarks-menu-button:not(@inAnyPanel@):-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
list-style-image: url("chrome://browser/skin/Toolbar-inverted@2x.png");
}

View File

@ -3,8 +3,8 @@
list-style-image: url("chrome://browser/skin/Toolbar.png");
}
:-moz-any(@primaryToolbarButtons@):-moz-lwtheme-brighttext,
#bookmarks-menu-button:-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
:-moz-any(@primaryToolbarButtons@):not(@inAnyPanel@):-moz-lwtheme-brighttext,
#bookmarks-menu-button:not(@inAnyPanel@):-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
list-style-image: url(chrome://browser/skin/Toolbar-inverted.png);
}

View File

@ -23,11 +23,19 @@ using namespace mozilla::gfx;
NS_IMPL_ISUPPORTS1(MediaEngineTabVideoSource, MediaEngineVideoSource)
MediaEngineTabVideoSource::MediaEngineTabVideoSource()
: mName(NS_LITERAL_STRING("share tab")), mUuid(NS_LITERAL_STRING("uuid")),
: mName(NS_LITERAL_STRING("&getUserMedia.videoDevice.tabShare;")),
mUuid(NS_LITERAL_STRING("uuid")),
mData(0),
mMonitor("MediaEngineTabVideoSource")
{
}
MediaEngineTabVideoSource::~MediaEngineTabVideoSource()
{
if (mData)
free(mData);
}
nsresult
MediaEngineTabVideoSource::StartRunnable::Run()
{
@ -39,6 +47,7 @@ MediaEngineTabVideoSource::StartRunnable::Run()
mVideoSource->mTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
mVideoSource->mTimer->InitWithCallback(mVideoSource, mVideoSource->mTimePerFrame, nsITimer:: TYPE_REPEATING_SLACK);
}
mVideoSource->mTabSource->NotifyStreamStart(mVideoSource->mWindow);
return NS_OK;
}
@ -54,6 +63,7 @@ MediaEngineTabVideoSource::StopRunnable::Run()
mVideoSource->mTimer->Cancel();
mVideoSource->mTimer = nullptr;
}
mVideoSource->mTabSource->NotifyStreamStop(mVideoSource->mWindow);
return NS_OK;
}
@ -83,10 +93,11 @@ MediaEngineTabVideoSource::InitRunnable::Run()
branch->GetIntPref("media.tabstreaming.time_per_frame", &mVideoSource->mTimePerFrame);
mVideoSource->mData = (unsigned char*)malloc(mVideoSource->mBufW * mVideoSource->mBufH * 4);
nsCOMPtr<nsITabSource> tabSource = do_GetService(NS_TABSOURCESERVICE_CONTRACTID, &rv);
mVideoSource->mTabSource = do_GetService(NS_TABSOURCESERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMWindow> win;
rv = tabSource->GetTabToStream(getter_AddRefs(win));
rv = mVideoSource->mTabSource->GetTabToStream(getter_AddRefs(win));
NS_ENSURE_SUCCESS(rv, rv);
if (!win)
return NS_OK;

View File

@ -7,6 +7,7 @@
#include "ImageContainer.h"
#include "nsITimer.h"
#include "mozilla/Monitor.h"
#include "nsITabSource.h"
namespace mozilla {
@ -16,7 +17,8 @@ class MediaEngineTabVideoSource : public MediaEngineVideoSource, nsIDOMEventList
NS_DECL_NSIDOMEVENTLISTENER
NS_DECL_NSITIMERCALLBACK
MediaEngineTabVideoSource();
~MediaEngineTabVideoSource() { free(mData); }
~MediaEngineTabVideoSource();
virtual void GetName(nsAString_internal&);
virtual void GetUUID(nsAString_internal&);
virtual nsresult Allocate(const mozilla::MediaEnginePrefs&);
@ -60,6 +62,6 @@ private:
nsCOMPtr<nsITimer> mTimer;
nsAutoString mName, mUuid;
Monitor mMonitor;
nsCOMPtr<nsITabSource> mTabSource;
};
}

View File

@ -121,10 +121,6 @@ MediaEngineWebRTC::EnumerateVideoDevices(nsTArray<nsRefPtr<MediaEngineVideoSourc
return;
}
#endif
if (mHasTabVideoSource)
aVSources->AppendElement(new MediaEngineTabVideoSource());
if (!mVideoEngine) {
if (!(mVideoEngine = webrtc::VideoEngine::Create())) {
return;
@ -229,6 +225,9 @@ MediaEngineWebRTC::EnumerateVideoDevices(nsTArray<nsRefPtr<MediaEngineVideoSourc
}
}
if (mHasTabVideoSource)
aVSources->AppendElement(new MediaEngineTabVideoSource());
return;
#endif
}

View File

@ -10,6 +10,8 @@
interface nsITabSource : nsISupports
{
nsIDOMWindow getTabToStream();
void notifyStreamStart(in nsIDOMWindow window);
void notifyStreamStop(in nsIDOMWindow window);
};
%{C++

View File

@ -831,10 +831,16 @@ BrowserElementChild.prototype = {
canvas.width = canvasWidth;
canvas.height = canvasHeight;
var ctx = canvas.getContext("2d", { willReadFrequently: true });
let ctx = canvas.getContext("2d", { willReadFrequently: true });
ctx.scale(scale * devicePixelRatio, scale * devicePixelRatio);
let flags = ctx.DRAWWINDOW_DRAW_VIEW |
ctx.DRAWWINDOW_USE_WIDGET_LAYERS |
ctx.DRAWWINDOW_DO_NOT_FLUSH |
ctx.DRAWWINDOW_ASYNC_DECODE_IMAGES;
ctx.drawWindow(content, 0, 0, content.innerWidth, content.innerHeight,
transparent ? "rgba(255,255,255,0)" : "rgb(255,255,255)");
transparent ? "rgba(255,255,255,0)" : "rgb(255,255,255)",
flags);
// Take a JPEG screenshot by default instead of PNG with alpha channel.
// This requires us to unpremultiply the alpha channel, which

View File

@ -1185,8 +1185,14 @@ OomVictimLogger::Observe(
for (size_t i = 0; i < regex_count; i++) {
int matching = !regexec(&(mRegexes[i]), line_begin, 0, NULL, 0);
if (matching) {
// Log content of kernel message
line_begin = strchr(line_begin, ']') + 2;
// Log content of kernel message. We try to skip the ], but if for
// some reason (most likely due to buffer overflow/wraparound), we
// can't find the ] then we just log the entire line.
char* endOfTimestamp = strchr(line_begin, ']');
if (endOfTimestamp && endOfTimestamp[1] == ' ') {
// skip the ] and the space that follows it
line_begin = endOfTimestamp + 2;
}
if (!lineTimestampFound) {
OOM_LOG(ANDROID_LOG_WARN, "following kill message may be a duplicate");
}

View File

@ -124,7 +124,10 @@ var WebrtcUI = {
// if this is a Camera input, convert the name to something readable
let res = /Camera\ \d+,\ Facing (front|back)/.exec(device.name);
if (res)
return Strings.browser.GetStringFromName("getUserMedia." + aType + "." + res[1]);
return Strings.browser.GetStringFromName("getUserMedia." + aType + "." + res[1] + "Camera");
if (device.name.startsWith("&") && device.name.endsWith(";"))
return Strings.browser.GetStringFromName(device.name.substring(1, device.name.length -1));
if (device.name.trim() == "") {
defaultCount++;

View File

@ -100,6 +100,10 @@ contract @mozilla.org/payment/ui-glue;1 {3c6c9575-f57e-427b-a8aa-57bc3cbff48f}
component {18a4e042-7c7c-424b-a583-354e68553a7f} FilePicker.js
contract @mozilla.org/filepicker;1 {18a4e042-7c7c-424b-a583-354e68553a7f}
# TabSource.js
component {5850c76e-b916-4218-b99a-31f004e0a7e7} TabSource.js
contract @mozilla.org/tab-source-service;1 {5850c76e-b916-4218-b99a-31f004e0a7e7}
# Snippets.js
component {a78d7e59-b558-4321-a3d6-dffe2f1e76dd} Snippets.js
contract @mozilla.org/snippets;1 {a78d7e59-b558-4321-a3d6-dffe2f1e76dd}

View File

@ -0,0 +1,75 @@
const { classes: Cc, interfaces: Ci, manager: Cm, utils: Cu, results: Cr } = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Prompt.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "sendMessageToJava",
"resource://gre/modules/Messaging.jsm");
function TabSource() {
}
TabSource.prototype = {
classID: Components.ID("{5850c76e-b916-4218-b99a-31f004e0a7e7}"),
classDescription: "Fennec Tab Source",
contractID: "@mozilla.org/tab-source-service;1",
QueryInterface: XPCOMUtils.generateQI([Ci.nsITabSource]),
getTabToStream: function() {
let app = Services.wm.getMostRecentWindow("navigator:browser").BrowserApp;
let tabs = app.tabs;
if (tabs == null || tabs.length == 0) {
Services.console.logStringMessage("ERROR: No tabs");
return null;
}
let bundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
let title = bundle.GetStringFromName("tabshare.title")
let prompt = new Prompt({
title: title,
window: null
}).setSingleChoiceItems(tabs.map(function(tab) {
return { label: tab.browser.contentTitle || tab.browser.contentURI.spec }
}));
let result = null;
prompt.show(function(data) {
result = data.button;
});
// Spin this thread while we wait for a result.
let thread = Services.tm.currentThread;
while (result == null) {
thread.processNextEvent(true);
}
if (result == -1) {
return null;
}
return tabs[result].browser.contentWindow;
},
notifyStreamStart: function(window) {
let app = Services.wm.getMostRecentWindow("navigator:browser").BrowserApp;
let tabs = app.tabs;
for (var i in tabs) {
if (tabs[i].browser.contentWindow == window) {
sendMessageToJava({ type: "Tab:Streaming", tabID: tabs[i].id });
}
}
},
notifyStreamStop: function(window) {
let app = Services.wm.getMostRecentWindow("navigator:browser").BrowserApp;
let tabs = app.tabs;
for (let i in tabs) {
if (tabs[i].browser.contentWindow == window) {
sendMessageToJava({ type: "Tab:NotStreaming", tabID: tabs[i].id });
}
}
}
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TabSource]);

View File

@ -24,6 +24,7 @@ EXTRA_COMPONENTS += [
'PromptService.js',
'SiteSpecificUserAgent.js',
'Snippets.js',
'TabSource.js',
'WebappsUpdateTimer.js',
'XPIDialogService.js',
]

View File

@ -335,6 +335,7 @@
@BINPATH@/components/amContentHandler.js
@BINPATH@/components/amWebInstallListener.js
@BINPATH@/components/nsBlocklistService.js
@BINPATH@/components/TabSource.js
@BINPATH@/components/webvtt.xpt
@BINPATH@/components/WebVTT.manifest
@BINPATH@/components/WebVTTParserWrapper.js

View File

@ -302,10 +302,11 @@ getUserMedia.shareCameraAndMicrophone.message = Would you like to share your cam
getUserMedia.denyRequest.label = Don't Share
getUserMedia.shareRequest.label = Share
getUserMedia.videoDevice.default = Camera %S
getUserMedia.videoDevice.front = Front facing
getUserMedia.videoDevice.back = Back facing
getUserMedia.videoDevice.frontCamera = Front facing camera
getUserMedia.videoDevice.backCamera = Back facing camera
getUserMedia.videoDevice.none = No Video
getUserMedia.videoDevice.prompt = Camera to use
getUserMedia.videoDevice.tabShare = Choose a tab to stream
getUserMedia.videoDevice.prompt = Video source
getUserMedia.audioDevice.default = Microphone %S
getUserMedia.audioDevice.none = No Audio
getUserMedia.audioDevice.prompt = Microphone to use
@ -322,6 +323,8 @@ openInApp.pageAction = Open in App
openInApp.ok = OK
openInApp.cancel = Cancel
#Tab sharing
tabshare.title = "Choose a tab to stream"
#Tabs in context menus
browser.menu.context.default = Link
browser.menu.context.img = Image

View File

@ -3,13 +3,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["gDevToolsExtensions"];
this.EXPORTED_SYMBOLS = ["gDevToolsExtensions"];
Components.utils.import("resource://gre/modules/Services.jsm");
let globalsCache = {};
const gDevToolsExtensions = {
this.gDevToolsExtensions = {
addContentGlobal: function(options) {
if (!options || !options.global || !options['inner-window-id']) {
throw Error('Invalid arguments');