Merge from cvs-trunk-mirror to mozilla-central. (This doesn't build, thanks to bug 425080, which I'll fix next.)

This commit is contained in:
2008-03-26 11:42:07 -05:00
540 changed files with 53585 additions and 16686 deletions

View File

@@ -1710,8 +1710,10 @@ nsresult nsAccessible::GetTextFromRelationID(nsIAtom *aIDProperty, nsString &aNa
{ {
// Get DHTML name from content subtree pointed to by ID attribute // Get DHTML name from content subtree pointed to by ID attribute
aName.Truncate(); aName.Truncate();
NS_ASSERTION(mDOMNode, "Called from shutdown accessible");
nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode); nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode);
NS_ASSERTION(content, "Called from shutdown accessible"); if (!content)
return NS_OK;
nsAutoString ids; nsAutoString ids;
if (!content->GetAttr(kNameSpaceID_None, aIDProperty, ids)) { if (!content->GetAttr(kNameSpaceID_None, aIDProperty, ids)) {
@@ -2199,6 +2201,8 @@ nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
if (!sameTypeParent || sameTypeParent == docShellTreeItem) if (!sameTypeParent || sameTypeParent == docShellTreeItem)
break; break;
nsIDocument *parentDoc = doc->GetParentDocument(); nsIDocument *parentDoc = doc->GetParentDocument();
if (!parentDoc)
break;
startContent = parentDoc->FindContentForSubDocument(doc); startContent = parentDoc->FindContentForSubDocument(doc);
} }

View File

@@ -217,12 +217,12 @@ pref("browser.urlbar.matchOnWordBoundary", true);
pref("browser.urlbar.filter.javascript", true); pref("browser.urlbar.filter.javascript", true);
// the maximum number of results to show in autocomplete when doing richResults // the maximum number of results to show in autocomplete when doing richResults
pref("browser.urlbar.maxRichResults", 25); pref("browser.urlbar.maxRichResults", 12);
// Size of "chunks" affects the number of places to process between each search // Size of "chunks" affects the number of places to process between each search
// timeout (ms). Too big and the UI will be unresponsive; too small and we'll // timeout (ms). Too big and the UI will be unresponsive; too small and we'll
// be waiting on the timeout too often without many results. // be waiting on the timeout too often without many results.
pref("browser.urlbar.search.chunkSize", 1000); pref("browser.urlbar.search.chunkSize", 1000);
pref("browser.urlbar.search.timeout", 50); pref("browser.urlbar.search.timeout", 100);
pref("browser.download.useDownloadDir", true); pref("browser.download.useDownloadDir", true);
pref("browser.download.folderList", 0); pref("browser.download.folderList", 0);
@@ -687,7 +687,7 @@ pref("places.frecency.defaultBucketWeight", 10);
// bonus (in percent) for visit transition types for frecency calculations // bonus (in percent) for visit transition types for frecency calculations
pref("places.frecency.embedVisitBonus", 0); pref("places.frecency.embedVisitBonus", 0);
pref("places.frecency.linkVisitBonus", 100); pref("places.frecency.linkVisitBonus", 100);
pref("places.frecency.typedVisitBonus", 500); pref("places.frecency.typedVisitBonus", 2000);
pref("places.frecency.bookmarkVisitBonus", 150); pref("places.frecency.bookmarkVisitBonus", 150);
pref("places.frecency.downloadVisitBonus", 0); pref("places.frecency.downloadVisitBonus", 0);
pref("places.frecency.permRedirectVisitBonus", 0); pref("places.frecency.permRedirectVisitBonus", 0);
@@ -725,3 +725,6 @@ pref("editor.singleLine.pasteNewlines", 2);
// The breakpad report server to link to in about:crashes // The breakpad report server to link to in about:crashes
pref("breakpad.reportURL", "http://crash-stats.mozilla.com/report/index/"); pref("breakpad.reportURL", "http://crash-stats.mozilla.com/report/index/");
// base URL for web-based support pages
pref("app.support.baseURL", "http://support.mozilla.com/1/%APP%/%VERSION%/%OS%/%LOCALE%/");

View File

@@ -49,7 +49,6 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/> <script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
#ifdef XP_MACOSX #ifdef XP_MACOSX
<!-- nsMenuBarX hides these and uses them to build the Application menu. <!-- nsMenuBarX hides these and uses them to build the Application menu.
@@ -77,7 +76,7 @@
accesskey="&helpMenu.accesskey;"> accesskey="&helpMenu.accesskey;">
#endif #endif
<menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();"> <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
<menuitem oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');" <menuitem oncommand="openHelpLink('firefox-help')"
#ifdef XP_MACOSX #ifdef XP_MACOSX
label="&helpContentsMac.label;" label="&helpContentsMac.label;"
key="key_openHelpMacFrontend"/> key="key_openHelpMacFrontend"/>
@@ -90,7 +89,7 @@
#ifdef XP_WIN #ifdef XP_WIN
<menuitem label="&helpForIEUsers.label;" <menuitem label="&helpForIEUsers.label;"
accesskey="&helpForIEUsers.accesskey;" accesskey="&helpForIEUsers.accesskey;"
oncommand="openHelp('ieusers', 'chrome://browser/locale/help/help.rdf');"/> oncommand="openHelpLink('ieusers');"/>
#endif #endif
<menuitem id="releaseNotes" <menuitem id="releaseNotes"
accesskey="&helpReleaseNotes.accesskey;" accesskey="&helpReleaseNotes.accesskey;"
@@ -116,7 +115,7 @@
<!-- On mac, we map Cmd+Shift+/, but show Cmd+? <!-- On mac, we map Cmd+Shift+/, but show Cmd+?
(that's for en-US, it might be different for other keyboard layouts) --> (that's for en-US, it might be different for other keyboard layouts) -->
<key id="key_openHelpMac" <key id="key_openHelpMac"
oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');" oncommand="openHelpLink('firefox-help');"
key="&openHelpMac.commandkey;" key="&openHelpMac.commandkey;"
modifiers="&openHelpMac.modifiers;"/> modifiers="&openHelpMac.modifiers;"/>
<key id="key_openHelpMacFrontend" <key id="key_openHelpMacFrontend"
@@ -134,7 +133,7 @@
modifiers="&hideOtherAppsCmdMac.modifiers;"/> modifiers="&hideOtherAppsCmdMac.modifiers;"/>
#else #else
<key id="key_openHelp" <key id="key_openHelp"
oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');" oncommand="openHelpLink('firefox-help');"
keycode="&openHelp.commandkey;"/> keycode="&openHelp.commandkey;"/>
#endif #endif
</keyset> </keyset>

View File

@@ -2437,6 +2437,7 @@ function toggleAffectedChrome(aHide)
gChromeState.notificationsOpen = !notificationBox.notificationsHidden; gChromeState.notificationsOpen = !notificationBox.notificationsHidden;
notificationBox.notificationsHidden = aHide; notificationBox.notificationsHidden = aHide;
document.getElementById("sidebar").setAttribute("src", "about:blank");
var statusbar = document.getElementById("status-bar"); var statusbar = document.getElementById("status-bar");
gChromeState.statusbarOpen = !statusbar.hidden; gChromeState.statusbarOpen = !statusbar.hidden;
statusbar.hidden = aHide; statusbar.hidden = aHide;
@@ -3211,16 +3212,22 @@ function BrowserCustomizeToolbar()
if (splitter) if (splitter)
splitter.parentNode.removeChild(splitter); splitter.parentNode.removeChild(splitter);
var customizeURL = "chrome://global/content/customizeToolbar.xul";
#ifdef TOOLBAR_CUSTOMIZATION_SHEET #ifdef TOOLBAR_CUSTOMIZATION_SHEET
var sheetFrame = document.getElementById("customizeToolbarSheetIFrame"); var sheetFrame = document.getElementById("customizeToolbarSheetIFrame");
sheetFrame.hidden = false; sheetFrame.hidden = false;
// The document might not have been loaded yet, if this is the first time
if (sheetFrame.getAttribute("src") != customizeURL)
sheetFrame.setAttribute("src", customizeURL);
// XXXmano: there's apparently no better way to get this when the iframe is // XXXmano: there's apparently no better way to get this when the iframe is
// hidden // hidden
var sheetWidth = sheetFrame.style.width.match(/([0-9]+)px/)[1]; var sheetWidth = sheetFrame.style.width.match(/([0-9]+)px/)[1];
document.getElementById("customizeToolbarSheetPopup") document.getElementById("customizeToolbarSheetPopup")
.openPopup(getNavToolbox(), "after_start", (window.innerWidth - sheetWidth) / 2, 0); .openPopup(getNavToolbox(), "after_start", (window.innerWidth - sheetWidth) / 2, 0);
#else #else
window.openDialog("chrome://global/content/customizeToolbar.xul", window.openDialog(customizeURL,
"CustomizeToolbar", "CustomizeToolbar",
"chrome,all,dependent", "chrome,all,dependent",
getNavToolbox()); getNavToolbox());
@@ -4497,6 +4504,7 @@ function toggleSidebar(commandID, forceOpen) {
sidebarBroadcaster.removeAttribute("checked"); sidebarBroadcaster.removeAttribute("checked");
sidebarBox.setAttribute("sidebarcommand", ""); sidebarBox.setAttribute("sidebarcommand", "");
sidebarTitle.value = ""; sidebarTitle.value = "";
sidebar.setAttribute("src", "about:blank");
sidebarBox.hidden = true; sidebarBox.hidden = true;
sidebarSplitter.hidden = true; sidebarSplitter.hidden = true;
content.focus(); content.focus();

View File

@@ -133,6 +133,15 @@
<vbox id="editBookmarkPanelContent" flex="1" hidden="true"/> <vbox id="editBookmarkPanelContent" flex="1" hidden="true"/>
<hbox flex="1" id="editBookmarkPanelBottomButtons"> <hbox flex="1" id="editBookmarkPanelBottomButtons">
<spacer flex="1"/> <spacer flex="1"/>
#ifndef XP_UNIX
<button id="editBookmarkPanelDoneButton"
label="&editBookmark.done.label;"
default="true"
oncommand="StarUI.panel.hidePopup();"/>
<button id="editBookmarkPanelDeleteButton"
label="&editBookmark.cancel.label;"
oncommand="StarUI.cancelButtonOnCommand();"/>
#else
<button id="editBookmarkPanelDeleteButton" <button id="editBookmarkPanelDeleteButton"
label="&editBookmark.cancel.label;" label="&editBookmark.cancel.label;"
oncommand="StarUI.cancelButtonOnCommand();"/> oncommand="StarUI.cancelButtonOnCommand();"/>
@@ -140,6 +149,7 @@
label="&editBookmark.done.label;" label="&editBookmark.done.label;"
default="true" default="true"
oncommand="StarUI.panel.hidePopup();"/> oncommand="StarUI.panel.hidePopup();"/>
#endif
</hbox> </hbox>
</panel> </panel>
@@ -312,7 +322,7 @@
showimagecolumn="true" showimagecolumn="true"
enablehistory="true" enablehistory="true"
timeout="100" timeout="100"
maxrows="10" maxrows="6"
newlines="stripsurroundingwhitespace" newlines="stripsurroundingwhitespace"
oninput="URLBarOnInput(event);" oninput="URLBarOnInput(event);"
ontextentered="return handleURLBarCommand(param);" ontextentered="return handleURLBarCommand(param);"
@@ -511,7 +521,6 @@
<panel id="customizeToolbarSheetPopup" noautohide="true"> <panel id="customizeToolbarSheetPopup" noautohide="true">
<iframe id="customizeToolbarSheetIFrame" <iframe id="customizeToolbarSheetIFrame"
style="&dialog.style;" style="&dialog.style;"
src="chrome://global/content/customizeToolbar.xul"
hidden="true"/> hidden="true"/>
</panel> </panel>
#endif #endif

View File

@@ -392,7 +392,7 @@ function doHelpButton()
var deck = document.getElementById("mainDeck"); var deck = document.getElementById("mainDeck");
var helpdoc = helpTopics[deck.selectedPanel.id] || "pageinfo_general"; var helpdoc = helpTopics[deck.selectedPanel.id] || "pageinfo_general";
openHelp(helpdoc, 'chrome://browser/locale/help/help.rdf'); openHelpLink(helpdoc);
} }
function showTab(id) function showTab(id)

View File

@@ -71,7 +71,6 @@
<script type="application/x-javascript" src="chrome://browser/content/pageinfo/permissions.js"/> <script type="application/x-javascript" src="chrome://browser/content/pageinfo/permissions.js"/>
<script type="application/x-javascript" src="chrome://browser/content/pageinfo/security.js"/> <script type="application/x-javascript" src="chrome://browser/content/pageinfo/security.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/> <script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/> <script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
<stringbundleset id="pageinfobundleset"> <stringbundleset id="pageinfobundleset">
@@ -100,8 +99,9 @@
<key keycode="VK_ESCAPE" command="cmd_close"/> <key keycode="VK_ESCAPE" command="cmd_close"/>
#ifdef XP_MACOSX #ifdef XP_MACOSX
<key key="." modifiers="meta" command="cmd_close"/> <key key="." modifiers="meta" command="cmd_close"/>
#endif #else
<key keycode="VK_F1" command="cmd_help"/> <key keycode="VK_F1" command="cmd_help"/>
#endif
<key key="&copy.key;" modifiers="accel" command="cmd_copy"/> <key key="&copy.key;" modifiers="accel" command="cmd_copy"/>
<key key="&selectall.key;" modifiers="accel" command="cmd_selectall"/> <key key="&selectall.key;" modifiers="accel" command="cmd_selectall"/>
<key key="&selectall.key;" modifiers="alt" command="cmd_selectall"/> <key key="&selectall.key;" modifiers="alt" command="cmd_selectall"/>

View File

@@ -3,10 +3,14 @@ function test() {
// XXX This looks a bit odd, but is needed to avoid throwing when removing the // XXX This looks a bit odd, but is needed to avoid throwing when removing the
// event listeners below. See bug 310955. // event listeners below. See bug 310955.
document.getElementById("sidebar").addEventListener("load", function() { setTimeout(openPanelUrl, 100) }, true); document.getElementById("sidebar").addEventListener("load", delayedOpenUrl, true);
toggleSidebar("viewWebPanelsSidebar", true); toggleSidebar("viewWebPanelsSidebar", true);
} }
function delayedOpenUrl() {
setTimeout(openPanelUrl, 100);
}
function openPanelUrl(event) { function openPanelUrl(event) {
ok(!document.getElementById("sidebar-box").hidden, "Sidebar showing"); ok(!document.getElementById("sidebar-box").hidden, "Sidebar showing");
@@ -14,16 +18,20 @@ function openPanelUrl(event) {
var root = sidebar.contentDocument.documentElement; var root = sidebar.contentDocument.documentElement;
ok(root.nodeName != "parsererror", "Sidebar is well formed"); ok(root.nodeName != "parsererror", "Sidebar is well formed");
sidebar.removeEventListener("load", openPanelUrl, true); sidebar.removeEventListener("load", delayedOpenUrl, true);
// XXX See comment above // XXX See comment above
sidebar.contentDocument.addEventListener("load", function() { setTimeout(runTest, 100) }, true); sidebar.contentDocument.addEventListener("load", delayedRunTest, true);
var url = 'data:text/html,<div%20id="test_bug409481">Content!</div>'; var url = 'data:text/html,<div%20id="test_bug409481">Content!</div>';
sidebar.contentWindow.loadWebPanel(url); sidebar.contentWindow.loadWebPanel(url);
} }
function delayedRunTest() {
setTimeout(runTest, 100);
}
function runTest(event) { function runTest(event) {
var sidebar = document.getElementById("sidebar"); var sidebar = document.getElementById("sidebar");
sidebar.contentDocument.removeEventListener("load", runTest, true); sidebar.contentDocument.removeEventListener("load", delayedRunTest, true);
var browser = sidebar.contentDocument.getElementById("web-panels-browser"); var browser = sidebar.contentDocument.getElementById("web-panels-browser");
var div = browser && browser.contentDocument.getElementById("test_bug409481"); var div = browser && browser.contentDocument.getElementById("test_bug409481");

View File

@@ -673,3 +673,25 @@ function getOfflineAppUsage(host)
return usage; return usage;
} }
// aCalledFromModal is optional
function openHelpLink(aHelpTopic, aCalledFromModal) {
var url = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter)
.formatURLPref("app.support.baseURL");
url += aHelpTopic;
var where = aCalledFromModal ? "window" : "tab";
openUILinkIn(url, where);
}
function openPrefsHelp() {
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch2);
// non-instant apply prefwindows are usually modal, so we can't open in the topmost window,
// since its probably behind the window.
var instantApply = prefs.getBoolPref("browser.preferences.instantApply");
var helpTopic = document.getElementsByTagName("prefwindow")[0].currentPane.helpTopic;
openHelpLink(helpTopic, !instantApply);
}

