diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 7f150fe1fdaa..3cf84cf0d10f 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -116,7 +116,9 @@ pref("mozilla.widget.force-24bpp", true); pref("mozilla.widget.use-buffer-pixmap", true); pref("mozilla.widget.disable-native-theme", true); pref("layout.reflow.synthMouseMove", false); +#ifndef MOZ_X11 pref("layers.enable-tiles", true); +#endif pref("layers.low-precision-buffer", true); pref("layers.low-precision-opacity", "0.5"); pref("layers.progressive-paint", true); diff --git a/b2g/confvars.sh b/b2g/confvars.sh index 1bfb9c75eb74..f7cf12a6658f 100644 --- a/b2g/confvars.sh +++ b/b2g/confvars.sh @@ -60,11 +60,8 @@ MOZ_B2G=1 if test "$OS_TARGET" = "Android"; then MOZ_NUWA_PROCESS=1 MOZ_B2G_LOADER=1 -# Warnings-as-errors cannot be enabled on Lollipop until bug 1119980 is fixed. -if test "$PLATFORM_SDK_VERSION" -lt 21; then MOZ_ENABLE_WARNINGS_AS_ERRORS=1 fi -fi MOZ_JSDOWNLOADS=1 diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 112d9d861544..60c1a4498cfc 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -6414,97 +6414,32 @@ function BrowserOpenApps() { switchToTabHavingURI(appsURL, true) } -function GetSearchFieldBookmarkData(node) { - var charset = node.ownerDocument.characterSet; - - var formBaseURI = makeURI(node.form.baseURI, - charset); - - var formURI = makeURI(node.form.getAttribute("action"), - charset, - formBaseURI); - - var spec = formURI.spec; - - var isURLEncoded = - (node.form.method.toUpperCase() == "POST" - && (node.form.enctype == "application/x-www-form-urlencoded" || - node.form.enctype == "")); - - var title = gNavigatorBundle.getFormattedString("addKeywordTitleAutoFill", - [node.ownerDocument.title]); - var description = PlacesUIUtils.getDescriptionFromDocument(node.ownerDocument); - - var formData = []; - - function escapeNameValuePair(aName, aValue, aIsFormUrlEncoded) { - if (aIsFormUrlEncoded) - return escape(aName + "=" + aValue); - else - return escape(aName) + "=" + escape(aValue); - } - - for (let el of node.form.elements) { - if (!el.type) // happens with fieldsets - continue; - - if (el == node) { - formData.push((isURLEncoded) ? escapeNameValuePair(el.name, "%s", true) : - // Don't escape "%s", just append - escapeNameValuePair(el.name, "", false) + "%s"); - continue; - } - - let type = el.type.toLowerCase(); - - if (((el instanceof HTMLInputElement && el.mozIsTextField(true)) || - type == "hidden" || type == "textarea") || - ((type == "checkbox" || type == "radio") && el.checked)) { - formData.push(escapeNameValuePair(el.name, el.value, isURLEncoded)); - } else if (el instanceof HTMLSelectElement && el.selectedIndex >= 0) { - for (var j=0; j < el.options.length; j++) { - if (el.options[j].selected) - formData.push(escapeNameValuePair(el.name, el.options[j].value, - isURLEncoded)); - } - } - } - - var postData; - - if (isURLEncoded) - postData = formData.join("&"); - else { - let separator = spec.includes("?") ? "&" : "?"; - spec += separator + formData.join("&"); - } - - return { - spec: spec, - title: title, - description: description, - postData: postData, - charSet: charset - }; -} - - function AddKeywordForSearchField() { - let bookmarkData = GetSearchFieldBookmarkData(gContextMenu.target); + let mm = gBrowser.selectedBrowser.messageManager; - PlacesUIUtils.showBookmarkDialog({ action: "add" - , type: "bookmark" - , uri: makeURI(bookmarkData.spec) - , title: bookmarkData.title - , description: bookmarkData.description - , keyword: "" - , postData: bookmarkData.postData - , charSet: bookmarkData.charset - , hiddenRows: [ "location" - , "description" - , "tags" - , "loadInSidebar" ] - }, window); + let onMessage = (message) => { + mm.removeMessageListener("ContextMenu:SearchFieldBookmarkData:Result", onMessage); + + let bookmarkData = message.data; + let title = gNavigatorBundle.getFormattedString("addKeywordTitleAutoFill", + [bookmarkData.title]); + PlacesUIUtils.showBookmarkDialog({ action: "add" + , type: "bookmark" + , uri: makeURI(bookmarkData.spec) + , title: title + , description: bookmarkData.description + , keyword: "" + , postData: bookmarkData.postData + , charSet: bookmarkData.charset + , hiddenRows: [ "location" + , "description" + , "tags" + , "loadInSidebar" ] + }, window); + } + mm.addMessageListener("ContextMenu:SearchFieldBookmarkData:Result", onMessage); + + mm.sendAsyncMessage("ContextMenu:SearchFieldBookmarkData", {}, { target: gContextMenu.target }); } function convertFromUnicode(charset, str) diff --git a/browser/base/content/content.js b/browser/base/content/content.js index b0ba63627326..61f17691cc3c 100644 --- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -664,3 +664,73 @@ addMessageListener("ContextMenu:BookmarkFrame", (message) => { { title: frame.title, description: PlacesUIUtils.getDescriptionFromDocument(frame) }); }); + +addMessageListener("ContextMenu:SearchFieldBookmarkData", (message) => { + let node = message.objects.target; + + let charset = node.ownerDocument.characterSet; + + let formBaseURI = BrowserUtils.makeURI(node.form.baseURI, + charset); + + let formURI = BrowserUtils.makeURI(node.form.getAttribute("action"), + charset, + formBaseURI); + + let spec = formURI.spec; + + let isURLEncoded = + (node.form.method.toUpperCase() == "POST" + && (node.form.enctype == "application/x-www-form-urlencoded" || + node.form.enctype == "")); + + let title = node.ownerDocument.title; + let description = PlacesUIUtils.getDescriptionFromDocument(node.ownerDocument); + + let formData = []; + + function escapeNameValuePair(aName, aValue, aIsFormUrlEncoded) { + if (aIsFormUrlEncoded) + return escape(aName + "=" + aValue); + else + return escape(aName) + "=" + escape(aValue); + } + + for (let el of node.form.elements) { + if (!el.type) // happens with fieldsets + continue; + + if (el == node) { + formData.push((isURLEncoded) ? escapeNameValuePair(el.name, "%s", true) : + // Don't escape "%s", just append + escapeNameValuePair(el.name, "", false) + "%s"); + continue; + } + + let type = el.type.toLowerCase(); + + if (((el instanceof content.HTMLInputElement && el.mozIsTextField(true)) || + type == "hidden" || type == "textarea") || + ((type == "checkbox" || type == "radio") && el.checked)) { + formData.push(escapeNameValuePair(el.name, el.value, isURLEncoded)); + } else if (el instanceof content.HTMLSelectElement && el.selectedIndex >= 0) { + for (let j=0; j < el.options.length; j++) { + if (el.options[j].selected) + formData.push(escapeNameValuePair(el.name, el.options[j].value, + isURLEncoded)); + } + } + } + + let postData; + + if (isURLEncoded) + postData = formData.join("&"); + else { + let separator = spec.includes("?") ? "&" : "?"; + spec += separator + formData.join("&"); + } + + sendAsyncMessage("ContextMenu:SearchFieldBookmarkData:Result", + { spec, title, description, postData, charset }); +}); diff --git a/browser/base/content/test/general/browser_addKeywordSearch.js b/browser/base/content/test/general/browser_addKeywordSearch.js index d52cb34a32df..670feedfb647 100644 --- a/browser/base/content/test/general/browser_addKeywordSearch.js +++ b/browser/base/content/test/general/browser_addKeywordSearch.js @@ -1,49 +1,82 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -function test() { - waitForExplicitFinish(); +let testData = [ + /* baseURI, field name, expected */ + [ 'http://example.com/', 'q', 'http://example.com/?q=%s' ], + [ 'http://example.com/new-path-here/', 'q', 'http://example.com/new-path-here/?q=%s' ], + [ '', 'q', 'http://example.org/browser/browser/base/content/test/general/dummy_page.html?q=%s' ], + // Tests for proper behaviour when called on a form whose action contains a question mark. + [ 'http://example.com/search?oe=utf-8', 'q', 'http://example.com/search?oe=utf-8&q=%s' ], +]; - gBrowser.selectedTab = gBrowser.addTab("http://example.org/browser/browser/base/content/test/general/dummy_page.html"); +let mm = gBrowser.selectedBrowser.messageManager; - gBrowser.selectedBrowser.addEventListener("load", function runTests() { - gBrowser.selectedBrowser.removeEventListener("load", runTests, true); +add_task(function*() { + yield BrowserTestUtils.withNewTab({ + gBrowser, + url: "http://example.org/browser/browser/base/content/test/general/dummy_page.html", + }, function* (browser) { + yield ContentTask.spawn(browser, null, function* () { + let doc = content.document; + let base = doc.createElement("base"); + doc.head.appendChild(base); + }); - let doc = gBrowser.contentDocument; - let base = doc.createElement("base"); - doc.head.appendChild(base); + for (let [baseURI, fieldName, expected] of testData) { + let popupShownPromise = BrowserTestUtils.waitForEvent(document.getElementById("contentAreaContextMenu"), + "popupshown"); - let check = function (baseURI, fieldName, expected) { - base.href = baseURI; + yield ContentTask.spawn(browser, { baseURI, fieldName }, function* (args) { + let doc = content.document; - let form = doc.createElement("form"); - let element = doc.createElement("input"); - element.setAttribute("type", "text"); - element.setAttribute("name", fieldName); - form.appendChild(element); - doc.body.appendChild(form); + let base = doc.querySelector('head > base'); + base.href = args.baseURI; - let data = GetSearchFieldBookmarkData(element); - is(data.spec, expected, "Bookmark spec for search field named " + fieldName + " and baseURI " + baseURI + " incorrect"); + let form = doc.createElement("form"); + form.id = "keyword-form"; + let element = doc.createElement("input"); + element.setAttribute("type", "text"); + element.setAttribute("name", args.fieldName); + form.appendChild(element); + doc.body.appendChild(form); - doc.body.removeChild(form); + /* Open context menu so chrome can access the element */ + const domWindowUtils = + content.QueryInterface(Components.interfaces.nsIInterfaceRequestor) + .getInterface(Components.interfaces.nsIDOMWindowUtils); + let rect = element.getBoundingClientRect(); + let left = rect.left + rect.width / 2; + let top = rect.top + rect.height / 2; + domWindowUtils.sendMouseEvent("contextmenu", left, top, 2, + 1, 0, false, 0, 0, true); + }); + + yield popupShownPromise; + + let target = gContextMenuContentData.popupNode; + + let urlCheck = new Promise((resolve, reject) => { + let onMessage = (message) => { + mm.removeMessageListener("ContextMenu:SearchFieldBookmarkData:Result", onMessage); + + is(message.data.spec, expected, + `Bookmark spec for search field named ${fieldName} and baseURI ${baseURI} incorrect`); + resolve(); + }; + mm.addMessageListener("ContextMenu:SearchFieldBookmarkData:Result", onMessage); + + mm.sendAsyncMessage("ContextMenu:SearchFieldBookmarkData", null, { target }); + }); + + yield urlCheck; + + document.getElementById("contentAreaContextMenu").hidePopup(); + + yield ContentTask.spawn(browser, null, function* () { + let doc = content.document; + doc.body.removeChild(doc.getElementById("keyword-form")); + }); } - - let testData = [ - /* baseURI, field name, expected */ - [ 'http://example.com/', 'q', 'http://example.com/?q=%s' ], - [ 'http://example.com/new-path-here/', 'q', 'http://example.com/new-path-here/?q=%s' ], - [ '', 'q', 'http://example.org/browser/browser/base/content/test/general/dummy_page.html?q=%s' ], - // Tests for proper behaviour when called on a form whose action contains a question mark. - [ 'http://example.com/search?oe=utf-8', 'q', 'http://example.com/search?oe=utf-8&q=%s' ], - ] - - for (let data of testData) { - check(data[0], data[1], data[2]); - } - - // cleanup - gBrowser.removeCurrentTab(); - finish(); - }, true); -} + }); +}); diff --git a/browser/components/loop/content/css/contacts.css b/browser/components/loop/content/css/contacts.css index 382f483ddf97..7988c81483e5 100644 --- a/browser/components/loop/content/css/contacts.css +++ b/browser/components/loop/content/css/contacts.css @@ -81,7 +81,7 @@ height: 40px; background-color: #ccc; border-radius: 50%; - margin-right: 10px; + -moz-margin-end: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); background-image: url("../shared/img/audio-call-avatar.svg"); @@ -134,6 +134,11 @@ background-color: #fff; } +body[dir="rtl"] .contact > .details > .username > i.icon-google { + left: 1rem; + right: auto; +} + .contact > .details > .email { color: #999; font-size: 11px; @@ -143,7 +148,7 @@ .icons { cursor: pointer; display: none; - margin-left: auto; + -moz-margin-start: auto; padding: 10px; border-radius: 2px; background-color: #5bc0a4; @@ -188,6 +193,11 @@ left: auto; } +body[dir="rtl"] .contact > .dropdown-menu { + right: auto; + left: 3em; +} + .contact > .dropdown-menu-up { bottom: 10px; top: auto; @@ -201,6 +211,10 @@ margin-top: 3px; } +body[dir="rtl"] .contact > .dropdown-menu > .dropdown-menu-item > .icon { + background-position: center right; +} + .contact > .dropdown-menu > .dropdown-menu-item > .icon-audio-call { background-image: url("../shared/img/icons-16x16.svg#audio"); } diff --git a/browser/components/loop/content/css/panel.css b/browser/components/loop/content/css/panel.css index 0c3253d44e64..7965135ec0f0 100644 --- a/browser/components/loop/content/css/panel.css +++ b/browser/components/loop/content/css/panel.css @@ -339,7 +339,7 @@ body[dir=rtl] .new-room-view > .context > .context-content > .context-preview { width: 8px; height: 8px; border-radius: 50%; - margin-right: .3rem; + -moz-margin-end: .3rem; } .room-list > .room-entry.room-active > h2 > .room-notification { @@ -383,7 +383,8 @@ body[dir=rtl] .new-room-view > .context > .context-content > .context-preview { width: 24px; height: 24px; border: none; - margin: .1em .1em .1em .5em; /* relative to _this_ line's font, not the document's */ + margin: .1em; /* relative to _this_ line's font, not the document's */ + -moz-margin-start: .5em; background-color: transparent; /* override browser default for button tags */ top: -15px; } @@ -424,7 +425,7 @@ body[dir=rtl] .new-room-view > .context > .context-content > .context-preview { .room-entry-context-item { display: inline-block; vertical-align: middle; - margin-left: 1rem; + -moz-margin-start: 1rem; height: 16px; } @@ -752,11 +753,19 @@ body[dir=rtl] .generate-url-spinner { right: 14px; } +body[dir="rtl"] .settings-menu .dropdown-menu { + /* This is specified separately rather than using -moz-margin-start etc, as + we need to override .dropdown-menu's values which can't use the gecko + specific extensions. */ + left: 14px; + right: auto; +} + .settings-menu .icon { background-size: contain; width: 12px; height: 12px; - margin-right: 1em; + -moz-margin-end: 1em; margin-top: 2px; } diff --git a/browser/components/loop/content/shared/css/conversation.css b/browser/components/loop/content/shared/css/conversation.css index c5dc0a95b417..2477fefecd6c 100644 --- a/browser/components/loop/content/shared/css/conversation.css +++ b/browser/components/loop/content/shared/css/conversation.css @@ -1027,10 +1027,6 @@ body[dir=rtl] .share-service-dropdown .share-panel-header { flex: 0 1 auto; } -body[dir=rtl] .room-context-thumbnail { - order: 2; -} - .room-context-thumbnail[src=""] { display: none; } @@ -1041,10 +1037,6 @@ body[dir=rtl] .room-context-thumbnail { text-align: start; } -body[dir=rtl] .room-context-content { - order: 1; -} - .room-context-content > .error-display-area.error { display: block; background-color: rgba(215,67,69,.8); diff --git a/browser/components/loop/content/shared/js/activeRoomStore.js b/browser/components/loop/content/shared/js/activeRoomStore.js index 792675116ad8..b126ec2f0fb0 100644 --- a/browser/components/loop/content/shared/js/activeRoomStore.js +++ b/browser/components/loop/content/shared/js/activeRoomStore.js @@ -67,8 +67,28 @@ loop.store.ActiveRoomStore = (function() { this._isDesktop = options.isDesktop || false; }, + /** + * This is a list of states that need resetting when the room is left, + * due to user choice, failure or other reason. It is a subset of + * getInitialStoreState as some items (e.g. roomState, failureReason, + * context information) can persist across room exit & re-entry. + * + * @type {Array} + */ + _statesToResetOnLeave: [ + "audioMuted", + "localVideoDimensions", + "receivingScreenShare", + "remoteVideoDimensions", + "screenSharingState", + "videoMuted" + ], + /** * Returns initial state data for this active room. + * + * When adding states, consider if _statesToResetOnLeave needs updating + * as well. */ getInitialStoreState: function() { return { @@ -750,6 +770,15 @@ loop.store.ActiveRoomStore = (function() { // We probably don't need to end screen share separately, but lets be safe. this._sdkDriver.disconnectSession(); + // Reset various states. + var originalStoreState = this.getInitialStoreState(); + var newStoreState = {}; + + this._statesToResetOnLeave.forEach(function(state) { + newStoreState[state] = originalStoreState[state]; + }); + this.setStoreState(newStoreState); + if (this._timeout) { clearTimeout(this._timeout); delete this._timeout; @@ -768,12 +797,16 @@ loop.store.ActiveRoomStore = (function() { }, /** - * When feedback is complete, we reset the room to the initial state. + * When feedback is complete, we go back to the ready state, rather than + * init or gather, as we don't need to get the data from the server again. */ feedbackComplete: function() { - // Note, that we want some values, such as the windowId, so we don't - // do a full reset here. - this.setStoreState(this.getInitialStoreState()); + this.setStoreState({ + roomState: ROOM_STATES.READY, + // Reset the used state here as the user has now given feedback and the + // next time they enter the room, the other person might not be there. + used: false + }); }, /** diff --git a/browser/components/loop/test/shared/activeRoomStore_test.js b/browser/components/loop/test/shared/activeRoomStore_test.js index 70fb08b6aba6..daca85ace42a 100644 --- a/browser/components/loop/test/shared/activeRoomStore_test.js +++ b/browser/components/loop/test/shared/activeRoomStore_test.js @@ -493,18 +493,26 @@ describe("loop.store.ActiveRoomStore", function () { }); describe("#feedbackComplete", function() { - it("should reset the room store state", function() { - var initialState = store.getInitialStoreState(); + it("should set the room state to READY", function() { store.setStoreState({ roomState: ROOM_STATES.ENDED, - audioMuted: true, - videoMuted: true, - failureReason: "foo" + used: true }); store.feedbackComplete(new sharedActions.FeedbackComplete()); - expect(store.getStoreState()).eql(initialState); + expect(store.getStoreState().roomState).eql(ROOM_STATES.READY); + }); + + it("should reset the 'used' state", function() { + store.setStoreState({ + roomState: ROOM_STATES.ENDED, + used: true + }); + + store.feedbackComplete(new sharedActions.FeedbackComplete()); + + expect(store.getStoreState().used).eql(false); }); }); @@ -1302,6 +1310,38 @@ describe("loop.store.ActiveRoomStore", function () { expect(store._storeState.roomState).eql(ROOM_STATES.ENDED); }); + + it("should reset various store states", function() { + store.setStoreState({ + audioMuted: true, + localVideoDimensions: { x: 10 }, + receivingScreenShare: true, + remoteVideoDimensions: { y: 10 }, + screenSharingState: true, + videoMuted: true + }); + + store.leaveRoom(); + + expect(store._storeState.audioMuted).eql(false); + expect(store._storeState.localVideoDimensions).eql({}); + expect(store._storeState.receivingScreenShare).eql(false); + expect(store._storeState.remoteVideoDimensions).eql({}); + expect(store._storeState.screenSharingState).eql(SCREEN_SHARE_STATES.INACTIVE); + expect(store._storeState.videoMuted).eql(false); + }); + + it("should not reset the room context", function() { + store.setStoreState({ + roomContextUrls: [{ fake: 1 }], + roomName: "fred" + }); + + store.leaveRoom(); + + expect(store._storeState.roomName).eql("fred"); + expect(store._storeState.roomContextUrls).eql([{ fake: 1 }]); + }); }); describe("#_handleSocialShareUpdate", function() { diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index d8cf249da2e8..bad04cf38116 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -375,7 +375,7 @@ BrowserGlue.prototype = { case "handle-xul-text-link": let linkHandled = subject.QueryInterface(Ci.nsISupportsPRBool); if (!linkHandled.data) { - let win = this.getMostRecentBrowserWindow(); + let win = RecentWindow.getMostRecentBrowserWindow(); if (win) { win.openUILinkIn(data, "tab"); linkHandled.data = true; @@ -393,7 +393,7 @@ BrowserGlue.prototype = { // browser.js:BrowserSearch.recordSearchInHealthReport(). The code could // be consolidated if there is will. We need the observer in // nsBrowserGlue to prevent double counting. - let win = this.getMostRecentBrowserWindow(); + let win = RecentWindow.getMostRecentBrowserWindow(); BrowserUITelemetry.countSearchEvent("urlbar", win.gURLBar.value); let engine = null; @@ -813,7 +813,7 @@ BrowserGlue.prototype = { }, _showSlowStartupNotification: function () { - let win = this.getMostRecentBrowserWindow(); + let win = RecentWindow.getMostRecentBrowserWindow(); if (!win) return; @@ -847,7 +847,7 @@ BrowserGlue.prototype = { * Show a notification bar offering a reset if the profile has been unused for some time. */ _resetUnusedProfileNotification: function () { - let win = this.getMostRecentBrowserWindow(); + let win = RecentWindow.getMostRecentBrowserWindow(); if (!win) return; @@ -877,7 +877,7 @@ BrowserGlue.prototype = { }, _notifyUnsignedAddonsDisabled: function () { - let win = this.getMostRecentBrowserWindow(); + let win = RecentWindow.getMostRecentBrowserWindow(); if (!win) return; @@ -1075,7 +1075,7 @@ BrowserGlue.prototype = { // them to the user. let changedIDs = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_INSTALLED); if (changedIDs.length > 0) { - let win = this.getMostRecentBrowserWindow(); + let win = RecentWindow.getMostRecentBrowserWindow(); AddonManager.getAddonsByIDs(changedIDs, function(aAddons) { aAddons.forEach(function(aAddon) { // If the add-on isn't user disabled or can't be enabled then skip it. @@ -1115,7 +1115,7 @@ BrowserGlue.prototype = { if (shouldCheck && !isDefault && !willRecoverSession) { Services.tm.mainThread.dispatch(function() { - DefaultBrowserCheck.prompt(this.getMostRecentBrowserWindow()); + DefaultBrowserCheck.prompt(RecentWindow.getMostRecentBrowserWindow()); }.bind(this), Ci.nsIThread.DISPATCH_NORMAL); } } @@ -1339,7 +1339,7 @@ BrowserGlue.prototype = { let key = getNotifyString({propName: "notificationButtonAccessKey", stringName: "pu.notifyButton.accesskey"}); - let win = this.getMostRecentBrowserWindow(); + let win = RecentWindow.getMostRecentBrowserWindow(); let notifyBox = win.document.getElementById("high-priority-global-notificationbox"); let buttons = [ @@ -1380,12 +1380,11 @@ BrowserGlue.prototype = { let url = getNotifyString({propName: "alertURL", prefName: "startup.homepage_override_url"}); - var self = this; function clickCallback(subject, topic, data) { // This callback will be called twice but only once with this topic if (topic != "alertclickcallback") return; - let win = self.getMostRecentBrowserWindow(); + let win = RecentWindow.getMostRecentBrowserWindow(); win.openUILinkIn(data, "tab"); } @@ -1406,7 +1405,7 @@ BrowserGlue.prototype = { getService(Ci.nsIURLFormatter); var updateUrl = formatter.formatURLPref(PREF_PLUGINS_UPDATEURL); - var win = this.getMostRecentBrowserWindow(); + var win = RecentWindow.getMostRecentBrowserWindow(); win.openUILinkIn(updateUrl, "tab"); }, @@ -1655,7 +1654,7 @@ BrowserGlue.prototype = { formatURLPref("app.support.baseURL"); url += helpTopic; - var win = this.getMostRecentBrowserWindow(); + var win = RecentWindow.getMostRecentBrowserWindow(); var buttons = [ { @@ -2201,11 +2200,6 @@ BrowserGlue.prototype = { } }), - // this returns the most recent non-popup browser window - getMostRecentBrowserWindow: function BG_getMostRecentBrowserWindow() { - return RecentWindow.getMostRecentBrowserWindow(); - }, - #ifdef MOZ_SERVICES_SYNC /** * Called as an observer when Sync's "display URI" notification is fired. @@ -2252,7 +2246,7 @@ BrowserGlue.prototype = { Services.prefs.setBoolPref("dom.ipc.plugins.flash.disable-protected-mode", true); Services.prefs.setBoolPref("browser.flash-protected-mode-flip.done", true); - let win = this.getMostRecentBrowserWindow(); + let win = RecentWindow.getMostRecentBrowserWindow(); if (!win) { return; } diff --git a/browser/components/nsIBrowserGlue.idl b/browser/components/nsIBrowserGlue.idl index 211cffc362a2..01f164f5b985 100644 --- a/browser/components/nsIBrowserGlue.idl +++ b/browser/components/nsIBrowserGlue.idl @@ -23,7 +23,7 @@ interface nsIDOMWindow; * */ -[scriptable, uuid(ea083cb7-6b9d-4695-8b34-2e8f6ce2a860)] +[scriptable, uuid(b0e7c156-d00c-4605-a77d-27c7418f23ae)] interface nsIBrowserGlue : nsISupports { /** @@ -34,9 +34,4 @@ interface nsIBrowserGlue : nsISupports * */ void sanitize(in nsIDOMWindow aParentWindow); - - /** - * Gets the most recent window that's a browser (but not a popup) - */ - nsIDOMWindow getMostRecentBrowserWindow(); }; diff --git a/browser/components/sessionstore/SessionHistory.jsm b/browser/components/sessionstore/SessionHistory.jsm index 69e92570f6ab..372692bc8014 100644 --- a/browser/components/sessionstore/SessionHistory.jsm +++ b/browser/components/sessionstore/SessionHistory.jsm @@ -102,21 +102,6 @@ let SessionHistoryInternal = { return data; }, - /** - * Determines whether a given session history entry has been added dynamically. - * - * @param shEntry - * The session history entry. - * @return bool - */ - isDynamic: function (shEntry) { - // shEntry.isDynamicallyAdded() is true for dynamically added - //