Back out a4045a049e9e (bug 662324) for browser-chrome orange

This commit is contained in:
Phil Ringnalda 2012-01-29 18:42:27 -08:00
parent 11b8ef6ea2
commit 8f2a49393f
6 changed files with 0 additions and 62 deletions

View File

@ -68,18 +68,6 @@ var gSetBackground = {
if (this._screenWidth / this._screenHeight >= 1.6)
document.getElementById("monitor").setAttribute("aspectratio", "16:10");
#ifdef XP_WIN
// hide fill + fit options if <win7 since don't work
var version = Components.classes["@mozilla.org/system-info;1"]
.getService(Ci.nsIPropertyBag2)
.getProperty("version");
var isWindows7OrHigher = (parseFloat(version) >= 6.1);
if (!isWindows7OrHigher) {
document.getElementById("fillPosition").hidden = true;
document.getElementById("fitPosition").hidden = true;
}
#endif
// make sure that the correct dimensions will be used
setTimeout(function(self) {
self.init(window.arguments[0]);
@ -210,39 +198,6 @@ var gSetBackground = {
var x = (this._screenWidth - this._image.naturalWidth) / 2;
var y = (this._screenHeight - this._image.naturalHeight) / 2;
ctx.drawImage(this._image, x, y);
break;
case "FILL":
//Try maxing width first, overflow height
var widthRatio = this._screenWidth / this._image.naturalWidth;
var width = this._image.naturalWidth * widthRatio;
var height = this._image.naturalHeight * widthRatio;
if (height < this._screenHeight) {
//height less than screen, max height and overflow width
var heightRatio = this._screenHeight / this._image.naturalHeight;
width = this._image.naturalWidth * heightRatio;
height = this._image.naturalHeight * heightRatio;
}
var x = (this._screenWidth - width) / 2;
var y = (this._screenHeight - height) / 2;
ctx.drawImage(this._image, x, y, width, height);
break;
case "FIT":
//Try maxing width first, top and bottom borders
var widthRatio = this._screenWidth / this._image.naturalWidth;
var width = this._image.naturalWidth * widthRatio;
var height = this._image.naturalHeight * widthRatio;
var x = 0;
var y = (this._screenHeight - height) / 2;
if (height > this._screenHeight) {
//height overflow, maximise height, side borders
var heightRatio = this._screenHeight / this._image.naturalHeight;
width = this._image.naturalWidth * heightRatio;
height = this._image.naturalHeight * heightRatio;
x = (this._screenWidth - width) / 2;
y = 0;
}
ctx.drawImage(this._image, x, y, width, height);
break;
}
}
};

View File

@ -78,8 +78,6 @@
<menuitem label="&center.label;" value="CENTER"/>
<menuitem label="&tile.label;" value="TILE"/>
<menuitem label="&stretch.label;" value="STRETCH"/>
<menuitem label="&fill.label;" value="FILL" id="fillPosition"/>
<menuitem label="&fit.label;" value="FIT" id="fitPosition"/>
</menupopup>
</menulist>
<spacer flex="1"/>

View File

@ -81,7 +81,6 @@ interface nsIShellService : nsISupports
const long BACKGROUND_STRETCH = 2;
const long BACKGROUND_CENTER = 3;
const long BACKGROUND_FILL = 4;
const long BACKGROUND_FIT = 5;
/**
* Sets the desktop background image using either the HTML <IMG>

View File

@ -427,10 +427,6 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
options.Assign("wallpaper");
else if (aPosition == BACKGROUND_STRETCH)
options.Assign("stretched");
else if (aPosition == BACKGROUND_FILL)
options.Assign("zoom");
else if (aPosition == BACKGROUND_FIT)
options.Assign("scaled");
else
options.Assign("centered");

View File

@ -640,14 +640,6 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
style.AssignLiteral("2");
tile.AssignLiteral("0");
break;
case BACKGROUND_FILL:
style.AssignLiteral("10");
tile.AssignLiteral("0");
break;
case BACKGROUND_FIT:
style.AssignLiteral("6");
tile.AssignLiteral("0");
break;
}
rv = regKey->WriteStringValue(NS_LITERAL_STRING("TileWallpaper"), tile);

View File

@ -2,8 +2,6 @@
<!ENTITY tile.label "Tile">
<!ENTITY center.label "Center">
<!ENTITY stretch.label "Stretch">
<!ENTITY fill.label "Fill">
<!ENTITY fit.label "Fit">
<!ENTITY preview.label "Preview">
<!ENTITY color.label "Color:">
<!ENTITY setDesktopBackground.title "Set Desktop Background">