View File

@@ -203,10 +203,15 @@ FeedWriter.prototype = {
}, },
_setContentText: function FW__setContentText(id, text) { _setContentText: function FW__setContentText(id, text) {
var element = this._document.getElementById(id); this._contentSandbox.element = this._document.getElementById(id);
while (element.hasChildNodes()) this._contentSandbox.textNode = this._document.createTextNode(text);
element.removeChild(element.firstChild); var codeStr =
element.appendChild(this._document.createTextNode(text)); "while (element.hasChildNodes()) " +
" element.removeChild(element.firstChild);" +
"element.appendChild(textNode);";
Cu.evalInSandbox(codeStr, this._contentSandbox);
this._contentSandbox.element = null;
this._contentSandbox.textNode = null;
}, },
/** /**
@@ -229,11 +234,28 @@ FeedWriter.prototype = {
// checkLoadURIStrWithPrincipal will throw if the link URI should not be // checkLoadURIStrWithPrincipal will throw if the link URI should not be
// loaded, either because our feedURI isn't allowed to load it or per // loaded, either because our feedURI isn't allowed to load it or per
// the rules specified in |flags|, so we'll never "linkify" the link... // the rules specified in |flags|, so we'll never "linkify" the link...
element.setAttribute(attribute, uri);
} }
catch (e) { catch (e) {
// Not allowed to load this link because secman.checkLoadURIStr threw // Not allowed to load this link because secman.checkLoadURIStr threw
return;
} }
this._contentSandbox.element = element;
this._contentSandbox.uri = uri;
var codeStr = "element.setAttribute('" + attribute + "', uri);";
Cu.evalInSandbox(codeStr, this._contentSandbox);
},
/**
* Use this sandbox to run any dom manipulation code on nodes which
* are already inserted into the content document.
*/
__contentSandbox: null,
get _contentSandbox() {
if (!this.__contentSandbox)
this.__contentSandbox = new Cu.Sandbox(this._window);
return this.__contentSandbox;
}, },
/** /**
@@ -244,9 +266,9 @@ FeedWriter.prototype = {
* the XUL element to call doCommand() on. * the XUL element to call doCommand() on.
*/ */
_safeDoCommand: function FW___safeDoCommand(aElement) { _safeDoCommand: function FW___safeDoCommand(aElement) {
var sandbox = new Cu.Sandbox(this._window); this._contentSandbox.element = aElement;
sandbox.element = aElement; Cu.evalInSandbox("element.doCommand();", this._contentSandbox);
Cu.evalInSandbox("element.doCommand();", sandbox); this._contentSandbox.element = null;
}, },
__faviconService: null, __faviconService: null,
@@ -290,47 +312,23 @@ FeedWriter.prototype = {
}, },
_setCheckboxCheckedState: function FW__setCheckboxCheckedState(aCheckbox, aValue) { _setCheckboxCheckedState: function FW__setCheckboxCheckedState(aCheckbox, aValue) {
// see checkbox.xml // see checkbox.xml, xbl bindings are not applied within the sandbox!
this._contentSandbox.checkbox = aCheckbox;
var codeStr;
var change = (aValue != (aCheckbox.getAttribute('checked') == 'true')); var change = (aValue != (aCheckbox.getAttribute('checked') == 'true'));
if (aValue) if (aValue)
aCheckbox.setAttribute('checked', 'true'); codeStr = "checkbox.setAttribute('checked', 'true'); ";
else else
aCheckbox.removeAttribute('checked'); codeStr = "checkbox.removeAttribute('checked'); ";
if (change) { if (change) {
var sandbox = new Cu.Sandbox(this._window); this._contentSandbox.document = this._document;
sandbox.document = this._document; codeStr += "var event = document.createEvent('Events'); " +
sandbox.checkbox = aCheckbox; "event.initEvent('CheckboxStateChange', true, true);" +
var codeStr = "var event = document.createEvent('Events'); " + "checkbox.dispatchEvent(event);"
"event.initEvent('CheckboxStateChange', true, true);" +
"checkbox.dispatchEvent(event);"
Cu.evalInSandbox(codeStr, sandbox);
}
},
// For setting and getting the file expando property, we need to keep a
// reference to explict XPCNativeWrappers around the associated menuitems
_selectedApplicationItemWrapped: null,
get selectedApplicationItemWrapped() {
if (!this._selectedApplicationItemWrapped) {
this._selectedApplicationItemWrapped =
XPCNativeWrapper(this._document.getElementById("selectedAppMenuItem"));
} }
return this._selectedApplicationItemWrapped; Cu.evalInSandbox(codeStr, this._contentSandbox);
},
_defaultSystemReaderItemWrapped: null,
get defaultSystemReaderItemWrapped() {
if (!this._defaultSystemReaderItemWrapped) {
// Unlike the selected application item, this might not exist at all,
// see _initSubscriptionUI
var menuItem = this._document.getElementById("defaultHandlerMenuItem");
if (menuItem)
this._defaultSystemReaderItemWrapped = XPCNativeWrapper(menuItem);
}
return this._defaultSystemReaderItemWrapped;
}, },
/** /**
@@ -424,7 +422,13 @@ FeedWriter.prototype = {
var titleText = this._getFormattedString("linkTitleTextFormat", var titleText = this._getFormattedString("linkTitleTextFormat",
[parts.getPropertyAsAString("title")]); [parts.getPropertyAsAString("title")]);
feedTitleLink.setAttribute("title", titleText); this._contentSandbox.feedTitleLink = feedTitleLink;
this._contentSandbox.titleText = titleText;
var codeStr = "feedTitleLink.setAttribute('title', titleText);";
Cu.evalInSandbox(codeStr, this._contentSandbox);
this._contentSandbox.feedTitleLink = null;
this._contentSandbox.titleText = null;
this._safeSetURIAttribute(feedTitleLink, "href", this._safeSetURIAttribute(feedTitleLink, "href",
parts.getPropertyAsAString("link")); parts.getPropertyAsAString("link"));
@@ -446,13 +450,17 @@ FeedWriter.prototype = {
*/ */
_writeFeedContent: function FW__writeFeedContent(container) { _writeFeedContent: function FW__writeFeedContent(container) {
// Build the actual feed content // Build the actual feed content
var feedContent = this._document.getElementById("feedContent");
var feed = container.QueryInterface(Ci.nsIFeed); var feed = container.QueryInterface(Ci.nsIFeed);
if (feed.items.length == 0)
return;
this._contentSandbox.feedContent =
this._document.getElementById("feedContent");
for (var i = 0; i < feed.items.length; ++i) { for (var i = 0; i < feed.items.length; ++i) {
var entry = feed.items.queryElementAt(i, Ci.nsIFeedEntry); var entry = feed.items.queryElementAt(i, Ci.nsIFeedEntry);
entry.QueryInterface(Ci.nsIFeedContainer); entry.QueryInterface(Ci.nsIFeedContainer);
var entryContainer = this._document.createElementNS(HTML_NS, "div"); var entryContainer = this._document.createElementNS(HTML_NS, "div");
entryContainer.className = "entry"; entryContainer.className = "entry";
@@ -460,29 +468,29 @@ FeedWriter.prototype = {
if (entry.title) { if (entry.title) {
var a = this._document.createElementNS(HTML_NS, "a"); var a = this._document.createElementNS(HTML_NS, "a");
a.appendChild(this._document.createTextNode(entry.title.plainText())); a.appendChild(this._document.createTextNode(entry.title.plainText()));
// Entries are not required to have links, so entry.link can be null. // Entries are not required to have links, so entry.link can be null.
if (entry.link) if (entry.link)
this._safeSetURIAttribute(a, "href", entry.link.spec); this._safeSetURIAttribute(a, "href", entry.link.spec);
var title = this._document.createElementNS(HTML_NS, "h3"); var title = this._document.createElementNS(HTML_NS, "h3");
title.appendChild(a); title.appendChild(a);
entryContainer.appendChild(title);
var lastUpdated = this._parseDate(entry.updated); var lastUpdated = this._parseDate(entry.updated);
if (lastUpdated) { if (lastUpdated) {
var dateDiv = this._document.createElementNS(HTML_NS, "div"); var dateDiv = this._document.createElementNS(HTML_NS, "div");
dateDiv.setAttribute("class", "lastUpdated"); dateDiv.className = "lastUpdated";
title.appendChild(dateDiv);
dateDiv.textContent = lastUpdated; dateDiv.textContent = lastUpdated;
title.appendChild(dateDiv);
} }
entryContainer.appendChild(title);
} }
var body = this._document.createElementNS(HTML_NS, "div"); var body = this._document.createElementNS(HTML_NS, "div");
var summary = entry.summary || entry.content; var summary = entry.summary || entry.content;
var docFragment = null; var docFragment = null;
if (summary) { if (summary) {
if (summary.base) if (summary.base)
body.setAttributeNS(XML_NS, "base", summary.base.spec); body.setAttributeNS(XML_NS, "base", summary.base.spec);
else else
@@ -510,11 +518,19 @@ FeedWriter.prototype = {
entryContainer.appendChild(enclosuresDiv); entryContainer.appendChild(enclosuresDiv);
} }
feedContent.appendChild(entryContainer); this._contentSandbox.entryContainer = entryContainer;
var clearDiv = this._document.createElementNS(HTML_NS, "div"); this._contentSandbox.clearDiv =
clearDiv.style.clear = "both"; this._document.createElementNS(HTML_NS, "div");
feedContent.appendChild(clearDiv); this._contentSandbox.clearDiv.style.clear = "both";
var codeStr = "feedContent.appendChild(entryContainer); " +
"feedContent.appendChild(clearDiv);"
Cu.evalInSandbox(codeStr, this._contentSandbox);
} }
this._contentSandbox.feedContent = null;
this._contentSandbox.entryContainer = null;
this._contentSandbox.clearDiv = null;
}, },
/** /**
@@ -546,7 +562,7 @@ FeedWriter.prototype = {
*/ */
_buildEnclosureDiv: function FW__buildEnclosureDiv(entry) { _buildEnclosureDiv: function FW__buildEnclosureDiv(entry) {
var enclosuresDiv = this._document.createElementNS(HTML_NS, "div"); var enclosuresDiv = this._document.createElementNS(HTML_NS, "div");
enclosuresDiv.setAttribute("class", "enclosures"); enclosuresDiv.className = "enclosures";
enclosuresDiv.appendChild(this._document.createTextNode(this._getString("mediaLabel"))); enclosuresDiv.appendChild(this._document.createTextNode(this._getString("mediaLabel")));
@@ -708,9 +724,12 @@ FeedWriter.prototype = {
* The menuitem's associated file * The menuitem's associated file
*/ */
_initMenuItemWithFile: function(aMenuItem, aFile) { _initMenuItemWithFile: function(aMenuItem, aFile) {
aMenuItem.setAttribute("label", this._getFileDisplayName(aFile)); this._contentSandbox.menuitem = aMenuItem;
aMenuItem.setAttribute("image", this._getFileIconURL(aFile)); this._contentSandbox.label = this._getFileDisplayName(aFile);
aMenuItem.file = aFile; this._contentSandbox.image = this._getFileIconURL(aFile);
var codeStr = "menuitem.setAttribute('label', label); " +
"menuitem.setAttribute('image', image);"
Cu.evalInSandbox(codeStr, this._contentSandbox);
}, },
/** /**
@@ -726,8 +745,8 @@ FeedWriter.prototype = {
fp.appendFilters(Ci.nsIFilePicker.filterApps); fp.appendFilters(Ci.nsIFilePicker.filterApps);
if (fp.show() == Ci.nsIFilePicker.returnOK) { if (fp.show() == Ci.nsIFilePicker.returnOK) {
var selectedApp = fp.file; this._selectedApp = fp.file;
if (selectedApp) { if (this._selectedApp) {
// XXXben - we need to compare this with the running instance executable // XXXben - we need to compare this with the running instance executable
// just don't know how to do that via script... // just don't know how to do that via script...
// XXXmano TBD: can probably add this to nsIShellService // XXXmano TBD: can probably add this to nsIShellService
@@ -740,12 +759,13 @@ FeedWriter.prototype = {
#expand if (fp.file.leafName != "__MOZ_APP_NAME__-bin") { #expand if (fp.file.leafName != "__MOZ_APP_NAME__-bin") {
#endif #endif
#endif #endif
var selectedAppMenuItem = this.selectedApplicationItemWrapped; this._initMenuItemWithFile(this._contentSandbox.selectedAppMenuItem,
this._initMenuItemWithFile(selectedAppMenuItem, selectedApp); this._selectedApp);
// Show and select the selected application menuitem // Show and select the selected application menuitem
selectedAppMenuItem.hidden = false; var codeStr = "selectedAppMenuItem.hidden = false;" +
this._safeDoCommand(selectedAppMenuItem); "selectedAppMenuItem.doCommand();"
Cu.evalInSandbox(codeStr, this._contentSandbox);
return true; return true;
} }
} }
@@ -772,8 +792,7 @@ FeedWriter.prototype = {
}, },
_setSubscribeUsingLabel: function FW__setSubscribeUsingLabel() { _setSubscribeUsingLabel: function FW__setSubscribeUsingLabel() {
var stringLabel = null; var stringLabel = "subscribeFeedUsing";
switch (this._getFeedType()) { switch (this._getFeedType()) {
case Ci.nsIFeed.TYPE_VIDEO: case Ci.nsIFeed.TYPE_VIDEO:
stringLabel = "subscribeVideoPodcastUsing"; stringLabel = "subscribeVideoPodcastUsing";
@@ -782,13 +801,13 @@ FeedWriter.prototype = {
case Ci.nsIFeed.TYPE_AUDIO: case Ci.nsIFeed.TYPE_AUDIO:
stringLabel = "subscribeAudioPodcastUsing"; stringLabel = "subscribeAudioPodcastUsing";
break; break;
default:
stringLabel = "subscribeFeedUsing";
} }
var subscribeUsing = this._document.getElementById("subscribeUsingDescription"); this._contentSandbox.subscribeUsing =
subscribeUsing.setAttribute("value", this._getString(stringLabel)); this._document.getElementById("subscribeUsingDescription");
this._contentSandbox.label = this._getString(stringLabel);
var codeStr = "subscribeUsing.setAttribute('value', label);"
Cu.evalInSandbox(codeStr, this._contentSandbox);
}, },
_setAlwaysUseLabel: function FW__setAlwaysUseLabel() { _setAlwaysUseLabel: function FW__setAlwaysUseLabel() {
@@ -798,7 +817,7 @@ FeedWriter.prototype = {
if (handlersMenuList) { if (handlersMenuList) {
var handlerName = this._getSelectedItemFromMenulist(handlersMenuList) var handlerName = this._getSelectedItemFromMenulist(handlersMenuList)
.getAttribute("label"); .getAttribute("label");
var stringlabel = null; var stringLabel = "alwaysUseForFeeds";
switch (this._getFeedType()) { switch (this._getFeedType()) {
case Ci.nsIFeed.TYPE_VIDEO: case Ci.nsIFeed.TYPE_VIDEO:
stringlabel = "alwaysUseForVideoPodcasts"; stringlabel = "alwaysUseForVideoPodcasts";
@@ -807,12 +826,13 @@ FeedWriter.prototype = {
case Ci.nsIFeed.TYPE_AUDIO: case Ci.nsIFeed.TYPE_AUDIO:
stringlabel = "alwaysUseForAudioPodcasts"; stringlabel = "alwaysUseForAudioPodcasts";
break; break;
default:
stringlabel = "alwaysUseForFeeds";
} }
checkbox.setAttribute("label", this._getFormattedString(stringlabel, [handlerName])); this._contentSandbox.checkbox = checkbox;
this._contentSandbox.label = this._getFormattedString(stringlabel, [handlerName]);
var codeStr = "checkbox.setAttribute('label', label);";
Cu.evalInSandbox(codeStr, this._contentSandbox);
} }
} }
}, },
@@ -883,27 +903,29 @@ FeedWriter.prototype = {
break; break;
} }
case "client": { case "client": {
var selectedAppMenuItem = this.selectedApplicationItemWrapped; try {
if (selectedAppMenuItem) { this._selectedApp =
try { prefs.getComplexValue(getPrefAppForType(feedType), Ci.nsILocalFile);
var selectedApp = prefs.getComplexValue(getPrefAppForType(feedType), }
Ci.nsILocalFile); catch(ex) {
} catch(ex) { } this._selectedApp = null;
}
if (selectedApp) { if (this._selectedApp) {
this._initMenuItemWithFile(selectedAppMenuItem, selectedApp); this._initMenuItemWithFile(this._contentSandbox.selectedAppMenuItem,
selectedAppMenuItem.hidden = false; this._selectedApp);
this._safeDoCommand(selectedAppMenuItem); var codeStr = "selectedAppMenuItem.hidden = false; " +
"selectedAppMenuItem.doCommand(); ";
// Only show the default reader menuitem if the default reader // Only show the default reader menuitem if the default reader
// isn't the selected application // isn't the selected application
var defaultHandlerMenuItem = this.defaultSystemReaderItemWrapped; if (this._defaultSystemReader) {
if (defaultHandlerMenuItem) { var shouldHide =
defaultHandlerMenuItem.hidden = this._defaultSystemReader.path == this._selectedApp.path;
defaultHandlerMenuItem.file.path == selectedApp.path; codeStr += "defaultHandlerMenuItem.hidden = " + shouldHide + ";"
}
break;
} }
Cu.evalInSandbox(codeStr, this._contentSandbox);
break;
} }
} }
case "bookmarks": case "bookmarks":
@@ -921,79 +943,92 @@ FeedWriter.prototype = {
return; return;
var feedType = this._getFeedType(); var feedType = this._getFeedType();
var codeStr;
// change the background // change the background
var header = this._document.getElementById("feedHeader"); var header = this._document.getElementById("feedHeader");
this._contentSandbox.header = header;
switch (feedType) { switch (feedType) {
case Ci.nsIFeed.TYPE_VIDEO: case Ci.nsIFeed.TYPE_VIDEO:
header.setAttribute("class", "videoPodcastBackground"); codeStr = "header.className = 'videoPodcastBackground'; ";
break; break;
case Ci.nsIFeed.TYPE_AUDIO: case Ci.nsIFeed.TYPE_AUDIO:
header.setAttribute("class", "audioPodcastBackground"); codeStr = "header.className = 'audioPodcastBackground'; ";
break; break;
default: default:
header.setAttribute("class", "feedBackground"); codeStr = "header.className = 'feedBackground'; ";
header.className = "feedBackground";
} }
// Last-selected application // Last-selected application
var selectedApp;
var menuItem = this._document.createElementNS(XUL_NS, "menuitem"); var menuItem = this._document.createElementNS(XUL_NS, "menuitem");
menuItem.id = "selectedAppMenuItem"; menuItem.id = "selectedAppMenuItem";
menuItem.className = "menuitem-iconic"; menuItem.className = "menuitem-iconic";
menuItem.setAttribute("handlerType", "client"); menuItem.setAttribute("handlerType", "client");
handlersMenuPopup.appendChild(menuItem);
var selectedApplicationItem = this.selectedApplicationItemWrapped;
try { try {
var prefs = Cc["@mozilla.org/preferences-service;1"]. var prefs = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch); getService(Ci.nsIPrefBranch);
selectedApp = prefs.getComplexValue(getPrefAppForType(feedType), this._selectedApp = prefs.getComplexValue(getPrefAppForType(feedType),
Ci.nsILocalFile); Ci.nsILocalFile);
if (selectedApp.exists()) if (this._selectedApp.exists())
this._initMenuItemWithFile(selectedApplicationItem, selectedApp); this._initMenuItemWithFile(menuItem, this._selectedApp);
else { else {
// Hide the menuitem if the last selected application doesn't exist // Hide the menuitem if the last selected application doesn't exist
selectedApplicationItem.hidden = true; menuItem.setAttribute("hidden", true);
} }
} }
catch(ex) { catch(ex) {
// Hide the menuitem until an application is selected // Hide the menuitem until an application is selected
selectedApplicationItem.hidden = true; menuItem.setAttribute("hidden", true);
} }
this._contentSandbox.handlersMenuPopup = handlersMenuPopup;
this._contentSandbox.selectedAppMenuItem = menuItem;
codeStr += "handlersMenuPopup.appendChild(selectedAppMenuItem); ";
// List the default feed reader // List the default feed reader
var defaultReader = null;
try { try {
var defaultReader = Cc["@mozilla.org/browser/shell-service;1"]. this._defaultSystemReader = Cc["@mozilla.org/browser/shell-service;1"].
getService(Ci.nsIShellService).defaultFeedReader; getService(Ci.nsIShellService).
defaultFeedReader;
menuItem = this._document.createElementNS(XUL_NS, "menuitem"); menuItem = this._document.createElementNS(XUL_NS, "menuitem");
menuItem.id = "defaultHandlerMenuItem"; menuItem.id = "defaultHandlerMenuItem";
menuItem.className = "menuitem-iconic"; menuItem.className = "menuitem-iconic";
menuItem.setAttribute("handlerType", "client"); menuItem.setAttribute("handlerType", "client");
handlersMenuPopup.appendChild(menuItem);
var defaultSystemReaderItem = this.defaultSystemReaderItemWrapped; this._initMenuItemWithFile(menuItem, this._defaultSystemReader);
this._initMenuItemWithFile(defaultSystemReaderItem, defaultReader);
// Hide the default reader item if it points to the same application // Hide the default reader item if it points to the same application
// as the last-selected application // as the last-selected application
if (selectedApp && selectedApp.path == defaultReader.path) if (this._selectedApp &&
defaultSystemReaderItem.hidden = true; this._selectedApp.path == this._defaultSystemReader.path)
menuItem.hidden = true;
}
catch(ex) { menuItem = null; /* no default reader */ }
if (menuItem) {
this._contentSandbox.defaultHandlerMenuItem = menuItem;
codeStr += "handlersMenuPopup.appendChild(defaultHandlerMenuItem); ";
} }
catch(ex) { /* no default reader */ }
// "Choose Application..." menuitem // "Choose Application..." menuitem
menuItem = this._document.createElementNS(XUL_NS, "menuitem"); menuItem = this._document.createElementNS(XUL_NS, "menuitem");
menuItem.id = "chooseApplicationMenuItem"; menuItem.id = "chooseApplicationMenuItem";
menuItem.setAttribute("label", this._getString("chooseApplicationMenuItem")); menuItem.setAttribute("label", this._getString("chooseApplicationMenuItem"));
handlersMenuPopup.appendChild(menuItem);
this._contentSandbox.chooseAppMenuItem = menuItem;
codeStr += "handlersMenuPopup.appendChild(chooseAppMenuItem); ";
// separator // separator
handlersMenuPopup.appendChild(this._document.createElementNS(XUL_NS, this._contentSandbox.chooseAppSep =
"menuseparator")); this._document.createElementNS(XUL_NS, "menuseparator")
codeStr += "handlersMenuPopup.appendChild(chooseAppSep); ";
Cu.evalInSandbox(codeStr, this._contentSandbox);
var historySvc = Cc["@mozilla.org/browser/nav-history-service;1"]. var historySvc = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService); getService(Ci.nsINavHistoryService);
@@ -1010,7 +1045,9 @@ FeedWriter.prototype = {
menuItem.setAttribute("label", handlers[i].name); menuItem.setAttribute("label", handlers[i].name);
menuItem.setAttribute("handlerType", "web"); menuItem.setAttribute("handlerType", "web");
menuItem.setAttribute("webhandlerurl", handlers[i].uri); menuItem.setAttribute("webhandlerurl", handlers[i].uri);
handlersMenuPopup.appendChild(menuItem); this._contentSandbox.menuItem = menuItem;
codeStr = "handlersMenuPopup.appendChild(menuItem);";
Cu.evalInSandbox(codeStr, this._contentSandbox);
// For privacy reasons we cannot set the image attribute directly // For privacy reasons we cannot set the image attribute directly
// to the icon url, see Bug 358878 // to the icon url, see Bug 358878
@@ -1022,6 +1059,7 @@ FeedWriter.prototype = {
} }
} }
} }
this._contentSandbox.menuItem = null;
} }
this._setSelectedHandler(feedType); this._setSelectedHandler(feedType);
@@ -1049,39 +1087,32 @@ FeedWriter.prototype = {
} }
catch (ex) { } catch (ex) { }
if (showFirstRunUI) { if (showFirstRunUI) {
var feedHeader = this._document.getElementById("feedHeader"); var textfeedinfo1, textfeedinfo2;
if (feedHeader) { switch (feedType) {
var textfeedinfo1 = null; case Ci.nsIFeed.TYPE_VIDEO:
switch (this._getFeedType()) { textfeedinfo1 = "feedSubscriptionVideoPodcast1";
case Ci.nsIFeed.TYPE_VIDEO: textfeedinfo2 = "feedSubscriptionVideoPodcast2";
textfeedinfo1 = "feedSubscriptionVideoPodcast1"; break;
break; case Ci.nsIFeed.TYPE_AUDIO:
case Ci.nsIFeed.TYPE_AUDIO: textfeedinfo1 = "feedSubscriptionAudioPodcast1";
textfeedinfo1 = "feedSubscriptionAudioPodcast1"; textfeedinfo2 = "feedSubscriptionAudioPodcast2";
break; break;
default: default:
textfeedinfo1 = "feedSubscriptionFeed1"; textfeedinfo1 = "feedSubscriptionFeed1";
} textfeedinfo2 = "feedSubscriptionFeed2";
var feedinfo1 = this._document.getElementById("feedSubscriptionInfo1")
feedinfo1.setAttribute("value", this._getString(textfeedinfo1));
var textfeedinfo2 = null;
switch (this._getFeedType()) {
case Ci.nsIFeed.TYPE_VIDEO:
textfeedinfo2 = "feedSubscriptionVideoPodcast2";
break;
case Ci.nsIFeed.TYPE_AUDIO:
textfeedinfo2 = "feedSubscriptionAudioPodcast2";
break;
default:
textfeedinfo2 = "feedSubscriptionFeed2";
}
var feedinfo2 = this._document.getElementById("feedSubscriptionInfo2")
feedinfo2.setAttribute("value", this._getString(textfeedinfo2));
feedHeader.setAttribute("firstrun", "true");
} }
this._contentSandbox.feedinfo1 =
this._document.getElementById("feedSubscriptionInfo1");
this._contentSandbox.feedinfo1Str = this._getString(textfeedinfo1);
this._contentSandbox.feedinfo2 =
this._document.getElementById("feedSubscriptionInfo2");
this._contentSandbox.feedinfo2Str = this._getString(textfeedinfo2);
this._contentSandbox.header = header;
codeStr = "feedinfo1.value = feedinfo1Str; " +
"feedinfo2.value = feedinfo2Str; " +
"header.setAttribute('firstrun', 'true');"
Cu.evalInSandbox(codeStr, this._contentSandbox);
prefs.setBoolPref(PREF_SHOW_FIRST_RUN_UI, false); prefs.setBoolPref(PREF_SHOW_FIRST_RUN_UI, false);
} }
}, },
@@ -1198,9 +1229,9 @@ FeedWriter.prototype = {
this._removeFeedFromCache(); this._removeFeedFromCache();
this.__faviconService = null; this.__faviconService = null;
this.__bundle = null; this.__bundle = null;
this._selectedApplicationItemWrapped = null;
this._defaultSystemReaderItemWrapped = null;
this._feedURI = null; this._feedURI = null;
this.__contentSandbox = null;
var historySvc = Cc["@mozilla.org/browser/nav-history-service;1"]. var historySvc = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService); getService(Ci.nsINavHistoryService);
historySvc.removeObserver(this); historySvc.removeObserver(this);
@@ -1262,12 +1293,12 @@ FeedWriter.prototype = {
case "selectedAppMenuItem": case "selectedAppMenuItem":
prefs.setCharPref(getPrefReaderForType(feedType), "client"); prefs.setCharPref(getPrefReaderForType(feedType), "client");
prefs.setComplexValue(getPrefAppForType(feedType), Ci.nsILocalFile, prefs.setComplexValue(getPrefAppForType(feedType), Ci.nsILocalFile,
this.selectedApplicationItemWrapped.file); this._selectedApp);
break; break;
case "defaultHandlerMenuItem": case "defaultHandlerMenuItem":
prefs.setCharPref(getPrefReaderForType(feedType), "client"); prefs.setCharPref(getPrefReaderForType(feedType), "client");
prefs.setComplexValue(getPrefAppForType(feedType), Ci.nsILocalFile, prefs.setComplexValue(getPrefAppForType(feedType), Ci.nsILocalFile,
this.defaultSystemReaderItemWrapped.file); this._defaultSystemReader);
break; break;
case "liveBookmarksMenuItem": case "liveBookmarksMenuItem":
defaultHandler = "bookmarks"; defaultHandler = "bookmarks";
@@ -1349,7 +1380,14 @@ FeedWriter.prototype = {
if (bytes) { if (bytes) {
var dataURI = "data:" + mimeType.value + ";" + "base64," + var dataURI = "data:" + mimeType.value + ";" + "base64," +
btoa(String.fromCharCode.apply(null, bytes)); btoa(String.fromCharCode.apply(null, bytes));
aMenuItem.setAttribute("image", dataURI);
this._contentSandbox.menuItem = aMenuItem;
this._contentSandbox.dataURI = dataURI;
var codeStr = "menuItem.setAttribute('image', dataURI);";
Cu.evalInSandbox(codeStr, this._contentSandbox);
this._contentSandbox.menuItem = null;
this._contentSandbox.dataURI = null;
return true; return true;
} }
} }

