Bug 1607023 - Remove dead GroupBookmark code. r=frg

This commit is contained in:
Ian Neal 2020-01-06 19:29:43 +01:00
Родитель b0893b2da6
Коммит e9dffd201e
6 изменённых файлов: 2 добавлений и 162 удалений

Просмотреть файл

@ -238,8 +238,6 @@ pref("browser.tabs.warnOnOpen", true);
pref("browser.tabs.maxOpenBeforeWarn", 15); pref("browser.tabs.maxOpenBeforeWarn", 15);
pref("browser.tabs.insertRelatedAfterCurrent", true); pref("browser.tabs.insertRelatedAfterCurrent", true);
pref("browser.tabs.insertAllTabsAfterCurrent", false); pref("browser.tabs.insertAllTabsAfterCurrent", false);
// 0 = append, 1 = replace
pref("browser.tabs.loadGroup", 1);
// For future use // For future use
pref("browser.tabs.loadBookmarksInBackground", false); pref("browser.tabs.loadBookmarksInBackground", false);

Просмотреть файл

@ -1406,35 +1406,13 @@ function BrowserHandleShiftBackspace()
} }
} }
function SetGroupHistory(popupMenu, direction)
{
while (popupMenu.hasChildNodes())
popupMenu.lastChild.remove();
var menuItem = document.createElementNS(XUL_NS, "menuitem");
var label = gNavigatorBundle.getString("tabs.historyItem");
menuItem.setAttribute("label", label);
menuItem.setAttribute("index", direction);
popupMenu.appendChild(menuItem);
}
function BrowserBackMenu(event) function BrowserBackMenu(event)
{ {
if (gBrowser.backBrowserGroup.length != 0) {
SetGroupHistory(event.target, "back");
return true;
}
return FillHistoryMenu(event.target, "back"); return FillHistoryMenu(event.target, "back");
} }
function BrowserForwardMenu(event) function BrowserForwardMenu(event)
{ {
if (gBrowser.forwardBrowserGroup.length != 0) {
SetGroupHistory(event.target, "forward");
return true;
}
return FillHistoryMenu(event.target, "forward"); return FillHistoryMenu(event.target, "forward");
} }

Просмотреть файл

@ -2610,121 +2610,19 @@
</body> </body>
</method> </method>
<field name="backBrowserGroup">
[]
</field>
<field name="forwardBrowserGroup">
[]
</field>
<method name="replaceGroup">
<parameter name="aGroup"/>
<body>
<![CDATA[
var oldBrowserGroup = [];
var oldCount = this.tabs.length;
var newCount = aGroup.length;
var n = Math.max(oldCount, newCount);
for (var i = 0; i < n; ++i) {
if (i < newCount) {
var data = aGroup[i];
if ("sessionHistory" in data) {
this.addTab("about:blank", null);
var browser = this.tabContainer.lastChild.linkedBrowser;
// need to hold on to the listener so it won't go away
// addProgressListener only has a weak pointer to it
browser._SHListener =
this.mInstallSH(browser, aGroup[i].sessionHistory);
browser.webProgress.addProgressListener(browser._SHListener, Ci.nsIWebProgress.NOTIFY_ALL);
} else {
var referrerURI = "referrerURI" in data ? data.referrerURI : null;
this.addTab(data.URI, referrerURI);
}
}
if (i < oldCount) {
var firstTab = this.tabContainer.firstChild;
var browserData = {
sessionHistory : firstTab.linkedBrowser.sessionHistory
}
oldBrowserGroup.push(browserData);
this.removeTab(firstTab, { disableUndo: true });
}
}
return oldBrowserGroup;
]]>
</body>
</method>
<method name="appendGroup">
<parameter name="aGroup"/>
<body>
<![CDATA[
for (var i in aGroup) {
var page = aGroup[i];
var referrerURI = "referrerURI" in page ? page.referrerURI : null;
this.addTab(page.URI, referrerURI);
}
]]>
</body>
</method>
<method name="loadGroup">
<parameter name="aGroup"/>
<body>
<![CDATA[
if (aGroup.length == 0)
return null;
var tab;
if (Services.prefs.getIntPref("browser.tabs.loadGroup") == 0) {
var oldCount = this.tabs.length;
this.appendGroup(aGroup);
tab = this.tabs[oldCount];
} else {
this.backBrowserGroup = this.replaceGroup(aGroup);
this.forwardBrowserGroup = [];
tab = this.tabContainer.firstChild;
}
return tab;
]]>
</body>
</method>
<method name="goBackGroup">
<body>
<![CDATA[
this.forwardBrowserGroup = this.replaceGroup(this.backBrowserGroup);
this.backBrowserGroup = [];
]]>
</body>
</method>
<method name="goForwardGroup">
<body>
<![CDATA[
this.backBrowserGroup = this.replaceGroup(this.forwardBrowserGroup);
this.forwardBrowserGroup = [];
]]>
</body>
</method>
<!-- BEGIN FORWARDED BROWSER PROPERTIES. IF YOU ADD A PROPERTY TO THE BROWSER ELEMENT <!-- BEGIN FORWARDED BROWSER PROPERTIES. IF YOU ADD A PROPERTY TO THE BROWSER ELEMENT
MAKE SURE TO ADD IT HERE AS WELL. --> MAKE SURE TO ADD IT HERE AS WELL. -->
<property name="canGoBack" <property name="canGoBack"
onget="return this.backBrowserGroup.length != 0 || this.mCurrentBrowser.canGoBack;" onget="return this.mCurrentBrowser.canGoBack;"
readonly="true"/> readonly="true"/>
<property name="canGoForward" <property name="canGoForward"
onget="return this.forwardBrowserGroup.length != 0 || this.mCurrentBrowser.canGoForward;" onget="return this.mCurrentBrowser.canGoForward;"
readonly="true"/> readonly="true"/>
<method name="goBack"> <method name="goBack">
<body> <body>
<![CDATA[ <![CDATA[
if (this.backBrowserGroup.length != 0)
return this.goBackGroup();
return this.mCurrentBrowser.goBack(); return this.mCurrentBrowser.goBack();
]]> ]]>
</body> </body>
@ -2733,9 +2631,6 @@
<method name="goForward"> <method name="goForward">
<body> <body>
<![CDATA[ <![CDATA[
if (this.forwardBrowserGroup.length != 0)
return this.goForwardGroup();
return this.mCurrentBrowser.goForward(); return this.mCurrentBrowser.goForward();
]]> ]]>
</body> </body>

