Merge m-c to inbound a=merge

This commit is contained in:
Wes Kocher 2014-08-25 17:25:09 -07:00
commit 301861a0fd
35 changed files with 398 additions and 35 deletions

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="53a59364ce4f14068034c8d6fe01f4f6b9f78f23">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1934a2297ffc0d90424cd9cd3294c4a8c74a7333"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d1d0ea5a82cddeeab497774cfa1703639e3c7d9"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

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="1934a2297ffc0d90424cd9cd3294c4a8c74a7333"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d1d0ea5a82cddeeab497774cfa1703639e3c7d9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

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="1934a2297ffc0d90424cd9cd3294c4a8c74a7333"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d1d0ea5a82cddeeab497774cfa1703639e3c7d9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="53a59364ce4f14068034c8d6fe01f4f6b9f78f23">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1934a2297ffc0d90424cd9cd3294c4a8c74a7333"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d1d0ea5a82cddeeab497774cfa1703639e3c7d9"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

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="1934a2297ffc0d90424cd9cd3294c4a8c74a7333"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d1d0ea5a82cddeeab497774cfa1703639e3c7d9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1934a2297ffc0d90424cd9cd3294c4a8c74a7333"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d1d0ea5a82cddeeab497774cfa1703639e3c7d9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "5efa211f0198ab15798b456445f163d57e735cdb",
"revision": "0ce5a025c89f6120b55498528323a8a973dd117e",
"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="1934a2297ffc0d90424cd9cd3294c4a8c74a7333"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d1d0ea5a82cddeeab497774cfa1703639e3c7d9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

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="1934a2297ffc0d90424cd9cd3294c4a8c74a7333"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d1d0ea5a82cddeeab497774cfa1703639e3c7d9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

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="1934a2297ffc0d90424cd9cd3294c4a8c74a7333"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d1d0ea5a82cddeeab497774cfa1703639e3c7d9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>

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="1934a2297ffc0d90424cd9cd3294c4a8c74a7333"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d1d0ea5a82cddeeab497774cfa1703639e3c7d9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -3,6 +3,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# NB: IF YOU ADD ITEMS TO THIS FILE, PLEASE UPDATE THE WHITELIST IN
# BrowserUITelemetry.jsm. SEE BUG 991757 FOR DETAILS.
<menugroup id="context-navigation">
<menuitem id="context-back"
class="menuitem-iconic"

View File

@ -38,6 +38,9 @@ nsContextMenu.prototype = {
// Initialize (disable/remove) menu items.
this.initItems();
// Register this opening of the menu with telemetry:
this._checkTelemetryForMenu(aXulMenu);
},
hiding: function CM_hiding() {
@ -45,6 +48,11 @@ nsContextMenu.prototype = {
InlineSpellCheckerUI.clearSuggestionsFromMenu();
InlineSpellCheckerUI.clearDictionaryListFromMenu();
InlineSpellCheckerUI.uninit();
// This handler self-deletes, only run it if it is still there:
if (this._onPopupHiding) {
this._onPopupHiding();
}
},
initItems: function CM_initItems() {
@ -1703,5 +1711,76 @@ nsContextMenu.prototype = {
selectedText]);
menuItem.label = menuLabel;
menuItem.accessKey = gNavigatorBundle.getString("contextMenuSearch.accesskey");
}
},
_getTelemetryClickInfo: function(aXulMenu) {
this._onPopupHiding = () => {
aXulMenu.ownerDocument.removeEventListener("command", activationHandler, true);
aXulMenu.removeEventListener("popuphiding", this._onPopupHiding, true);
delete this._onPopupHiding;
let eventKey = [
this._telemetryPageContext,
this._telemetryHadCustomItems ? "withcustom" : "withoutcustom"
];
let target = this._telemetryClickID || "close-without-interaction";
BrowserUITelemetry.registerContextMenuInteraction(eventKey, target);
};
let activationHandler = (e) => {
// Deal with command events being routed to command elements; figure out
// what triggered the event (which will have the right e.target)
if (e.sourceEvent) {
e = e.sourceEvent;
}
// Target should be in the menu (this catches using shortcuts for items
// not in the menu while the menu is up)
if (!aXulMenu.contains(e.target)) {
return;
}
// Check if this is a page menu item:
if (e.target.hasAttribute(PageMenu.GENERATEDITEMID_ATTR)) {
this._telemetryClickID = "custom-page-item";
} else {
this._telemetryClickID = (e.target.id || "unknown").replace(/^context-/i, "");
}
};
aXulMenu.ownerDocument.addEventListener("command", activationHandler, true);
aXulMenu.addEventListener("popuphiding", this._onPopupHiding, true);
},
_getTelemetryPageContextInfo: function() {
if (this.isContentSelected) {
return "selection";
}
if (this.onLink) {
if (this.onImage || this.onCanvas) {
return "image-link";
}
return "link";
}
if (this.onImage) {
return "image"
}
if (this.onCanvas) {
return "canvas";
}
if (this.onVideo || this.onAudio) {
return "media";
}
if (this.onTextInput) {
return "input";
}
if (this.onSocial) {
return "social";
}
return "other";
},
_checkTelemetryForMenu: function(aXulMenu) {
this._telemetryClickID = null;
this._telemetryPageContext = this._getTelemetryPageContextInfo();
this._telemetryHadCustomItems = this.hasPageMenu;
this._getTelemetryClickInfo(aXulMenu);
},
};