View File

@@ -214,7 +214,7 @@ BrowserGlue.prototype = {
distro.applyCustomizations(); distro.applyCustomizations();
// handle any UI migration // handle any UI migration
// this._migrateUI(); this._migrateUI();
}, },
// profile shutdown handler (contains profile cleanup routines) // profile shutdown handler (contains profile cleanup routines)

View File

@@ -66,7 +66,7 @@ interface nsIPlacesImportExportService: nsISupports
void exportHTMLToFile(in nsILocalFile aFile); void exportHTMLToFile(in nsILocalFile aFile);
/** /**
* Backup and archive the bookmarks.html file. * Backup the bookmarks.html file.
*/ */
void backupBookmarksFile(); void backupBookmarksFile();
}; };

View File

@@ -2482,120 +2482,3 @@ nsPlacesImportExportService::BackupBookmarksFile()
return NS_OK; return NS_OK;
} }
/**
* ArchiveBookmarksFile()
*
* Creates a dated backup once a day in <profile>/bookmarkbackups
*
* PRInt32 numberOfBackups - the maximum number of backups to keep
*
* PRBool forceArchive - forces creating an archive even if one was
* already created that day (overwrites)
*/
nsresult
nsPlacesImportExportService::ArchiveBookmarksFile(PRInt32 numberOfBackups,
PRBool forceArchive)
{
nsCOMPtr<nsIFile> bookmarksBackupDir;
nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
getter_AddRefs(bookmarksBackupDir));
NS_ENSURE_SUCCESS(rv, rv);
nsDependentCString dirName("bookmarkbackups");
rv = bookmarksBackupDir->AppendNative(dirName);
NS_ENSURE_SUCCESS(rv, rv);
PRBool exists;
rv = bookmarksBackupDir->Exists(&exists);
if (NS_FAILED(rv) || !exists) {
rv = bookmarksBackupDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
// if there's no backup folder, there's no backup, fail
NS_ENSURE_SUCCESS(rv, rv);
}
// construct the new leafname
PRTime now64 = PR_Now();
PRExplodedTime nowInfo;
PR_ExplodeTime(now64, PR_LocalTimeParameters, &nowInfo);
PR_NormalizeTime(&nowInfo, PR_LocalTimeParameters);
char timeString[128];
// Use YYYY-MM-DD (ISO 8601) as it doesn't contain illegal characters
// and makes the alphabetical order of multiple backup files more useful.
PR_FormatTime(timeString, 128, "bookmarks-%Y-%m-%d.html", &nowInfo);
nsAutoString backupFilenameString = NS_ConvertUTF8toUTF16((timeString));
nsCOMPtr<nsIFile> backupFile;
if (forceArchive) {
// if we have a backup from today, nuke it
nsCOMPtr<nsIFile> currentBackup;
rv = bookmarksBackupDir->Clone(getter_AddRefs(currentBackup));
NS_ENSURE_SUCCESS(rv, rv);
rv = currentBackup->Append(backupFilenameString);
NS_ENSURE_SUCCESS(rv, rv);
rv = currentBackup->Exists(&exists);
if (NS_SUCCEEDED(rv) && exists) {
rv = currentBackup->Remove(PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
}
} else {
nsCOMPtr<nsISimpleEnumerator> existingBackups;
rv = bookmarksBackupDir->GetDirectoryEntries(getter_AddRefs(existingBackups));
NS_ENSURE_SUCCESS(rv, rv);
nsStringArray backupFileNames;
PRBool hasMoreElements = PR_FALSE;
PRBool hasCurrentBackup = PR_FALSE;
while (NS_SUCCEEDED(existingBackups->HasMoreElements(&hasMoreElements)) &&
hasMoreElements)
{
rv = existingBackups->GetNext(getter_AddRefs(backupFile));
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString backupName;
rv = backupFile->GetLeafName(backupName);
NS_ENSURE_SUCCESS(rv, rv);
// the backup for today exists, do not create later
if (backupName == backupFilenameString) {
hasCurrentBackup = PR_TRUE;
continue;
}
// mark the rest for possible removal
if (Substring(backupName, 0, 10) == NS_LITERAL_STRING("bookmarks-"))
backupFileNames.AppendString(backupName);
}
if (numberOfBackups > 0 && backupFileNames.Count() >= numberOfBackups) {
PRInt32 numberOfBackupsToDelete = backupFileNames.Count() - numberOfBackups + 1;
backupFileNames.Sort();
while (numberOfBackupsToDelete--) {
(void)bookmarksBackupDir->Clone(getter_AddRefs(backupFile));
(void)backupFile->Append(*backupFileNames[0]);
(void)backupFile->Remove(PR_FALSE);
backupFileNames.RemoveStringAt(0);
}
}
if (hasCurrentBackup)
return NS_OK;
}
nsCOMPtr<nsIFile> bookmarksFile;
rv = NS_GetSpecialDirectory(NS_APP_BOOKMARKS_50_FILE,
getter_AddRefs(bookmarksFile));
NS_ENSURE_SUCCESS(rv, rv);
rv = bookmarksFile->CopyTo(bookmarksBackupDir, backupFilenameString);
// at least dump something out in case this fails in a debug build
NS_ENSURE_SUCCESS(rv, rv);
return rv;
}