Просмотреть файл

@ -29,9 +29,6 @@
<preference id="browser.tabs.insertRelatedAfterCurrent" <preference id="browser.tabs.insertRelatedAfterCurrent"
name="browser.tabs.insertRelatedAfterCurrent" name="browser.tabs.insertRelatedAfterCurrent"
type="bool"/> type="bool"/>
<preference id="browser.tabs.loadGroup"
name="browser.tabs.loadGroup"
type="int"/>
<preference id="browser.tabs.opentabfor.middleclick" <preference id="browser.tabs.opentabfor.middleclick"
name="browser.tabs.opentabfor.middleclick" name="browser.tabs.opentabfor.middleclick"
type="bool"/> type="bool"/>
@ -68,20 +65,6 @@
preference="browser.tabs.insertRelatedAfterCurrent"/> preference="browser.tabs.insertRelatedAfterCurrent"/>
</groupbox> </groupbox>
<groupbox id="loadGroupPreferences" align="start">
<caption label="&loadGroup.label;"/>
<radiogroup id="loadGroup"
orient="horizontal"
preference="browser.tabs.loadGroup">
<radio value="0"
label="&loadGroupAppend.label;"
accesskey="&loadGroupAppend.accesskey;"/>
<radio value="1"
label="&loadGroupReplace.label;"
accesskey="&loadGroupReplace.accesskey;"/>
</radiogroup>
</groupbox>
<groupbox id="useTabPreferences" align="start"> <groupbox id="useTabPreferences" align="start">
<caption label="&openTabs.label;"/> <caption label="&openTabs.label;"/>
<checkbox id="middleClick" <checkbox id="middleClick"

Просмотреть файл

@ -476,14 +476,6 @@
tab bar.</li> tab bar.</li>
</ul> </ul>
</li> </li>
<li><strong>When opening a bookmark group</strong>:
<ul>
<li><strong>Add tabs</strong>: Select this if you want a bookmark group
to be opened in new tabs.</li>
<li><strong>Replace existing tabs</strong>: Select this if you want a
bookmark group to replace your existing tabs.</li>
</ul>
</li>
<li><strong>Open tabs instead of windows for</strong>: <li><strong>Open tabs instead of windows for</strong>:
<ul> <ul>
<li><strong><span class="mac"><kbd>Cmd</kbd>+click or <li><strong><span class="mac"><kbd>Cmd</kbd>+click or

Просмотреть файл

@ -14,12 +14,6 @@
<!ENTITY relatedAfterCurrent.label "Open related tabs after current tab"> <!ENTITY relatedAfterCurrent.label "Open related tabs after current tab">
<!ENTITY relatedAfterCurrent.accesskey "O"> <!ENTITY relatedAfterCurrent.accesskey "O">
<!ENTITY loadGroup.label "When opening a bookmark group">
<!ENTITY loadGroupAppend.label "Add tabs">
<!ENTITY loadGroupAppend.accesskey "A">
<!ENTITY loadGroupReplace.label "Replace existing tabs">
<!ENTITY loadGroupReplace.accesskey "R">
<!ENTITY openTabs.label "Open tabs instead of windows for"> <!ENTITY openTabs.label "Open tabs instead of windows for">
<!ENTITY openManagers.label "Open in a new tab instead of a stand-alone window"> <!ENTITY openManagers.label "Open in a new tab instead of a stand-alone window">