View File

@ -119,6 +119,9 @@ function* clickOnInspectMenuItem(node) {
info("Triggering inspect action.");
yield contextMenu.inspectNode();
// Clean up context menu:
contextMenu.hiding();
info("Waiting for inspector to update.");
yield getActiveInspector().once("inspector-updated");
}

View File

@ -31,6 +31,10 @@ let test = asyncTest(function*() {
let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
let contextMenu = new nsContextMenu(contentAreaContextMenu);
yield contextMenu.inspectNode();
// Clean up context menu:
contextMenu.hiding();
yield onInspectorReady;
let target = TargetFactory.forTab(gBrowser.selectedTab);

View File

@ -561,11 +561,7 @@ let UI = {
// If connected and a project is selected
if (AppManager.selectedProject.type == "runtimeApp") {
if (isProjectRunning) {
playCmd.setAttribute("disabled", "true");
} else {
playCmd.removeAttribute("disabled");
}
playCmd.removeAttribute("disabled");
} else if (AppManager.selectedProject.type == "mainProcess") {
playCmd.setAttribute("disabled", "true");
stopCmd.setAttribute("disabled", "true");

View File

@ -383,7 +383,11 @@ exports.AppManager = AppManager = {
let client = this.connection.client;
let actor = this._listTabsResponse.webappsActor;
let manifest = this.getProjectManifestURL(this.selectedProject);
return AppActorFront.launchApp(client, actor, manifest);
if (!this.isProjectRunning()) {
return AppActorFront.launchApp(client, actor, manifest);
} else {
return AppActorFront.reloadApp(client, actor, manifest);
}
},
installAndRunProject: function() {

View File

@ -135,7 +135,7 @@ panel > vbox {
panel > .panel-arrowcontainer > .panel-arrowcontent {
padding: 12px 0;
width: 200px;
min-width: 200px;
}
.panel-item {

View File

@ -170,6 +170,8 @@ this.BrowserUITelemetry = {
init: function() {
UITelemetry.addSimpleMeasureFunction("toolbars",
this.getToolbarMeasures.bind(this));
UITelemetry.addSimpleMeasureFunction("contextmenu",
this.getContextMenuInfo.bind(this));
// Ensure that UITour.jsm remains lazy-loaded, yet always registers its
// simple measure function with UITelemetry.
UITelemetry.addSimpleMeasureFunction("UITour",
@ -220,11 +222,13 @@ this.BrowserUITelemetry = {
*
* @param aKeys the Array of keys to chain Objects together with.
* @param aEndWith the value to assign to the last key.
* @param aRoot the root object onto which we create/get the object chain
* designated by aKeys.
* @returns a reference to the second last object in the chain -
* so in our example, that'd be "b".
*/
_ensureObjectChain: function(aKeys, aEndWith) {
let current = this._countableEvents;
_ensureObjectChain: function(aKeys, aEndWith, aRoot) {
let current = aRoot;
let parent = null;
aKeys.unshift(this._bucket);
for (let [i, key] of Iterator(aKeys)) {
@ -242,8 +246,8 @@ this.BrowserUITelemetry = {
},
_countableEvents: {},
_countEvent: function(aKeyArray) {
let countObject = this._ensureObjectChain(aKeyArray, 0);
_countEvent: function(aKeyArray, root=this._countableEvents) {
let countObject = this._ensureObjectChain(aKeyArray, 0, root);
let lastItemKey = aKeyArray[aKeyArray.length - 1];
countObject[lastItemKey]++;
},
@ -587,6 +591,54 @@ this.BrowserUITelemetry = {
}
},
_contextMenuItemWhitelist: new Set([
"close-without-interaction", // for closing the menu without clicking it.
"custom-page-item", // The ID we use for page-provided items
"unknown", // The bucket for stuff with no id.
// Everything we know of so far (which will exclude add-on items):
"navigation", "back", "forward", "reload", "stop", "bookmarkpage",
"spell-no-suggestions", "spell-add-to-dictionary",
"spell-undo-add-to-dictionary", "openlinkincurrent", "openlinkintab",
"openlink", "openlinkprivate", "bookmarklink", "sharelink", "savelink",
"marklinkMenu", "copyemail", "copylink", "media-play", "media-pause",
"media-mute", "media-unmute", "media-playbackrate",
"media-playbackrate-050x", "media-playbackrate-100x",
"media-playbackrate-150x", "media-playbackrate-200x",
"media-showcontrols", "media-hidecontrols", "video-showstats",
"video-hidestats", "video-fullscreen", "leave-dom-fullscreen",
"reloadimage", "viewimage", "viewvideo", "copyimage-contents", "copyimage",
"copyvideourl", "copyaudiourl", "saveimage", "shareimage", "sendimage",
"setDesktopBackground", "viewimageinfo", "viewimagedesc", "savevideo",
"sharevideo", "saveaudio", "video-saveimage", "sendvideo", "sendaudio",
"ctp-play", "ctp-hide", "sharepage", "savepage", "markpageMenu",
"viewbgimage", "undo", "cut", "copy", "paste", "delete", "selectall",
"keywordfield", "searchselect", "shareselect", "frame", "showonlythisframe",
"openframeintab", "openframe", "reloadframe", "bookmarkframe", "saveframe",
"printframe", "viewframesource", "viewframeinfo",
"viewpartialsource-selection", "viewpartialsource-mathml",
"viewsource", "viewinfo", "spell-check-enabled",
"spell-add-dictionaries-main", "spell-dictionaries",
"spell-dictionaries-menu", "spell-add-dictionaries",
"bidi-text-direction-toggle", "bidi-page-direction-toggle", "inspect",
]),
_contextMenuInteractions: {},
registerContextMenuInteraction: function(keys, itemID) {
if (itemID) {
if (!this._contextMenuItemWhitelist.has(itemID)) {
itemID = "other-item";
}
keys.push(itemID);
}
this._countEvent(keys, this._contextMenuInteractions);
},
getContextMenuInfo: function() {
return this._contextMenuInteractions;
},
_bucket: BUCKET_DEFAULT,
_bucketTimer: null,

View File

@ -94,12 +94,13 @@
}
#customization-header {
font-size: 1.5em;
line-height: 1.5em;
color: rgb(64,100,128);
font-weight: lighter;
margin-bottom: 1em;
padding: 25px 25px 0;
font-size: 1.75em;
line-height: 1.75em;
color: #666;
font-weight: 200;
margin: 25px 25px 12px;
padding-bottom: 12px;
border-bottom: 1px solid #e5e5e5;
}
#customization-panel-container {

View File

@ -397,12 +397,28 @@ nsDOMCameraControl::SetIsoMode(const nsAString& aIsoMode, ErrorResult& aRv)
aRv = mCameraControl->Set(CAMERA_PARAM_ISOMODE, aIsoMode);
}
double
nsDOMCameraControl::GetPictureQuality(ErrorResult& aRv)
{
MOZ_ASSERT(mCameraControl);
double quality;
aRv = mCameraControl->Get(CAMERA_PARAM_PICTURE_QUALITY, quality);
return quality;
}
void
nsDOMCameraControl::SetPictureQuality(double aQuality, ErrorResult& aRv)
{
MOZ_ASSERT(mCameraControl);
aRv = mCameraControl->Set(CAMERA_PARAM_PICTURE_QUALITY, aQuality);
}
double
nsDOMCameraControl::GetZoom(ErrorResult& aRv)
{
MOZ_ASSERT(mCameraControl);
double zoom;
double zoom = 1.0;
aRv = mCameraControl->Get(CAMERA_PARAM_ZOOM, zoom);
return zoom;
}

View File

@ -82,6 +82,8 @@ public:
already_AddRefed<dom::CameraCapabilities> Capabilities();
void GetIsoMode(nsString& aMode, ErrorResult& aRv);
void SetIsoMode(const nsAString& aMode, ErrorResult& aRv);
double GetPictureQuality(ErrorResult& aRv);
void SetPictureQuality(double aQuality, ErrorResult& aRv);
// Unsolicited event handlers.
dom::CameraShutterCallback* GetOnShutter();

View File

@ -177,18 +177,22 @@ nsGonkCameraControl::Initialize()
mParams.Get(CAMERA_PARAM_FLASHMODE, flashMode);
mFlashSupported = !flashMode.IsEmpty();
double quality; // informational only
mParams.Get(CAMERA_PARAM_PICTURE_QUALITY, quality);
DOM_CAMERA_LOGI(" - maximum metering areas: %u\n", mCurrentConfiguration.mMaxMeteringAreas);
DOM_CAMERA_LOGI(" - maximum focus areas: %u\n", mCurrentConfiguration.mMaxFocusAreas);
DOM_CAMERA_LOGI(" - default picture size: %u x %u\n",
mLastPictureSize.width, mLastPictureSize.height);
DOM_CAMERA_LOGI(" - default picture file format: %s\n",
NS_ConvertUTF16toUTF8(mFileFormat).get());
DOM_CAMERA_LOGI(" - default picture quality: %f\n", quality);
DOM_CAMERA_LOGI(" - default thumbnail size: %u x %u\n",
mLastThumbnailSize.width, mLastThumbnailSize.height);
DOM_CAMERA_LOGI(" - default preview size: %u x %u\n",
mCurrentConfiguration.mPreviewSize.width, mCurrentConfiguration.mPreviewSize.height);
DOM_CAMERA_LOGI(" - default video recorder size: %u x %u\n",
mLastRecorderSize.width, mLastRecorderSize.height);
DOM_CAMERA_LOGI(" - default picture file format: %s\n",
NS_ConvertUTF16toUTF8(mFileFormat).get());
DOM_CAMERA_LOGI(" - luminance reporting: %ssupported\n",
mLuminanceSupported ? "" : "NOT ");
if (mFlashSupported) {

View File

@ -115,6 +115,8 @@ GonkCameraParameters::Parameters::GetTextKey(uint32_t aKey)
return "hdr-need-1x";
case CAMERA_PARAM_RECORDINGHINT:
return KEY_RECORDING_HINT;
case CAMERA_PARAM_PICTURE_QUALITY:
return KEY_JPEG_QUALITY;
case CAMERA_PARAM_SUPPORTED_PREVIEWSIZES:
return KEY_SUPPORTED_PREVIEW_SIZES;
@ -661,6 +663,19 @@ GonkCameraParameters::SetTranslated(uint32_t aKey, const double& aValue)
DOM_CAMERA_LOGI("Zoom = %fx --> index = %d\n", aValue, index);
}
return SetImpl(CAMERA_PARAM_ZOOM, index);
case CAMERA_PARAM_PICTURE_QUALITY:
{
// Convert aValue [0.0..1.0] to nearest index in the range [1..100].
index = (aValue + 0.005) * 99.0 + 1.0;
if (aValue < 0.0) {
index = 1;
} else if (aValue > 1.0) {
index = 100;
}
DOM_CAMERA_LOGI("Picture quality = %f --> index = %d\n", aValue, index);
}
return SetImpl(CAMERA_PARAM_PICTURE_QUALITY, index);
}
return SetImpl(aKey, aValue);
@ -725,6 +740,19 @@ GonkCameraParameters::GetTranslated(uint32_t aKey, double& aValue)
}
break;
case CAMERA_PARAM_PICTURE_QUALITY:
// Convert index [1..100] to a quality value [0.0..1.0].
rv = GetImpl(aKey, index);
if (index < 2) {
val = 0.0;
} else if (index > 99) {
val = 1.0;
} else {
val = static_cast<double>(index - 1) / 99.0;
}
DOM_CAMERA_LOGI("index = %d --> picture quality = %f\n", index, val);
break;
default:
rv = GetImpl(aKey, val);
break;

View File

@ -33,6 +33,7 @@ enum {
CAMERA_PARAM_PICTURE_ROTATION,
CAMERA_PARAM_PICTURE_LOCATION,
CAMERA_PARAM_PICTURE_DATETIME,
CAMERA_PARAM_PICTURE_QUALITY,
CAMERA_PARAM_EFFECT,
CAMERA_PARAM_WHITEBALANCE,
CAMERA_PARAM_SCENEMODE,

View File

@ -159,9 +159,23 @@ var Camera = {
ok(Camera.cameraObj.zoom == 1.0, "zoom = " + Camera.cameraObj.zoom);
// Test snapping to supported values
Camera.cameraObj.zoom = 0.9;
ok(Camera.cameraObj.zoom == 1.0, "zoom = " + Camera.cameraObj.zoom);
ok(Camera.cameraObj.zoom == 1.0, "zoom (lower limit) = " + Camera.cameraObj.zoom);
Camera.cameraObj.zoom = 1.1;
ok(Camera.cameraObj.zoom == 1.0, "zoom = " + Camera.cameraObj.zoom);
ok(Camera.cameraObj.zoom == 1.0, "zoom (upper limit) = " + Camera.cameraObj.zoom);
// Check image quality handling
Camera.cameraObj.pictureQuality = 0.0;
ok(Camera.cameraObj.pictureQuality == 0.0, "picture quality = " + Camera.cameraObj.pictureQuality);
Camera.cameraObj.pictureQuality = -0.1;
ok(Camera.cameraObj.pictureQuality == 0.0, "picture quality (minimum limit) = " + Camera.cameraObj.pictureQuality);
Camera.cameraObj.pictureQuality = -Math.pow(2, 80);
ok(Camera.cameraObj.pictureQuality == 0.0, "picture quality (BIG negative) = " + Camera.cameraObj.pictureQuality);
Camera.cameraObj.pictureQuality = 1.0;
ok(Camera.cameraObj.pictureQuality == 1.0, "picture quality = " + Camera.cameraObj.pictureQuality);
Camera.cameraObj.pictureQuality = 1.1;
ok(Camera.cameraObj.pictureQuality == 1.0, "picture quality (maximum limit) = " + Camera.cameraObj.pictureQuality);
Camera.cameraObj.pictureQuality = Math.pow(2, 80);
ok(Camera.cameraObj.pictureQuality == 1.0, "picture quality (BIG positive) = " + Camera.cameraObj.pictureQuality);
Camera._tests = new Array();
for (var i in Camera._pictureSizes) {

View File

@ -257,6 +257,16 @@ interface CameraControl : MediaStream
[Throws]
void setPictureSize(optional CameraSize size);
/* if the image blob to be returned by takePicture() supports lossy
compression, this setting controls the quality-size trade-off;
valid values range from 0.0 for smallest size/worst quality to 1.0
for largest size/best quality. Note that depending on the range of
values supported by the underlying platform, this attribute may not
'get' the exact value that was previously 'set'. If this setting is
not supported, it is ignored. */
[Throws]
attribute double pictureQuality;
/* the size of the thumbnail to be included in the picture returned
by a call to takePicture(), assuming the chosen fileFormat supports
one; an object with 'height' and 'width' properties that corresponds

View File

@ -2517,6 +2517,9 @@ public class BrowserApp extends GeckoApp
final boolean inGuestMode = GeckoProfile.get(this).inGuestMode();
share.setVisible(!inGuestMode);
share.setEnabled(StringUtils.isShareableUrl(url) && !inGuestMode);
MenuUtils.safeSetEnabled(aMenu, R.id.apps, !inGuestMode);
MenuUtils.safeSetEnabled(aMenu, R.id.addons, !inGuestMode);
MenuUtils.safeSetEnabled(aMenu, R.id.downloads, !inGuestMode);
// NOTE: Use MenuUtils.safeSetEnabled because some actions might
// be on the BrowserToolbar context menu

View File

@ -55,3 +55,5 @@ retrievalFailedTitle=#1 update failed;#1 updates failed
# %1$S is a comma-separated list of apps for which retrieval failed.
# example: Failed to retrieve updates for Foo, Bar, Baz
retrievalFailedMessage=Failed to retrieve update for %1$S;Failed to retrieve updates for %1$S
webappsDisabledInGuest=Installing apps is disabled in guest sessions

View File

@ -89,6 +89,12 @@ this.WebappManager = {
},
_installApk: function(aMessage, aMessageManager) { return Task.spawn((function*() {
if (this.inGuestSession()) {
aMessage.error = Strings.GetStringFromName("webappsDisabledInGuest"),
aMessageManager.sendAsyncMessage("Webapps:Install:Return:KO", aMessage);
return;
}
let filePath;
try {
@ -257,6 +263,10 @@ this.WebappManager = {
}),
inGuestSession: function() {
return Services.wm.getMostRecentWindow("navigator:browser").BrowserApp.isGuest;
},
autoInstall: function(aData) {
debug("autoInstall " + aData.manifestURL);

View File

@ -59,7 +59,7 @@ class Bootstrapper(object):
cls = UbuntuBootstrapper
elif distro == 'Ubuntu':
cls = UbuntuBootstrapper
elif distro == 'Elementary':
elif distro in ('Elementary OS', 'Elementary'):
cls = UbuntuBootstrapper
else:
raise NotImplementedError('Bootstrap support for this Linux '

View File

@ -1965,11 +1965,13 @@ ThreadActor.prototype = {
switch (typeof aValue) {
case "boolean":
return aValue;
case "string":
if (this._stringIsLong(aValue)) {
return this.longStringGrip(aValue, aPool);
}
return aValue;
case "number":
if (aValue === Infinity) {
return { type: "Infinity" };
@ -1981,13 +1983,26 @@ ThreadActor.prototype = {
return { type: "-0" };
}
return aValue;
case "undefined":
return { type: "undefined" };
case "object":
if (aValue === null) {
return { type: "null" };
}
return this.objectGrip(aValue, aPool);
case "symbol":
let form = {
type: "symbol"
};
let name = getSymbolName(aValue);
if (name !== undefined) {
form.name = this.createValueGrip(name);
}
return form;
default:
dbg_assert(false, "Failed to provide a grip for: " + aValue);
return null;
@ -5430,6 +5445,13 @@ function getInnerId(window) {
getInterface(Ci.nsIDOMWindowUtils).currentInnerWindowID;
};
const symbolProtoToString = Symbol.prototype.toString;
function getSymbolName(symbol) {
const name = symbolProtoToString.call(symbol).slice("Symbol(".length, -1);
return name || undefined;
}
exports.register = function(handle) {
ThreadActor.breakpointStore = new BreakpointStore();
ThreadSources._blackBoxedSources = new Set(["self-hosted"]);

View File

@ -0,0 +1,58 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that we can represent ES6 Symbols over the RDP.
*/
const URL = "foo.js";
function run_test() {
initTestDebuggerServer();
const debuggee = addTestGlobal("test-symbols");
const client = new DebuggerClient(DebuggerServer.connectPipe());
client.connect(function() {
attachTestTabAndResume(client, "test-symbols", function(response, tabClient, threadClient) {
add_task(testSymbols.bind(null, client, debuggee));
run_next_test();
});
});
do_test_pending();
}
function* testSymbols(client, debuggee) {
const evalCode = () => {
Components.utils.evalInSandbox(
"(" + function () {
var symbolWithName = Symbol("Chris");
var symbolWithoutName = Symbol();
var iteratorSymbol = Symbol.iterator;
debugger;
} + "())",
debuggee,
"1.8",
URL,
1
);
};
const packet = yield executeOnNextTickAndWaitForPause(evalCode, client);
const {
symbolWithName,
symbolWithoutName,
iteratorSymbol
} = packet.frame.environment.bindings.variables;
equal(symbolWithName.value.type, "symbol");
equal(symbolWithName.value.name, "Chris");
equal(symbolWithoutName.value.type, "symbol");
ok(!("name" in symbolWithoutName.value));
equal(iteratorSymbol.value.type, "symbol");
equal(iteratorSymbol.value.name, "Symbol.iterator");
finishClient(client);
}

View File

@ -0,0 +1,49 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that we don't run debuggee code when getting symbol names.
*/
const URL = "foo.js";
function run_test() {
initTestDebuggerServer();
const debuggee = addTestGlobal("test-symbols");
const client = new DebuggerClient(DebuggerServer.connectPipe());
client.connect(function() {
attachTestTabAndResume(client, "test-symbols", function(response, tabClient, threadClient) {
add_task(testSymbols.bind(null, client, debuggee));
run_next_test();
});
});
do_test_pending();
}
function* testSymbols(client, debuggee) {
const evalCode = () => {
Components.utils.evalInSandbox(
"(" + function () {
Symbol.prototype.toString = () => {
throw new Error("lololol");
};
var sym = Symbol("le troll");
debugger;
} + "())",
debuggee,
"1.8",
URL,
1
);
};
const packet = yield executeOnNextTickAndWaitForPause(evalCode, client);
const { sym } = packet.frame.environment.bindings.variables;
equal(sym.value.type, "symbol");
equal(sym.value.name, "le troll");
finishClient(client);
}

View File

@ -205,3 +205,5 @@ reason = bug 937197
[test_registerClient.js]
[test_client_request.js]
[test_monitor_actor.js]
[test_symbols-01.js]
[test_symbols-02.js]