View File

@@ -48,8 +48,6 @@ class nsPlacesImportExportService : public nsIPlacesImportExportService,
nsresult WriteSeparator(nsINavHistoryResultNode* aItem, const nsACString& aIndent, nsIOutputStream* aOutput); nsresult WriteSeparator(nsINavHistoryResultNode* aItem, const nsACString& aIndent, nsIOutputStream* aOutput);
nsresult WriteDescription(PRInt64 aId, PRInt32 aType, nsIOutputStream* aOutput); nsresult WriteDescription(PRInt64 aId, PRInt32 aType, nsIOutputStream* aOutput);
nsresult ArchiveBookmarksFile(PRInt32 aNumberOfBackups, PRBool aForceArchive);
inline nsresult EnsureServiceState() { inline nsresult EnsureServiceState() {
NS_ENSURE_STATE(mHistoryService); NS_ENSURE_STATE(mHistoryService);
NS_ENSURE_STATE(mFaviconService); NS_ENSURE_STATE(mFaviconService);

View File

@@ -45,10 +45,13 @@
<prefwindow id="AdvancedJSDialog" type="child" <prefwindow id="AdvancedJSDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&advancedJSDialog.title;" title="&advancedJSDialog.title;"
dlgbuttons="accept,cancel,help"> dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()">
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<prefpane id="AdvancedJSDialogPane" <prefpane id="AdvancedJSDialogPane"
helpTopic="prefs-advanced-javascript" helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-advanced-javascript">
<preferences> <preferences>
<preference id="dom.event.contextmenu.enabled" name="dom.event.contextmenu.enabled" type="bool"/> <preference id="dom.event.contextmenu.enabled" name="dom.event.contextmenu.enabled" type="bool"/>

View File

@@ -52,8 +52,7 @@
<overlay id="AdvancedPaneOverlay" <overlay id="AdvancedPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();" <prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();">
helpURI="chrome://browser/locale/help/help.rdf">
<preferences id="advancedPreferences"> <preferences id="advancedPreferences">
<preference id="browser.preferences.advanced.selectedTabIndex" <preference id="browser.preferences.advanced.selectedTabIndex"

View File

@@ -53,8 +53,10 @@
<overlay id="ApplicationsPaneOverlay" <overlay id="ApplicationsPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneApplications" onpaneload="gApplicationsPane.init();" flex="1" <prefpane id="paneApplications"
helpTopic="prefs-applications" helpURI="chrome://browser/locale/help/help.rdf"> onpaneload="gApplicationsPane.init();"
flex="1"
helpTopic="prefs-applications">
<preferences id="feedsPreferences"> <preferences id="feedsPreferences">
<preference id="browser.feeds.handler" <preference id="browser.feeds.handler"

View File

@@ -49,14 +49,16 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&colorsDialog.title;" title="&colorsDialog.title;"
dlgbuttons="accept,cancel,help" dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()"
#ifdef XP_MACOSX #ifdef XP_MACOSX
style="width: &window.macWidth; !important;"> style="width: &window.macWidth; !important;">
#else #else
style="width: &window.width; !important;"> style="width: &window.width; !important;">
#endif #endif
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<prefpane id="ColorsDialogPane" <prefpane id="ColorsDialogPane"
helpTopic="prefs-fonts-and-colors" helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-fonts-and-colors">
<preferences> <preferences>
<preference id="browser.display.use_document_colors" name="browser.display.use_document_colors" type="bool"/> <preference id="browser.display.use_document_colors" name="browser.display.use_document_colors" type="bool"/>

View File

@@ -48,14 +48,17 @@
dlgbuttons="accept,cancel,help" dlgbuttons="accept,cancel,help"
onbeforeaccept="return gConnectionsDialog.beforeAccept();" onbeforeaccept="return gConnectionsDialog.beforeAccept();"
onload="gConnectionsDialog.checkForSystemProxy();" onload="gConnectionsDialog.checkForSystemProxy();"
ondialoghelp="openPrefsHelp()"
#ifdef XP_MACOSX #ifdef XP_MACOSX
style="width: &window.macWidth; !important;"> style="width: &window.macWidth; !important;">
#else #else
style="width: &window.width; !important;"> style="width: &window.width; !important;">
#endif #endif
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<prefpane id="ConnectionsDialogPane" <prefpane id="ConnectionsDialogPane"
helpTopic="prefs-connection-settings" helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-connection-settings">
<preferences> <preferences>
<preference id="network.proxy.type" name="network.proxy.type" type="int" onchange="gConnectionsDialog.proxyTypeChanged();"/> <preference id="network.proxy.type" name="network.proxy.type" type="int" onchange="gConnectionsDialog.proxyTypeChanged();"/>

View File

@@ -49,8 +49,9 @@
<overlay id="ContentPaneOverlay" <overlay id="ContentPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneContent" onpaneload="gContentPane.init();" <prefpane id="paneContent"
helpTopic="prefs-content" helpURI="chrome://browser/locale/help/help.rdf"> onpaneload="gContentPane.init();"
helpTopic="prefs-content">
<preferences id="contentPreferences"> <preferences id="contentPreferences">
<!--XXX buttons prefs --> <!--XXX buttons prefs -->

View File

@@ -52,6 +52,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&fontsDialog.title;" title="&fontsDialog.title;"
dlgbuttons="accept,cancel,help" dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()"
#ifdef XP_UNIX #ifdef XP_UNIX
#ifdef XP_MACOSX #ifdef XP_MACOSX
style="width: &window.macWidth; !important;"> style="width: &window.macWidth; !important;">
@@ -62,8 +63,10 @@
style="width: &window.width; !important;"> style="width: &window.width; !important;">
#endif #endif
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<prefpane id="FontsDialogPane" <prefpane id="FontsDialogPane"
helpTopic="prefs-fonts-and-colors" helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-fonts-and-colors">
<preferences id="fontPreferences"> <preferences id="fontPreferences">
<preference id="font.language.group" name="font.language.group" type="wstring"/> <preference id="font.language.group" name="font.language.group" type="wstring"/>

View File

@@ -50,10 +50,14 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&languages.customize.Header;" title="&languages.customize.Header;"
dlgbuttons="accept,cancel,help" dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()"
style="width: &window.width;;"> style="width: &window.width;;">
<prefpane id="LanguagesDialogPane" onpaneload="gLanguagesDialog.init();" <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
helpTopic="prefs-languages" helpURI="chrome://browser/locale/help/help.rdf">
<prefpane id="LanguagesDialogPane"
onpaneload="gLanguagesDialog.init();"
helpTopic="prefs-languages">
<preferences> <preferences>
<preference id="intl.accept_languages" name="intl.accept_languages" type="wstring"/> <preference id="intl.accept_languages" name="intl.accept_languages" type="wstring"/>

View File

@@ -50,8 +50,9 @@
<overlay id="MainPaneOverlay" <overlay id="MainPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneMain" onpaneload="gMainPane.init();" <prefpane id="paneMain"
helpTopic="prefs-main" helpURI="chrome://browser/locale/help/help.rdf"> onpaneload="gMainPane.init();"
helpTopic="prefs-main">
<script type="application/x-javascript" src="chrome://browser/content/preferences/main.js"/> <script type="application/x-javascript" src="chrome://browser/content/preferences/main.js"/>

View File

@@ -72,6 +72,7 @@
<prefwindow type="prefwindow" <prefwindow type="prefwindow"
id="BrowserPreferences" id="BrowserPreferences"
windowtype="Browser:Preferences" windowtype="Browser:Preferences"
ondialoghelp="openPrefsHelp()"
#ifdef USE_WIN_TITLE_STYLE #ifdef USE_WIN_TITLE_STYLE
title="&prefWindow.titleWin;" title="&prefWindow.titleWin;"
#else #else
@@ -92,6 +93,8 @@
#endif #endif
#endif #endif
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/> <stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
<stringbundle id="bundlePreferences" <stringbundle id="bundlePreferences"
src="chrome://browser/locale/preferences/preferences.properties"/> src="chrome://browser/locale/preferences/preferences.properties"/>

View File

@@ -49,9 +49,9 @@
<overlay id="PrivacyPaneOverlay" <overlay id="PrivacyPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="panePrivacy" onpaneload="gPrivacyPane.init();" <prefpane id="panePrivacy"
helpTopic="prefs-privacy" onpaneload="gPrivacyPane.init();"
helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-privacy">
<preferences id="privacyPreferences"> <preferences id="privacyPreferences">

View File

@@ -50,10 +50,13 @@
<prefwindow id="SanitizeDialog" type="child" <prefwindow id="SanitizeDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
dlgbuttons="accept,cancel,help" dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()"
title="&sanitizeDialog.title;"> title="&sanitizeDialog.title;">
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<prefpane id="SanitizeDialogPane" <prefpane id="SanitizeDialogPane"
helpTopic="prefs-clear-private-data" helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-clear-private-data">
<preferences> <preferences>
<preference id="privacy.item.history" name="privacy.item.history" type="bool"/> <preference id="privacy.item.history" name="privacy.item.history" type="bool"/>

View File

@@ -47,8 +47,9 @@
<overlay id="SecurityPaneOverlay" <overlay id="SecurityPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneSecurity" onpaneload="gSecurityPane.init();" <prefpane id="paneSecurity"
helpTopic="prefs-security" helpURI="chrome://browser/locale/help/help.rdf"> onpaneload="gSecurityPane.init();"
helpTopic="prefs-security">
<preferences id="securityPreferences"> <preferences id="securityPreferences">
<!-- XXX buttons --> <!-- XXX buttons -->

View File

@@ -49,7 +49,8 @@
<overlay id="TabsPaneOverlay" <overlay id="TabsPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneTabs" helpTopic="prefs-tabs" helpURI="chrome://browser/locale/help/help.rdf"> <prefpane id="paneTabs"
helpTopic="prefs-tabs">
<preferences id="tabsPreferences"> <preferences id="tabsPreferences">
<preference id="browser.link.open_external" name="browser.link.open_external" type="int"/> <preference id="browser.link.open_external" name="browser.link.open_external" type="int"/>

View File

@@ -44,4 +44,8 @@ include $(DEPTH)/config/autoconf.mk
DIRS = public src DIRS = public src
ifdef MOZ_MOCHITEST
DIRS += test
endif
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk

View File

@@ -365,7 +365,6 @@ WriteImage(const nsCString& aPath, gfxIImageFrame* aImage)
gboolean res = gdk_pixbuf_save(pixbuf, aPath.get(), "png", NULL, NULL); gboolean res = gdk_pixbuf_save(pixbuf, aPath.get(), "png", NULL, NULL);
aImage->UnlockImageData();
g_object_unref(pixbuf); g_object_unref(pixbuf);
return res ? NS_OK : NS_ERROR_FAILURE; return res ? NS_OK : NS_ERROR_FAILURE;
#endif #endif

View File

@@ -0,0 +1,51 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Sylvain Pasche.
# Portions created by the Initial Developer are Copyright (C) 2008
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = browser/components/shell/test
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_BROWSER_TEST_FILES = browser_420786.js \
$(NULL)
libs:: $(_BROWSER_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)

View File

@@ -0,0 +1,98 @@
const Ci = Components.interfaces;
const Cc = Components.classes;
const DG_BACKGROUND = "/desktop/gnome/background"
const DG_IMAGE_KEY = DG_BACKGROUND + "/picture_filename";
const DG_OPTION_KEY = DG_BACKGROUND + "/picture_options";
const DG_DRAW_BG_KEY = DG_BACKGROUND + "/draw_background";
var testPage;
function url(spec) {
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return ios.newURI(spec, null, null);
}
function onPageLoad() {
testPage.events.removeListener("load", onPageLoad);
var bs = Cc["@mozilla.org/intl/stringbundle;1"].
getService(Ci.nsIStringBundleService);
var brandName = bs.createBundle("chrome://branding/locale/brand.properties").
GetStringFromName("brandShortName");
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIDirectoryServiceProvider);
var homeDir = dirSvc.getFile("Home", {});
var wpFile = homeDir.clone();
wpFile.append(brandName + "_wallpaper.png");
// Backup the existing wallpaper so that this test doesn't change the user's
// settings.
var wpFileBackup = homeDir.clone()
wpFileBackup.append(brandName + "_wallpaper.png.backup");
if (wpFileBackup.exists())
wpFileBackup.remove(false);
if (wpFile.exists())
wpFile.copyTo(null, wpFileBackup.leafName);
var shell = Cc["@mozilla.org/browser/shell-service;1"].
getService(Ci.nsIShellService);
var gconf = Cc["@mozilla.org/gnome-gconf-service;1"].
getService(Ci.nsIGConfService);
var prevImageKey = gconf.getString(DG_IMAGE_KEY);
var prevOptionKey = gconf.getString(DG_OPTION_KEY);
var prevDrawBgKey = gconf.getBool(DG_DRAW_BG_KEY);
var image = testPage.document.getElementsByTagName("img")[0];
function checkWallpaper(position, expectedGConfPosition) {
shell.setDesktopBackground(image, position);
ok(wpFile.exists(), "Wallpaper was written to disk");
is(gconf.getString(DG_IMAGE_KEY), wpFile.path,
"Wallpaper file GConf key is correct");
is(gconf.getString(DG_OPTION_KEY), expectedGConfPosition,
"Wallpaper position GConf key is correct");
}
checkWallpaper(Ci.nsIShellService.BACKGROUND_TILE, "wallpaper");
checkWallpaper(Ci.nsIShellService.BACKGROUND_STRETCH, "stretched");
checkWallpaper(Ci.nsIShellService.BACKGROUND_CENTER, "centered");
checkWallpaper(Ci.nsIShellService.BACKGROUND_FILL, "centered");
// Restore GConf and wallpaper
gconf.setString(DG_IMAGE_KEY, prevImageKey);
gconf.setString(DG_OPTION_KEY, prevOptionKey);
gconf.setBool(DG_DRAW_BG_KEY, prevDrawBgKey);
wpFile.remove(false);
if (wpFileBackup.exists()) {
wpFileBackup.moveTo(null, wpFile.leafName);
}
testPage.close();
finish();
}
function test() {
var osString = Cc["@mozilla.org/xre/app-info;1"].
getService(Ci.nsIXULRuntime).OS;
// This test is Linux specific for now
if (osString != "Linux") {
finish();
return;
}
testPage = Application.activeWindow.open(url("about:blank"));
testPage.events.addListener("load", onPageLoad);
testPage.load(url("about:logo"));
testPage.focus();
waitForExplicitFinish();
}

View File

@@ -1,354 +1,50 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FUEL.
*
* The Initial Developer of the Original Code is Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mark Finkle <mfinkle@mozilla.com> (Original Author)
* John Resig <jresig@mozilla.com> (Original Author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl" #include "nsISupports.idl"
#include "extIApplication.idl"
interface nsIVariant; interface nsIVariant;
interface nsIURI; interface nsIURI;
interface nsIDOMHTMLDocument; interface nsIDOMHTMLDocument;
interface fuelIPreference;
interface fuelIBookmarkFolder; interface fuelIBookmarkFolder;
interface fuelIBrowserTab; interface fuelIBrowserTab;
/**
* Interface that gives simplified access to the console
*/
[scriptable, uuid(ae8482e0-aa5a-11db-abbd-0800200c9a66)]
interface fuelIConsole : nsISupports
{
/**
* Sends a given string to the console.
* @param aMsg
* The text to send to the console
*/
void log(in AString aMsg);
/**
* Opens the error console window. The console window
* is focused if already open.
*/
void open();
};
/**
* Interface holds information about an event.
*/
[scriptable, function, uuid(05281820-ab62-11db-abbd-0800200c9a66)]
interface fuelIEventItem : nsISupports
{
/**
* The name of the event
*/
readonly attribute AString type;
/**
* Can hold extra details and data associated with the event. This
* is optional and event specific. If the event does not send extra
* details, this is null.
*/
readonly attribute AString data;
/**
* Cancels the event if it is cancelable.
*/
void preventDefault();
};
/**
* Interface used as a callback for listening to events.
*/
[scriptable, function, uuid(2dfe3a50-ab2f-11db-abbd-0800200c9a66)]
interface fuelIEventListener : nsISupports
{
/**
* This method is called whenever an event occurs of the type for which
* the fuelIEventListener interface was registered.
*
* @param aEvent
* The fuelIEventItem associated with the event.
*/
void handleEvent(in fuelIEventItem aEvent);
};
/**
* Interface for supporting custom events.
*/
[scriptable, uuid(3a8ec9d0-ab19-11db-abbd-0800200c9a66)]
interface fuelIEvents : nsISupports
{
/**
* Adds an event listener to the list. If multiple identical event listeners
* are registered on the same event target with the same parameters the
* duplicate instances are discarded. They do not cause the EventListener
* to be called twice and since they are discarded they do not need to be
* removed with the removeListener method.
*
* @param aEvent
* The name of an event
* @param aListener
* The reference to a listener
*/
void addListener(in AString aEvent, in fuelIEventListener aListener);
/**
* Removes an event listener from the list. Calling remove
* with arguments which do not identify any currently registered
* event listener has no effect.
* @param aEvent
* The name of an event
* @param aListener
* The reference to a listener
*/
void removeListener(in AString aEvent, in fuelIEventListener aListener);
};
/**
* Interface for simplified access to preferences. The interface has a
* predefined root preference branch. The root branch is set based on the
* context of the owner. For example, an extension's preferences have a root
* of "extensions.<extensionid>.", while the application level preferences
* have an empty root. All preference "aName" parameters used in this interface
* are relative to the root branch.
*/
[scriptable, uuid(ce697d40-aa5a-11db-abbd-0800200c9a66)]
interface fuelIPreferenceBranch : nsISupports
{
/**
* The name of the branch root.
*/
readonly attribute AString root;
/**
* Array of fuelIPreference listing all preferences in this branch.
*/
readonly attribute nsIVariant all;
/**
* The events object for the preferences
* supports: "change"
*/
readonly attribute fuelIEvents events;
/**
* Check to see if a preference exists.
* @param aName
* The name of preference
* @returns true if the preference exists, false if not
*/
boolean has(in AString aName);
/**
* Gets an object representing a preference
* @param aName
* The name of preference
* @returns a preference object, or null if the preference does not exist
*/
fuelIPreference get(in AString aName);
/**
* Gets the value of a preference. Returns a default value if
* the preference does not exist.
* @param aName
* The name of preference
* @param aDefaultValue
* The value to return if preference does not exist
* @returns value of the preference or the given default value if preference
* does not exists.
*/
nsIVariant getValue(in AString aName, in nsIVariant aDefaultValue);
/**
* Sets the value of a storage item with the given name.
* @param aName
* The name of an item
* @param aValue
* The value to assign to the item
*/
void setValue(in AString aName, in nsIVariant aValue);
/**
* Resets all preferences in a branch back to their default values.
*/
void reset();
};
/**
* Interface for accessing a single preference. The data is not cached.
* All reads access the current state of the preference.
*/
[scriptable, uuid(2C7462E2-72C2-4473-9007-0E6AE71E23CA)]
interface fuelIPreference : nsISupports
{
/**
* The name of the preference.
*/
readonly attribute AString name;
/**
* A string representing the type of preference (String, Boolean, or Number).
*/
readonly attribute AString type;
/**
* Get/Set the value of the preference.
*/
attribute nsIVariant value;
/**
* Get the locked state of the preference. Set to a boolean value to (un)lock it.
*/
attribute boolean locked;
/**
* Check if a preference has been modified by the user, or not.
*/
readonly attribute boolean modified;
/**
* The preference branch that contains this preference.
*/
readonly attribute fuelIPreferenceBranch branch;
/**
* The events object for this preference.
* supports: "change"
*/
readonly attribute fuelIEvents events;
/**
* Resets a preference back to its default values.
*/
void reset();
};
/**
* Interface representing a simple storage system
*/
[scriptable, uuid(0787ac44-29b9-4889-b97f-13573aec6971)]
interface fuelISessionStorage : nsISupports
{
/**
* The events object for the storage
* supports: "change"
*/
readonly attribute fuelIEvents events;
/**
* Determines if a storage item exists with the given name.
* @param aName
* The name of an item
* @returns true if an item exists with the given name,
* false otherwise.
*/
boolean has(in AString aName);
/**
* Sets the value of a storage item with the given name.
* @param aName
* The name of an item
* @param aValue
* The value to assign to the item
*/
void set(in AString aName, in nsIVariant aValue);
/**
* Gets the value of a storage item with the given name. Returns a
* default value if the item does not exist.
* @param aName
* The name of an item
* @param aDefaultValue
* The value to return if no item exists with the given name
* @returns value of the item or the given default value if no item
* exists with the given name.
*/
nsIVariant get(in AString aName, in nsIVariant aDefaultValue);
};
/**
* Interface representing an extension
*/
[scriptable, uuid(10cee02c-f6e0-4d61-ab27-c16572b18c46)]
interface fuelIExtension : nsISupports
{
/**
* The id of the extension.
*/
readonly attribute AString id;
/**
* The name of the extension.
*/
readonly attribute AString name;
/**
* Check if the extension is currently enabled, or not.
*/
readonly attribute boolean enabled;
/**
* The version number of the extension.
*/
readonly attribute AString version;
/**
* Indicates whether this is the extension's first run after install
*/
readonly attribute boolean firstRun;
/**
* The preferences object for the extension. Defaults to the
* "extensions.<extensionid>." branch.
*/
readonly attribute fuelIPreferenceBranch prefs;
/**
* The storage object for the extension.
*/
readonly attribute fuelISessionStorage storage;
/**
* The events object for the extension.
* supports: "uninstall"
*/
readonly attribute fuelIEvents events;
};
/**
* Interface representing a list of all installed extensions
*/
[scriptable, uuid(de281930-aa5a-11db-abbd-0800200c9a66)]
interface fuelIExtensions : nsISupports
{
/**
* Array of fuelIExtension listing all extensions in the application.
*/
readonly attribute nsIVariant all;
/**
* Determines if an extension exists with the given id.
* @param aId
* The id of an extension
* @returns true if an extension exists with the given id,
* false otherwise.
*/
boolean has(in AString aId);
/**
* Gets a fuelIExtension object for an extension.
* @param aId
* The id of an extension
* @returns An extension object or null if no extension exists
* with the given id.
*/
fuelIExtension get(in AString aId);
};
/** /**
* Interface representing a collection of annotations associated * Interface representing a collection of annotations associated
* with a bookmark or bookmark folder. * with a bookmark or bookmark folder.
@@ -452,7 +148,7 @@ interface fuelIBookmark : nsISupports
* The events object for the bookmark. * The events object for the bookmark.
* supports: "remove", "change", "visit", "move" * supports: "remove", "change", "visit", "move"
*/ */
readonly attribute fuelIEvents events; readonly attribute extIEvents events;
/** /**
* Removes the item from the parent folder. Used to * Removes the item from the parent folder. Used to
@@ -504,7 +200,7 @@ interface fuelIBookmarkFolder : nsISupports
* The events object for the folder. * The events object for the folder.
* supports: "add", "addchild", "remove", "removechild", "change", "move" * supports: "add", "addchild", "remove", "removechild", "change", "move"
*/ */
readonly attribute fuelIEvents events; readonly attribute extIEvents events;
/** /**
* Array of all bookmarks, separators and folders contained * Array of all bookmarks, separators and folders contained
@@ -539,7 +235,6 @@ interface fuelIBookmarkFolder : nsISupports
void remove(); void remove();
}; };
/** /**
* Interface representing a container for bookmark roots. Roots * Interface representing a container for bookmark roots. Roots
* are the top level parents for the various types of bookmarks in the system. * are the top level parents for the various types of bookmarks in the system.
@@ -568,7 +263,6 @@ interface fuelIBookmarkRoots : nsISupports
readonly attribute fuelIBookmarkFolder unfiled; readonly attribute fuelIBookmarkFolder unfiled;
}; };
/** /**
* Interface representing a browser window. * Interface representing a browser window.
*/ */
@@ -596,7 +290,7 @@ interface fuelIWindow : nsISupports
* The events object for the browser window. * The events object for the browser window.
* supports: "TabOpen", "TabClose", "TabMove", "TabSelect" * supports: "TabOpen", "TabClose", "TabMove", "TabSelect"
*/ */
readonly attribute fuelIEvents events; readonly attribute extIEvents events;
}; };
/** /**
@@ -629,7 +323,7 @@ interface fuelIBrowserTab : nsISupports
* The events object for the browser tab. * The events object for the browser tab.
* supports: "load" * supports: "load"
*/ */
readonly attribute fuelIEvents events; readonly attribute extIEvents events;
/** /**
* Load a new URI into this browser tab. * Load a new URI into this browser tab.
@@ -662,56 +356,12 @@ interface fuelIBrowserTab : nsISupports
void moveToEnd(); void moveToEnd();
}; };
/** /**
* Interface for managing and accessing the applications systems * Interface for managing and accessing the applications systems
*/ */
[scriptable, uuid(fe74cf80-aa2d-11db-abbd-0800200c9a66)] [scriptable, uuid(fe74cf80-aa2d-11db-abbd-0800200c9a66)]
interface fuelIApplication : nsISupports interface fuelIApplication : extIApplication
{ {
/**
* The id of the application.
*/
readonly attribute AString id;
/**
* The name of the application.
*/
readonly attribute AString name;
/**
* The version number of the application.
*/
readonly attribute AString version;
/**
* The console object for the application.
*/
readonly attribute fuelIConsole console;
/**
* The extensions object for the application. Contains a list
* of all installed extensions.
*/
readonly attribute fuelIExtensions extensions;
/**
* The preferences object for the application. Defaults to an empty
* root branch.
*/
readonly attribute fuelIPreferenceBranch prefs;
/**
* The storage object for the application.
*/
readonly attribute fuelISessionStorage storage;
/**
* The events object for the application.
* supports: "load", "ready", "quit", "unload"
*/
readonly attribute fuelIEvents events;
/** /**
* The root bookmarks object for the application. * The root bookmarks object for the application.
* Contains all the bookmark roots in the system. * Contains all the bookmark roots in the system.

View File

@@ -40,520 +40,6 @@ const Cc = Components.classes;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
//=================================================
// Shutdown - used to store cleanup functions which will
// be called on Application shutdown
var gShutdown = [];
//=================================================
// Console constructor
function Console() {
this._console = Components.classes["@mozilla.org/consoleservice;1"]
.getService(Ci.nsIConsoleService);
}
//=================================================
// Console implementation
Console.prototype = {
log : function cs_log(aMsg) {
this._console.logStringMessage(aMsg);
},
open : function cs_open() {
var wMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Ci.nsIWindowMediator);
var console = wMediator.getMostRecentWindow("global:console");
if (!console) {
var wWatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Ci.nsIWindowWatcher);
wWatch.openWindow(null, "chrome://global/content/console.xul", "_blank",
"chrome,dialog=no,all", null);
} else {
// console was already open
console.focus();
}
},
QueryInterface : XPCOMUtils.generateQI([Ci.fuelIConsole])
};
//=================================================
// EventItem constructor
function EventItem(aType, aData) {
this._type = aType;
this._data = aData;
}
//=================================================
// EventItem implementation
EventItem.prototype = {
_cancel : false,
get type() {
return this._type;
},
get data() {
return this._data;
},
preventDefault : function ei_pd() {
this._cancel = true;
},
QueryInterface : XPCOMUtils.generateQI([Ci.fuelIEventItem])
};
//=================================================
// Events constructor
function Events() {
this._listeners = [];
}
//=================================================
// Events implementation
Events.prototype = {
addListener : function evts_al(aEvent, aListener) {
if (this._listeners.some(hasFilter))
return;
this._listeners.push({
event: aEvent,
listener: aListener
});
function hasFilter(element) {
return element.event == aEvent && element.listener == aListener;
}
},
removeListener : function evts_rl(aEvent, aListener) {
this._listeners = this._listeners.filter(function(element){
return element.event != aEvent && element.listener != aListener;
});
},
dispatch : function evts_dispatch(aEvent, aEventItem) {
eventItem = new EventItem(aEvent, aEventItem);
this._listeners.forEach(function(key){
if (key.event == aEvent) {
key.listener.handleEvent ?
key.listener.handleEvent(eventItem) :
key.listener(eventItem);
}
});
return !eventItem._cancel;
},
QueryInterface : XPCOMUtils.generateQI([Ci.fuelIEvents])
};
//=================================================
// PreferenceBranch constructor
function PreferenceBranch(aBranch) {
if (!aBranch)
aBranch = "";
this._root = aBranch;
this._prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService);
if (aBranch)
this._prefs = this._prefs.getBranch(aBranch);
this._prefs.QueryInterface(Ci.nsIPrefBranch);
this._prefs.QueryInterface(Ci.nsIPrefBranch2);
// we want to listen to "all" changes for this branch, so pass in a blank domain
this._prefs.addObserver("", this, true);
this._events = new Events();
var self = this;
gShutdown.push(function() { self._shutdown(); });
}
//=================================================
// PreferenceBranch implementation
PreferenceBranch.prototype = {
// cleanup observer so we don't leak
_shutdown: function prefs_shutdown() {
this._prefs.removeObserver(this._root, this);
this._prefs = null;
this._events = null;
},
// for nsIObserver
observe: function prefs_observe(aSubject, aTopic, aData) {
if (aTopic == "nsPref:changed")
this._events.dispatch("change", aData);
},
get root() {
return this._root;
},
get all() {
return this.find({});
},
get events() {
return this._events;
},
// XXX: Disabled until we can figure out the wrapped object issues
// name: "name" or /name/
// path: "foo.bar." or "" or /fo+\.bar/
// type: Boolean, Number, String (getPrefType)
// locked: true, false (prefIsLocked)
// modified: true, false (prefHasUserValue)
find : function prefs_find(aOptions) {
var retVal = [];
var items = this._prefs.getChildList("", []);
for (var i = 0; i < items.length; i++) {
retVal.push(new Preference(items[i], this));
}
return retVal;
},
has : function prefs_has(aName) {
return (this._prefs.getPrefType(aName) != Ci.nsIPrefBranch.PREF_INVALID);
},
get : function prefs_get(aName) {
return this.has(aName) ? new Preference(aName, this) : null;
},
getValue : function prefs_gv(aName, aValue) {
var type = this._prefs.getPrefType(aName);
switch (type) {
case Ci.nsIPrefBranch2.PREF_STRING:
aValue = this._prefs.getComplexValue(aName, Ci.nsISupportsString).data;
break;
case Ci.nsIPrefBranch2.PREF_BOOL:
aValue = this._prefs.getBoolPref(aName);
break;
case Ci.nsIPrefBranch2.PREF_INT:
aValue = this._prefs.getIntPref(aName);
break;
}
return aValue;
},
setValue : function prefs_sv(aName, aValue) {
var type = aValue != null ? aValue.constructor.name : "";
switch (type) {
case "String":
var str = Components.classes["@mozilla.org/supports-string;1"]
.createInstance(Ci.nsISupportsString);
str.data = aValue;
this._prefs.setComplexValue(aName, Ci.nsISupportsString, str);
break;
case "Boolean":
this._prefs.setBoolPref(aName, aValue);
break;
case "Number":
this._prefs.setIntPref(aName, aValue);
break;
default:
throw("Unknown preference value specified.");
}
},
reset : function prefs_reset() {
this._prefs.resetBranch("");
},
QueryInterface : XPCOMUtils.generateQI([Ci.fuelIPreferenceBranch, Ci.nsISupportsWeakReference])
};
//=================================================
// Preference constructor
function Preference(aName, aBranch) {
this._name = aName;
this._branch = aBranch;
this._events = new Events();
var self = this;
this.branch.events.addListener("change", function(aEvent){
if (aEvent.data == self.name)
self.events.dispatch(aEvent.type, aEvent.data);
});
}
//=================================================
// Preference implementation
Preference.prototype = {
get name() {
return this._name;
},
get type() {
var value = "";
var type = this.branch._prefs.getPrefType(this._name);
switch (type) {
case Ci.nsIPrefBranch2.PREF_STRING:
value = "String";
break;
case Ci.nsIPrefBranch2.PREF_BOOL:
value = "Boolean";
break;
case Ci.nsIPrefBranch2.PREF_INT:
value = "Number";
break;
}
return value;
},
get value() {
return this.branch.getValue(this._name, null);
},
set value(aValue) {
return this.branch.setValue(this._name, aValue);
},
get locked() {
return this.branch._prefs.prefIsLocked(this.name);
},
set locked(aValue) {
this.branch._prefs[ aValue ? "lockPref" : "unlockPref" ](this.name);
},
get modified() {
return this.branch._prefs.prefHasUserValue(this.name);
},
get branch() {
return this._branch;
},
get events() {
return this._events;
},
reset : function pref_reset() {
this.branch._prefs.clearUserPref(this.name);
},
QueryInterface : XPCOMUtils.generateQI([Ci.fuelIPreference])
};
//=================================================
// SessionStorage constructor
function SessionStorage() {
this._storage = {};
this._events = new Events();
}
//=================================================
// SessionStorage implementation
SessionStorage.prototype = {
get events() {
return this._events;
},
has : function ss_has(aName) {
return this._storage.hasOwnProperty(aName);
},
set : function ss_set(aName, aValue) {
this._storage[aName] = aValue;
this._events.dispatch("change", aName);
},
get : function ss_get(aName, aDefaultValue) {
return this.has(aName) ? this._storage[aName] : aDefaultValue;
},
QueryInterface : XPCOMUtils.generateQI([Ci.fuelISessionStorage])
};
//=================================================
// Extension constructor
function Extension(aItem) {
this._item = aItem;
this._firstRun = false;
this._prefs = new PreferenceBranch("extensions." + this._item.id + ".");
this._storage = new SessionStorage();
this._events = new Events();
var installPref = "install-event-fired";
if (!this._prefs.has(installPref)) {
this._prefs.setValue(installPref, true);
this._firstRun = true;
}
this._enabled = false;
const PREFIX_ITEM_URI = "urn:mozilla:item:";
const PREFIX_NS_EM = "http://www.mozilla.org/2004/em-rdf#";
var rdf = Cc["@mozilla.org/rdf/rdf-service;1"].getService(Ci.nsIRDFService);
var itemResource = rdf.GetResource(PREFIX_ITEM_URI + this._item.id);
if (itemResource) {
var extmgr = Cc["@mozilla.org/extensions/manager;1"].getService(Ci.nsIExtensionManager);
var ds = extmgr.datasource;
var target = ds.GetTarget(itemResource, rdf.GetResource(PREFIX_NS_EM + "isDisabled"), true);
if (target && target instanceof Ci.nsIRDFLiteral)
this._enabled = (target.Value != "true");
}
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
os.addObserver(this, "em-action-requested", false);
var self = this;
gShutdown.push(function(){ self._shutdown(); });
}
//=================================================
// Extension implementation
Extension.prototype = {
// cleanup observer so we don't leak
_shutdown: function ext_shutdown() {
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
os.removeObserver(this, "em-action-requested");
this._prefs = null;
this._storage = null;
this._events = null;
},
// for nsIObserver
observe: function ext_observe(aSubject, aTopic, aData)
{
if ((aSubject instanceof Ci.nsIUpdateItem) && (aSubject.id == this._item.id))
{
if (aData == "item-uninstalled")
this._events.dispatch("uninstall", this._item.id);
else if (aData == "item-disabled")
this._events.dispatch("disable", this._item.id);
else if (aData == "item-enabled")
this._events.dispatch("enable", this._item.id);
else if (aData == "item-cancel-action")
this._events.dispatch("cancel", this._item.id);
else if (aData == "item-upgraded")
this._events.dispatch("upgrade", this._item.id);
}
},
get id() {
return this._item.id;
},
get name() {
return this._item.name;
},
get enabled() {
return this._enabled;
},
get version() {
return this._item.version;
},
get firstRun() {
return this._firstRun;
},
get storage() {
return this._storage;
},
get prefs() {
return this._prefs;
},
get events() {
return this._events;
},
QueryInterface : XPCOMUtils.generateQI([Ci.fuelIExtension])
};
//=================================================
// Extensions constructor
function Extensions() {
this._extmgr = Components.classes["@mozilla.org/extensions/manager;1"]
.getService(Ci.nsIExtensionManager);
this._cache = {};
var self = this;
gShutdown.push(function() { self._shutdown(); });
}
//=================================================
// Extensions implementation
Extensions.prototype = {
_shutdown : function exts_shutdown() {
this._extmgr = null;
this._cache = null;
},
/*
* Helper method to check cache before creating a new extension
*/
_get : function exts_get(aId) {
if (this._cache.hasOwnProperty(aId))
return this._cache[aId];
var newExt = new Extension(this._extmgr.getItemForID(aId));
this._cache[aId] = newExt;
return newExt;
},
get all() {
return this.find({});
},
// XXX: Disabled until we can figure out the wrapped object issues
// id: "some@id" or /id/
// name: "name" or /name/
// version: "1.0.1"
// minVersion: "1.0"
// maxVersion: "2.0"
find : function exts_find(aOptions) {
var retVal = [];
var items = this._extmgr.getItemList(Ci.nsIUpdateItem.TYPE_EXTENSION, {});
for (var i = 0; i < items.length; i++) {
retVal.push(this._get(items[i].id));
}
return retVal;
},
has : function exts_has(aId) {
return this._extmgr.getItemForID(aId) != null;
},
get : function exts_get(aId) {
return this.has(aId) ? this._get(aId) : null;
},
QueryInterface : XPCOMUtils.generateQI([Ci.fuelIExtensions])
};
//================================================= //=================================================
// Singleton that holds services and utilities // Singleton that holds services and utilities
var Utilities = { var Utilities = {
@@ -960,7 +446,6 @@ Bookmark.prototype = {
function BookmarkFolder(aId, aParent) { function BookmarkFolder(aId, aParent) {
this._id = aId; this._id = aId;
this._parent = aParent; this._parent = aParent;
this._annotations = new Annotations(this._id); this._annotations = new Annotations(this._id);
this._events = new Events(); this._events = new Events();
@@ -1184,24 +669,13 @@ var ApplicationFactory = {
} }
}; };
//================================================= //=================================================
// Application constructor // Application constructor
function Application() { function Application() {
this._console = null; this.initToolkitHelpers();
this._prefs = null;
this._storage = null;
this._events = null;
this._bookmarks = null; this._bookmarks = null;
this._info = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULAppInfo);
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
os.addObserver(this, "final-ui-startup", false);
os.addObserver(this, "quit-application-requested", false);
os.addObserver(this, "xpcom-shutdown", false);
} }
//================================================= //=================================================
@@ -1215,72 +689,8 @@ Application.prototype = {
// redefine the default factory for XPCOMUtils // redefine the default factory for XPCOMUtils
_xpcom_factory: ApplicationFactory, _xpcom_factory: ApplicationFactory,
// get this contractID registered for certain categories via XPCOMUtils // for nsISupports
_xpcom_categories: [ QueryInterface : XPCOMUtils.generateQI([Ci.fuelIApplication, Ci.nsIObserver, Ci.nsIClassInfo]),
// make Application a startup observer
{ category: "app-startup", service: true },
// add Application as a global property for easy access
{ category: "JavaScript global privileged property" }
],
get id() {
return this._info.ID;
},
get name() {
return this._info.name;
},
get version() {
return this._info.version;
},
// for nsIObserver
observe: function app_observe(aSubject, aTopic, aData) {
if (aTopic == "app-startup") {
this._extensions = new Extensions();
this.events.dispatch("load", "application");
}
else if (aTopic == "final-ui-startup") {
this.events.dispatch("ready", "application");
}
else if (aTopic == "quit-application-requested") {
// we can stop the quit by checking the return value
if (this.events.dispatch("quit", "application") == false)
aSubject.data = true;
}
else if (aTopic == "xpcom-shutdown") {
this.events.dispatch("unload", "application");
// call the cleanup functions and empty the array
while (gShutdown.length) {
gShutdown.shift()();
}
// release our observers
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
os.removeObserver(this, "final-ui-startup");
os.removeObserver(this, "quit-application-requested");
os.removeObserver(this, "xpcom-shutdown");
this._info = null;
this._console = null;
this._prefs = null;
this._storage = null;
this._events = null;
this._extensions = null;
this._bookmarks = null;
Utilities.free();
}
},
// for nsIClassInfo
flags : Ci.nsIClassInfo.SINGLETON,
implementationLanguage : Ci.nsIProgrammingLanguage.JAVASCRIPT,
getInterfaces : function app_gi(aCount) { getInterfaces : function app_gi(aCount) {
var interfaces = [Ci.fuelIApplication, Ci.nsIObserver, Ci.nsIClassInfo]; var interfaces = [Ci.fuelIApplication, Ci.nsIObserver, Ci.nsIClassInfo];
@@ -1288,43 +698,14 @@ Application.prototype = {
return interfaces; return interfaces;
}, },
getHelperForLanguage : function app_ghfl(aCount) { // for nsIObserver
return null; observe: function app_observe(aSubject, aTopic, aData) {
}, // Call the extApplication version of this function first
this.__proto__.__proto__.observe(aSubject, aTopic, aData);
// for nsISupports if (aTopic == "xpcom-shutdown") {
QueryInterface : XPCOMUtils.generateQI([Ci.fuelIApplication, Ci.nsIObserver, Ci.nsIClassInfo]), this._bookmarks = null;
Utilities.free();
get console() { }
if (this._console == null)
this._console = new Console();
return this._console;
},
get storage() {
if (this._storage == null)
this._storage = new SessionStorage();
return this._storage;
},
get prefs() {
if (this._prefs == null)
this._prefs = new PreferenceBranch("");
return this._prefs;
},
get extensions() {
return this._extensions;
},
get events() {
if (this._events == null)
this._events = new Events();
return this._events;
}, },
get bookmarks() { get bookmarks() {
@@ -1351,5 +732,9 @@ Application.prototype = {
//module initialization //module initialization
function NSGetModule(aCompMgr, aFileSpec) { function NSGetModule(aCompMgr, aFileSpec) {
// set the proto, defined in extApplication.js
Application.prototype.__proto__ = extApplication.prototype;
return XPCOMUtils.generateModule([Application]); return XPCOMUtils.generateModule([Application]);
} }
#include ../../../toolkit/components/exthelper/extApplication.js

View File

@@ -112,6 +112,7 @@ VIAddVersionKey "FileDescription" "${BrandShortName} Installer"
!insertmacro AddDDEHandlerValues !insertmacro AddDDEHandlerValues
!insertmacro ChangeMUIHeaderImage !insertmacro ChangeMUIHeaderImage
!insertmacro CheckForFilesInUse !insertmacro CheckForFilesInUse
!insertmacro CleanUpdatesDir
!insertmacro CloseApp !insertmacro CloseApp
!insertmacro CopyFilesFromDir !insertmacro CopyFilesFromDir
!insertmacro CreateRegKey !insertmacro CreateRegKey
@@ -255,6 +256,9 @@ Section "-InstallStartCleanup"
${EndIf} ${EndIf}
${EndIf} ${EndIf}
; Remove the updates directory for Vista and above
${CleanUpdatesDir} "Mozilla\Firefox"
${InstallStartCleanupCommon} ${InstallStartCleanupCommon}
SectionEnd SectionEnd

View File

@@ -104,12 +104,14 @@ VIAddVersionKey "FileDescription" "${BrandShortName} Helper"
!insertmacro RegCleanAppHandler !insertmacro RegCleanAppHandler
!insertmacro RegCleanMain !insertmacro RegCleanMain
!insertmacro RegCleanUninstall !insertmacro RegCleanUninstall
!insertmacro SetBrandNameVars
!insertmacro UnloadUAC !insertmacro UnloadUAC
!insertmacro WriteRegDWORD2 !insertmacro WriteRegDWORD2
!insertmacro WriteRegStr2 !insertmacro WriteRegStr2
!insertmacro un.ChangeMUIHeaderImage !insertmacro un.ChangeMUIHeaderImage
!insertmacro un.CheckForFilesInUse !insertmacro un.CheckForFilesInUse
!insertmacro un.CleanUpdatesDir
!insertmacro un.CleanVirtualStore !insertmacro un.CleanVirtualStore
!insertmacro un.DeleteRelativeProfiles !insertmacro un.DeleteRelativeProfiles
!insertmacro un.GetLongPath !insertmacro un.GetLongPath
@@ -312,6 +314,13 @@ Section "Uninstall"
Delete /REBOOTOK "$INSTDIR\removed-files" Delete /REBOOTOK "$INSTDIR\removed-files"
${EndIf} ${EndIf}
; Remove the updates directory for Vista and above
${un.CleanUpdatesDir} "Mozilla\Firefox"
; Remove files that may be left behind by the application in the
; VirtualStore directory.
${un.CleanVirtualStore}
; Parse the uninstall log to unregister dll's and remove all installed ; Parse the uninstall log to unregister dll's and remove all installed
; files / directories this install is responsible for. ; files / directories this install is responsible for.
${un.ParseUninstallLog} ${un.ParseUninstallLog}
@@ -322,10 +331,6 @@ Section "Uninstall"
; Remove the installation directory if it is empty ; Remove the installation directory if it is empty
${RemoveDir} "$INSTDIR" ${RemoveDir} "$INSTDIR"
; Remove files that may be left behind by the application in the
; VirtualStore directory.
${un.CleanVirtualStore}
; If firefox.exe was successfully deleted yet we still need to restart to ; If firefox.exe was successfully deleted yet we still need to restart to
; remove other files create a dummy firefox.exe.moz-delete to prevent the ; remove other files create a dummy firefox.exe.moz-delete to prevent the
; installer from allowing an install without restart when it is required ; installer from allowing an install without restart when it is required

View File

@@ -69,6 +69,7 @@
locale/browser/sidebar/sidebar.properties (%chrome/browser/sidebar/sidebar.properties) locale/browser/sidebar/sidebar.properties (%chrome/browser/sidebar/sidebar.properties)
% locale browser-region @AB_CD@ %locale/browser-region/ % locale browser-region @AB_CD@ %locale/browser-region/
locale/browser-region/region.properties (%chrome/browser-region/region.properties) locale/browser-region/region.properties (%chrome/browser-region/region.properties)
#ifdef MOZ_HELP_VIEWER
locale/browser/help/help.rdf (%chrome/help/firebirdhelp.rdf) locale/browser/help/help.rdf (%chrome/help/firebirdhelp.rdf)
locale/browser/help/firebird-toc.rdf (%chrome/help/firebird-toc.rdf) locale/browser/help/firebird-toc.rdf (%chrome/help/firebird-toc.rdf)
locale/browser/help/search-db.rdf (%chrome/help/search-db.rdf) locale/browser/help/search-db.rdf (%chrome/help/search-db.rdf)
@@ -87,6 +88,7 @@
locale/browser/help/platformStrings.dtd (%chrome/help/platformStrings.dtd) locale/browser/help/platformStrings.dtd (%chrome/help/platformStrings.dtd)
locale/browser/help/tabbed_browsing.xhtml (%chrome/help/tabbed_browsing.xhtml) locale/browser/help/tabbed_browsing.xhtml (%chrome/help/tabbed_browsing.xhtml)
locale/browser/help/glossary.xhtml (%chrome/help/glossary.xhtml) locale/browser/help/glossary.xhtml (%chrome/help/glossary.xhtml)
#endif
# the following files are browser-specific overrides # the following files are browser-specific overrides
* locale/browser/netError.dtd (%chrome/overrides/netError.dtd) * locale/browser/netError.dtd (%chrome/overrides/netError.dtd)
* locale/browser/appstrings.properties (%chrome/overrides/appstrings.properties) * locale/browser/appstrings.properties (%chrome/overrides/appstrings.properties)

View File

@@ -1,4 +1,5 @@
ar af
ar linux win32
be be
ca ca
cs cs
@@ -13,19 +14,22 @@ eu
fi fi
fr fr
fy-NL fy-NL
ga-IE
gu-IN gu-IN
he he linux win32
hu hu
id
it it
ja-JP-mac osx ja-JP-mac osx
ja win32 linux ja win32 linux
ka ka
ko ko
ku
lt lt
mk mk
mn
nb-NO nb-NO
nl nl
nn-NO
pa-IN pa-IN
pl pl
pt-BR pt-BR
@@ -34,6 +38,7 @@ ro
ru ru
sk sk
sq sq
sr
sv-SE sv-SE
tr tr
uk uk

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 B

View File

@@ -67,6 +67,7 @@
#navigator-toolbox[inFullscreen="true"], #navigator-toolbox[inFullscreen="true"],
#navigator-toolbox[inFullscreen="true"] > #nav-bar { #navigator-toolbox[inFullscreen="true"] > #nav-bar {
border-top: none; border-top: none;
padding-top: 0;
} }
/* Places toolbar */ /* Places toolbar */
@@ -1015,7 +1016,7 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] {
} }
.ac-comment { .ac-comment {
font-size: larger; font-size: 1.15em;
} }
.ac-url-text { .ac-url-text {

View File

@@ -32,6 +32,7 @@ classic.jar:
skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css) skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css)
* skin/classic/browser/places/bookmarkProperties.css (places/bookmarkProperties.css) * skin/classic/browser/places/bookmarkProperties.css (places/bookmarkProperties.css)
skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png) skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png)
skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png)
* skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) * skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css)
skin/classic/browser/places/livemark-item.png (places/livemark-item.png) skin/classic/browser/places/livemark-item.png (places/livemark-item.png)
skin/classic/browser/places/pageStarred.png (places/pageStarred.png) skin/classic/browser/places/pageStarred.png (places/pageStarred.png)
@@ -47,6 +48,7 @@ classic.jar:
skin/classic/browser/places/wrench.png (places/wrench.png) skin/classic/browser/places/wrench.png (places/wrench.png)
skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png)
skin/classic/browser/preferences/application.png (preferences/application.png) skin/classic/browser/preferences/application.png (preferences/application.png)
skin/classic/browser/preferences/mail.png (preferences/mail.png)
skin/classic/browser/preferences/Options.png (preferences/Options.png) skin/classic/browser/preferences/Options.png (preferences/Options.png)
skin/classic/browser/preferences/plugin.png (preferences/plugin.png) skin/classic/browser/preferences/plugin.png (preferences/plugin.png)
* skin/classic/browser/preferences/preferences.css (preferences/preferences.css) * skin/classic/browser/preferences/preferences.css (preferences/preferences.css)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 B

View File

@@ -791,7 +791,7 @@ statusbarpanel#statusbar-display {
} }
.ac-comment { .ac-comment {
font-size: larger; font-size: 1.15em;
} }
.ac-url-text { .ac-url-text {

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 513 B

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

After

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 B

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 111 KiB

View File

@@ -211,20 +211,23 @@ toolbar[mode="full"] .toolbarbutton-menubutton-button {
/* unified back button with keyhole icons */ /* unified back button with keyhole icons */
toolbar[iconsize="large"][mode="icons"] #back-button { toolbar[mode="icons"] #back-button {
-moz-appearance: none; -moz-appearance: none;
-moz-image-region: rect(0px 398px 34px 360px);
padding: 0; padding: 0;
-moz-padding-start: 2px; -moz-padding-start: 2px;
border: none; border: none;
} }
toolbar[iconsize="large"][mode="icons"] #back-button {
-moz-image-region: rect(0px 398px 34px 360px);
}
toolbar[iconsize="large"][mode="icons"] #back-button:not([disabled="true"]):hover { toolbar[iconsize="large"][mode="icons"] #back-button:not([disabled="true"]):hover {
-moz-image-region: rect(34px 398px 68px 360px); -moz-image-region: rect(34px 398px 68px 360px);
} }
toolbar[iconsize="large"][mode="icons"] #back-button[disabled="true"] { toolbar[iconsize="large"][mode="icons"] #back-button[disabled="true"] {
-moz-image-region: rect(68px 398px 102px 360px); -moz-image-region: rect(68px 398px 102px 360px);
} }
toolbar[iconsize="large"][mode="icons"] #back-button:not([disabled="true"]):active { toolbar[iconsize="large"][mode="icons"] #back-button:not([disabled="true"]):hover:active {
-moz-image-region: rect(102px 398px 136px 360px); -moz-image-region: rect(102px 398px 136px 360px);
} }
@@ -239,25 +242,28 @@ toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"]:not([disab
toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"][disabled="true"] { toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"][disabled="true"] {
-moz-image-region: rect(68px 516px 102px 478px); -moz-image-region: rect(68px 516px 102px 478px);
} }
toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):active { toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
-moz-image-region: rect(102px 516px 136px 478px); -moz-image-region: rect(102px 516px 136px 478px);
} }
/* unified forward button with keyhole icons */ /* unified forward button with keyhole icons */
toolbar[iconsize="large"][mode="icons"] #forward-button { toolbar[mode="icons"] #forward-button {
-moz-appearance: none; -moz-appearance: none;
-moz-image-region: rect(3px 424px 31px 398px);
padding: 0; padding: 0;
border: none; border: none;
} }
toolbar[iconsize="large"][mode="icons"] #forward-button {
-moz-image-region: rect(3px 424px 31px 398px);
}
toolbar[iconsize="large"][mode="icons"] #forward-button:not([disabled="true"]):hover { toolbar[iconsize="large"][mode="icons"] #forward-button:not([disabled="true"]):hover {
-moz-image-region: rect(37px 424px 65px 398px); -moz-image-region: rect(37px 424px 65px 398px);
} }
toolbar[iconsize="large"][mode="icons"] #forward-button[disabled="true"] { toolbar[iconsize="large"][mode="icons"] #forward-button[disabled="true"] {
-moz-image-region: rect(71px 424px 99px 398px); -moz-image-region: rect(71px 424px 99px 398px);
} }
toolbar[iconsize="large"][mode="icons"] #forward-button:not([disabled="true"]):active { toolbar[iconsize="large"][mode="icons"] #forward-button:not([disabled="true"]):hover:active {
-moz-image-region: rect(105px 424px 133px 398px); -moz-image-region: rect(105px 424px 133px 398px);
} }
@@ -272,39 +278,39 @@ toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"]:not([di
toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"][disabled="true"] { toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"][disabled="true"] {
-moz-image-region: rect(71px 478px 99px 452px); -moz-image-region: rect(71px 478px 99px 452px);
} }
toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):active { toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
-moz-image-region: rect(105px 478px 133px 452px); -moz-image-region: rect(105px 478px 133px 452px);
} }
/* dropmarker for unified back and forward buttons with keyhole icons */ /* dropmarker for unified back and forward buttons with keyhole icons */
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker { toolbar[mode="icons"] #back-forward-dropmarker {
-moz-appearance: none; -moz-appearance: none;
list-style-image: url("chrome://browser/skin/Toolbar.png");
-moz-image-region: rect(3px 438px 31px 424px);
padding: 0; padding: 0;
-moz-padding-end: 2px; -moz-padding-end: 2px;
border: none; border: none;
} }
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker > image { toolbar[mode="icons"] #back-forward-dropmarker > image {
display: -moz-box; display: -moz-box;
margin: 0; margin: 0;
} }
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker > dropmarker { toolbar[mode="icons"] #back-forward-dropmarker > dropmarker {
display: none; display: none;
} }
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker {
list-style-image: url("chrome://browser/skin/Toolbar.png");
-moz-image-region: rect(3px 438px 31px 424px);
}
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:not([disabled="true"]):hover { toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:not([disabled="true"]):hover {
-moz-image-region: rect(37px 438px 65px 424px); -moz-image-region: rect(37px 438px 65px 424px);
} }
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[disabled="true"] { toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[disabled="true"] {
-moz-image-region: rect(71px 438px 99px 424px); -moz-image-region: rect(71px 438px 99px 424px);
} }
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:not([disabled="true"]):hover:active {
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:not([disabled="true"]):active {
-moz-image-region: rect(105px 438px 133px 424px); -moz-image-region: rect(105px 438px 133px 424px);
} }
@@ -313,19 +319,114 @@ toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:not([disabled="
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"] { toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"] {
-moz-image-region: rect(3px 452px 31px 438px); -moz-image-region: rect(3px 452px 31px 438px);
} }
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover { toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover {
-moz-image-region: rect(37px 452px 65px 438px); -moz-image-region: rect(37px 452px 65px 438px);
} }
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"][disabled="true"] { toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"][disabled="true"] {
-moz-image-region: rect(71px 452px 99px 438px); -moz-image-region: rect(71px 452px 99px 438px);
} }
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover:active {
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):active {
-moz-image-region: rect(105px 452px 133px 438px); -moz-image-region: rect(105px 452px 133px 438px);
} }
/* ::::: unified back and forward buttons, small icons mode ::::: */
toolbar[iconsize="small"][mode="icons"] #back-button > .toolbarbutton-icon,
toolbar[iconsize="small"][mode="icons"] #forward-button > .toolbarbutton-icon {
-moz-padding-end: 0;
}
/* unified back button with keyhole icons, small icons mode */
toolbar[iconsize="small"][mode="icons"] #back-button {
-moz-image-region: rect(0px 264px 24px 240px);
}
toolbar[iconsize="small"][mode="icons"] #back-button:not([disabled="true"]):hover {
-moz-image-region: rect(24px 264px 48px 240px);
}
toolbar[iconsize="small"][mode="icons"] #back-button[disabled="true"] {
-moz-image-region: rect(48px 264px 72px 240px);
}
toolbar[iconsize="small"][mode="icons"] #back-button:not([disabled="true"]):hover:active {
-moz-image-region: rect(72px 264px 96px 240px);
}
/* unified back button with keyhole icons, small icons mode, RTL version */
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"] {
-moz-image-region: rect(0px 362px 24px 338px);
}
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover {
-moz-image-region: rect(24px 362px 48px 338px);
}
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"][disabled="true"] {
-moz-image-region: rect(48px 362px 72px 338px);
}
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
-moz-image-region: rect(72px 362px 96px 338px);
}
/* unified forward button with keyhole icons, small icons mode */
toolbar[iconsize="small"][mode="icons"] #forward-button {
-moz-image-region: rect(0px 288px 24px 264px);
}
toolbar[iconsize="small"][mode="icons"] #forward-button:not([disabled="true"]):hover {
-moz-image-region: rect(24px 288px 48px 264px);
}
toolbar[iconsize="small"][mode="icons"] #forward-button[disabled="true"] {
-moz-image-region: rect(48px 288px 72px 264px);
}
toolbar[iconsize="small"][mode="icons"] #forward-button:not([disabled="true"]):hover:active {
-moz-image-region: rect(72px 288px 96px 264px);
}
/* unified forward button with keyhole icons, small icons mode, RTL version */
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"] {
-moz-image-region: rect(0px 338px 24px 314px);
}
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover {
-moz-image-region: rect(24px 338px 48px 314px);
}
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"][disabled="true"] {
-moz-image-region: rect(48px 338px 72px 314px);
}
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
-moz-image-region: rect(72px 338px 96px 314px);
}
/* dropmarker for unified back and forward buttons with keyhole icons, small icons mode */
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 301px 24px 288px);
}
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:not([disabled="true"]):hover {
-moz-image-region: rect(24px 301px 48px 288px);
}
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[disabled="true"] {
-moz-image-region: rect(48px 301px 72px 288px);
}
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:not([disabled="true"]):hover:active {
-moz-image-region: rect(72px 301px 96px 288px);
}
/* unified dropmarker with keyhole icons, small icons mode, RTL version */
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"] {
-moz-image-region: rect(0px 314px 24px 301px);
}
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover {
-moz-image-region: rect(24px 314px 48px 301px);
}
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"][disabled="true"] {
-moz-image-region: rect(48px 314px 72px 301px);
}
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover:active {
-moz-image-region: rect(72px 314px 96px 301px);
}
/* ::::: 24px primary toolbar buttons ::::: */ /* ::::: 24px primary toolbar buttons ::::: */
/* back button */ /* back button */
@@ -595,7 +696,7 @@ toolbar[iconsize="small"] .toolbarbutton-1[type="menu-button"] {
/* back button */ /* back button */
toolbar[iconsize="small"] #back-button > .toolbarbutton-icon { toolbar[iconsize="small"] #back-button > .toolbarbutton-icon {
padding-right: 1px; -moz-padding-end: 1px;
} }
toolbar[iconsize="small"] #back-button { toolbar[iconsize="small"] #back-button {
-moz-image-region: rect(0px 16px 16px 0px); -moz-image-region: rect(0px 16px 16px 0px);
@@ -632,7 +733,7 @@ menupopup[chromedir="rtl"] > .unified-nav-forward[_moz-menuactive] {
/* forward button */ /* forward button */
toolbar[iconsize="small"] #forward-button > .toolbarbutton-icon { toolbar[iconsize="small"] #forward-button > .toolbarbutton-icon {
padding-right: 1px; -moz-padding-end: 1px;
} }
toolbar[iconsize="small"] #forward-button { toolbar[iconsize="small"] #forward-button {
-moz-image-region: rect(0px 32px 16px 16px); -moz-image-region: rect(0px 32px 16px 16px);
@@ -1029,7 +1130,7 @@ statusbarpanel#statusbar-display {
} }
.ac-comment { .ac-comment {
font-size: larger; font-size: 1.15em;
} }
.ac-url-text { .ac-url-text {
@@ -1290,7 +1391,7 @@ tabpanels {
.tab-close-button { .tab-close-button {
-moz-appearance: none; -moz-appearance: none;
-moz-image-region: rect(0px, 64px, 16px, 48px); -moz-image-region: rect(0px, 56px, 14px, 42px);
-moz-margin-end: 6px; -moz-margin-end: 6px;
border: none; border: none;
padding: 0px; padding: 0px;
@@ -1299,16 +1400,16 @@ tabpanels {
.tab-close-button:hover, .tab-close-button:hover,
.tabbrowser-tab[selected="true"] > .tab-close-button:hover { .tabbrowser-tab[selected="true"] > .tab-close-button:hover {
-moz-image-region: rect(0px, 32px, 16px, 16px); -moz-image-region: rect(0px, 28px, 14px, 14px);
} }
.tab-close-button:hover:active, .tab-close-button:hover:active,
.tabbrowser-tab[selected="true"] > .tab-close-button:hover:active { .tabbrowser-tab[selected="true"] > .tab-close-button:hover:active {
-moz-image-region: rect(0px, 48px, 16px, 32px); -moz-image-region: rect(0px, 42px, 14px, 28px);
} }
.tabbrowser-tab[selected="true"] > .tab-close-button { .tabbrowser-tab[selected="true"] > .tab-close-button {
-moz-image-region: rect(0px, 16px, 16px, 0px); -moz-image-region: rect(0px, 14px, 14px, 0px);
/* Make this button focusable so clicking on it will not focus the tab while /* Make this button focusable so clicking on it will not focus the tab while
it's getting closed */ it's getting closed */
-moz-user-focus: normal; -moz-user-focus: normal;
@@ -1449,7 +1550,7 @@ stack[chromedir="rtl"] > hbox > .tabs-alltabs-box-animate {
.tabs-closebutton { .tabs-closebutton {
-moz-appearance: none; -moz-appearance: none;
list-style-image: url("chrome://global/skin/icons/close.png"); list-style-image: url("chrome://global/skin/icons/close.png");
-moz-image-region: rect(0px, 16px, 16px, 0px); -moz-image-region: rect(0px, 14px, 14px, 0px);
padding: 4px 2px; padding: 4px 2px;
margin: 0px; margin: 0px;
border: none; border: none;
@@ -1462,11 +1563,11 @@ stack[chromedir="rtl"] > hbox > .tabs-alltabs-box-animate {
} }
.tabs-closebutton:hover { .tabs-closebutton:hover {
-moz-image-region: rect(0px, 32px, 16px, 16px); -moz-image-region: rect(0px, 28px, 14px, 14px);
} }
.tabs-closebutton:hover:active { .tabs-closebutton:hover:active {
-moz-image-region: rect(0px, 48px, 16px, 32px); -moz-image-region: rect(0px, 42px, 14px, 28px);
} }
.tabs-container > .tabs-closebutton { .tabs-container > .tabs-closebutton {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 748 B

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 771 B

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 767 B

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 763 B

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 748 B

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 771 B

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 915 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -6,13 +6,14 @@ classic.jar:
* skin/classic/browser/browser.css (browser.css) * skin/classic/browser/browser.css (browser.css)
skin/classic/browser/browser.xml skin/classic/browser/browser.xml
* skin/classic/browser/engineManager.css (engineManager.css) * skin/classic/browser/engineManager.css (engineManager.css)
skin/classic/browser/Info.png skin/classic/browser/Info.png (Info.png)
skin/classic/browser/identity.png (identity.png) skin/classic/browser/identity.png (identity.png)
skin/classic/browser/pageInfo.css skin/classic/browser/pageInfo.css
skin/classic/browser/pageInfo.png skin/classic/browser/pageInfo.png (pageInfo.png)
skin/classic/browser/page-livemarks.png (feeds/feedIcon16.png) skin/classic/browser/page-livemarks.png (feeds/feedIcon16.png)
skin/classic/browser/livemark-item.png (livemark-item.png) skin/classic/browser/livemark-item.png (livemark-item.png)
skin/classic/browser/livemark-folder.png (livemark-folder.png) skin/classic/browser/livemark-folder.png (livemark-folder.png)
skin/classic/browser/Bookmarks-folder.png (Bookmarks-folder.png)
skin/classic/browser/Secure.png (Secure.png) skin/classic/browser/Secure.png (Secure.png)
skin/classic/browser/Secure24.png (Secure24.png) skin/classic/browser/Secure24.png (Secure24.png)
skin/classic/browser/Security-broken.png (Security-broken.png) skin/classic/browser/Security-broken.png (Security-broken.png)
@@ -24,8 +25,8 @@ classic.jar:
skin/classic/browser/Go-arrow.png (Go-arrow.png) skin/classic/browser/Go-arrow.png (Go-arrow.png)
skin/classic/browser/Go-arrow-rtl.png (Go-arrow-rtl.png) skin/classic/browser/Go-arrow-rtl.png (Go-arrow-rtl.png)
* skin/classic/browser/searchbar.css (searchbar.css) * skin/classic/browser/searchbar.css (searchbar.css)
skin/classic/browser/Search-glass.png skin/classic/browser/Search-glass.png (Search-glass.png)
skin/classic/browser/Search-glass-rtl.png skin/classic/browser/Search-glass-rtl.png (Search-glass-rtl.png)
skin/classic/browser/Search-addengines.png skin/classic/browser/Search-addengines.png
skin/classic/browser/setDesktopBackground.css skin/classic/browser/setDesktopBackground.css
skin/classic/browser/menu-back.png (menu-back.png) skin/classic/browser/menu-back.png (menu-back.png)
@@ -58,6 +59,8 @@ classic.jar:
skin/classic/browser/places/importAndBackup.png (places/importAndBackup.png) skin/classic/browser/places/importAndBackup.png (places/importAndBackup.png)
skin/classic/browser/places/minus.png (places/minus.png) skin/classic/browser/places/minus.png (places/minus.png)
skin/classic/browser/places/plus.png (places/plus.png) skin/classic/browser/places/plus.png (places/plus.png)
skin/classic/browser/places/organize.png (places/organize.png)
skin/classic/browser/places/view.png (places/view.png)
skin/classic/browser/places/bookmarkProperties.css (places/bookmarkProperties.css) skin/classic/browser/places/bookmarkProperties.css (places/bookmarkProperties.css)
skin/classic/browser/places/organizer-toolbar.png (bookmarks/Bookmarks-toolbar.png) skin/classic/browser/places/organizer-toolbar.png (bookmarks/Bookmarks-toolbar.png)
skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png)
@@ -85,13 +88,14 @@ classic.jar:
* skin/classic/aero/browser/browser.css (browser.css) * skin/classic/aero/browser/browser.css (browser.css)
skin/classic/aero/browser/browser.xml skin/classic/aero/browser/browser.xml
* skin/classic/aero/browser/engineManager.css (engineManager.css) * skin/classic/aero/browser/engineManager.css (engineManager.css)
skin/classic/aero/browser/Info.png skin/classic/aero/browser/Info.png (Info-aero.png)
skin/classic/aero/browser/identity.png (identity-aero.png) skin/classic/aero/browser/identity.png (identity-aero.png)
skin/classic/aero/browser/pageInfo.css skin/classic/aero/browser/pageInfo.css
skin/classic/aero/browser/pageInfo.png skin/classic/aero/browser/pageInfo.png (pageInfo-aero.png)
skin/classic/aero/browser/page-livemarks.png (feeds/feedIcon16-aero.png) skin/classic/aero/browser/page-livemarks.png (feeds/feedIcon16-aero.png)
skin/classic/aero/browser/livemark-item.png (livemark-item-aero.png) skin/classic/aero/browser/livemark-item.png (livemark-item-aero.png)
skin/classic/aero/browser/livemark-folder.png (livemark-folder-aero.png) skin/classic/aero/browser/livemark-folder.png (livemark-folder-aero.png)
skin/classic/aero/browser/Bookmarks-folder.png (Bookmarks-folder-aero.png)
skin/classic/aero/browser/Secure.png (Secure-aero.png) skin/classic/aero/browser/Secure.png (Secure-aero.png)
skin/classic/aero/browser/Secure24.png (Secure24-aero.png) skin/classic/aero/browser/Secure24.png (Secure24-aero.png)
skin/classic/aero/browser/Security-broken.png (Security-broken-aero.png) skin/classic/aero/browser/Security-broken.png (Security-broken-aero.png)
@@ -103,8 +107,8 @@ classic.jar:
skin/classic/aero/browser/Go-arrow.png (Go-arrow-aero.png) skin/classic/aero/browser/Go-arrow.png (Go-arrow-aero.png)
skin/classic/aero/browser/Go-arrow-rtl.png (Go-arrow-rtl-aero.png) skin/classic/aero/browser/Go-arrow-rtl.png (Go-arrow-rtl-aero.png)
* skin/classic/aero/browser/searchbar.css (searchbar.css) * skin/classic/aero/browser/searchbar.css (searchbar.css)
skin/classic/aero/browser/Search-glass.png skin/classic/aero/browser/Search-glass.png (Search-glass-aero.png)
skin/classic/aero/browser/Search-glass-rtl.png skin/classic/aero/browser/Search-glass-rtl.png (Search-glass-rtl-aero.png)
skin/classic/aero/browser/Search-addengines.png skin/classic/aero/browser/Search-addengines.png
skin/classic/aero/browser/setDesktopBackground.css skin/classic/aero/browser/setDesktopBackground.css
skin/classic/aero/browser/menu-back.png (menu-back-aero.png) skin/classic/aero/browser/menu-back.png (menu-back-aero.png)
@@ -121,9 +125,9 @@ classic.jar:
skin/classic/aero/browser/feeds/subscribe.css (feeds/subscribe.css) skin/classic/aero/browser/feeds/subscribe.css (feeds/subscribe.css)
skin/classic/aero/browser/places/places.css (places/places.css) skin/classic/aero/browser/places/places.css (places/places.css)
skin/classic/aero/browser/places/organizer.css (places/organizer.css) skin/classic/aero/browser/places/organizer.css (places/organizer.css)
skin/classic/aero/browser/places/query.png (places/query.png) skin/classic/aero/browser/places/query.png (places/query-aero.png)
skin/classic/aero/browser/places/bookmarksMenu.png (places/bookmarksMenu.png) skin/classic/aero/browser/places/bookmarksMenu.png (places/bookmarksMenu-aero.png)
skin/classic/aero/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png) skin/classic/aero/browser/places/bookmarksToolbar.png (places/bookmarksToolbar-aero.png)
skin/classic/aero/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) skin/classic/aero/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png)
skin/classic/aero/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) skin/classic/aero/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css)
skin/classic/aero/browser/places/starPage.png (places/starPage-aero.png) skin/classic/aero/browser/places/starPage.png (places/starPage-aero.png)
@@ -137,10 +141,12 @@ classic.jar:
skin/classic/aero/browser/places/importAndBackup.png (places/importAndBackup-aero.png) skin/classic/aero/browser/places/importAndBackup.png (places/importAndBackup-aero.png)
skin/classic/aero/browser/places/minus.png (places/minus-aero.png) skin/classic/aero/browser/places/minus.png (places/minus-aero.png)
skin/classic/aero/browser/places/plus.png (places/plus-aero.png) skin/classic/aero/browser/places/plus.png (places/plus-aero.png)
skin/classic/aero/browser/places/view.png (places/view-aero.png)
skin/classic/aero/browser/places/organize.png (places/organize-aero.png)
skin/classic/aero/browser/places/bookmarkProperties.css (places/bookmarkProperties.css) skin/classic/aero/browser/places/bookmarkProperties.css (places/bookmarkProperties.css)
skin/classic/aero/browser/places/organizer-toolbar.png (bookmarks/Bookmarks-toolbar.png) skin/classic/aero/browser/places/organizer-toolbar.png (bookmarks/Bookmarks-toolbar.png)
skin/classic/aero/browser/preferences/alwaysAsk.png (preferences/alwaysAsk-aero.png) skin/classic/aero/browser/preferences/alwaysAsk.png (preferences/alwaysAsk-aero.png)
skin/classic/aero/browser/preferences/application.png (preferences/application.png) skin/classic/aero/browser/preferences/application.png (preferences/application-aero.png)
skin/classic/aero/browser/preferences/Options.png (preferences/Options-aero.png) skin/classic/aero/browser/preferences/Options.png (preferences/Options-aero.png)
skin/classic/aero/browser/preferences/plugin.png (preferences/plugin-aero.png) skin/classic/aero/browser/preferences/plugin.png (preferences/plugin-aero.png)
skin/classic/aero/browser/preferences/preferences.css (preferences/preferences.css) skin/classic/aero/browser/preferences/preferences.css (preferences/preferences.css)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 531 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 473 B

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 B

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 B

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 393 B

Some files were not shown because too many files have changed in this diff Show More