From 365ac374dff5cfac87b59949697a2c725f19d532 Mon Sep 17 00:00:00 2001 From: "mozilla.mano@sent.com" Date: Tue, 17 Jul 2007 14:08:24 -0700 Subject: [PATCH] Bug 386392 - Drop pre places/places-bookmarks support from browser/. r=gavin. --- browser/base/content/browser-doctype.inc | 2 - browser/base/content/browser-gotreehack.inc | 23 -- browser/base/content/browser-menubar.inc | 192 ---------- browser/base/content/browser-sets.inc | 25 -- browser/base/content/browser.js | 359 +----------------- browser/base/content/browser.xul | 81 ---- browser/base/content/browserMountPoints.inc | 12 +- browser/base/content/global-scripts.inc | 12 - browser/base/content/macBrowserOverlay.xul | 11 +- browser/base/content/nsContextMenu.js | 20 - browser/base/content/web-panels.xul | 12 - browser/build.mk | 4 - browser/components/Makefile.in | 11 +- browser/components/build/Makefile.in | 22 +- browser/components/build/nsModule.cpp | 36 -- .../nsBrowserDirectoryProvider.cpp | 86 ----- browser/components/feeds/src/FeedConverter.js | 4 - browser/components/feeds/src/FeedWriter.js | 126 ------ .../microsummaries/public/Makefile.in | 4 - .../nsIMicrosummaryServiceNonPlaces.idl | 355 ----------------- .../src/nsMicrosummaryService.js | 240 ------------ browser/components/migration/src/Makefile.in | 11 +- .../src/nsBrowserProfileMigratorUtils.cpp | 65 +--- .../migration/src/nsIEProfileMigrator.cpp | 148 -------- .../migration/src/nsIEProfileMigrator.h | 13 - .../migration/src/nsOperaProfileMigrator.cpp | 123 +----- .../migration/src/nsOperaProfileMigrator.h | 17 - .../migration/src/nsSafariProfileMigrator.cpp | 62 --- .../migration/src/nsSafariProfileMigrator.h | 5 - browser/components/nsBrowserGlue.js | 4 - browser/components/places/Makefile.in | 6 +- .../components/places/content/controller.js | 6 - .../places/content/history-panel.js | 6 +- .../places/content/history-panel.xul | 4 - .../places/content/placesOverlay.xul | 2 - browser/components/places/tests/Makefile.in | 2 - browser/components/preferences/main.js | 4 - .../search/content/engineManager.js | 7 - browser/components/sidebar/src/nsSidebar.js | 15 - browser/confvars.sh | 1 - browser/locales/jar.mn | 9 - browser/themes/pinstripe/browser/browser.css | 41 -- browser/themes/pinstripe/browser/jar.mn | 21 - browser/themes/winstripe/browser/browser.css | 4 - browser/themes/winstripe/browser/jar.mn | 10 - configure.in | 15 +- toolkit/components/places/src/Makefile.in | 2 - .../components/places/src/nsNavBookmarks.cpp | 2 - toolkit/components/places/tests/Makefile.in | 8 +- 49 files changed, 23 insertions(+), 2227 deletions(-) delete mode 100644 browser/base/content/browser-gotreehack.inc delete mode 100644 browser/components/microsummaries/public/nsIMicrosummaryServiceNonPlaces.idl diff --git a/browser/base/content/browser-doctype.inc b/browser/base/content/browser-doctype.inc index d7867b7cb5c..70426f19c9b 100644 --- a/browser/base/content/browser-doctype.inc +++ b/browser/base/content/browser-doctype.inc @@ -15,10 +15,8 @@ %customizeToolbarDTD; #endif -#ifdef MOZ_PLACES %placesDTD; -#endif #ifdef MOZ_SAFE_BROWSING %safebrowsingDTD; diff --git a/browser/base/content/browser-gotreehack.inc b/browser/base/content/browser-gotreehack.inc deleted file mode 100644 index b3d47ef0786..00000000000 --- a/browser/base/content/browser-gotreehack.inc +++ /dev/null @@ -1,23 +0,0 @@ - - diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc index 0704caa23aa..4963bf4400f 100644 --- a/browser/base/content/browser-menubar.inc +++ b/browser/base/content/browser-menubar.inc @@ -323,7 +323,6 @@ -#ifdef MOZ_PLACES -#else - - - - - - - - - - - - - -#endif - -#ifndef MOZ_PLACES_BOOKMARKS - - - - - - - - - - -#else -#endif @@ -534,106 +445,3 @@ #endif - -#ifndef MOZ_PLACES_BOOKMARKS - - -#endif diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc index 6f6afb176f4..16ead2ed77a 100644 --- a/browser/base/content/browser-sets.inc +++ b/browser/base/content/browser-sets.inc @@ -52,23 +52,6 @@ -#ifndef MOZ_PLACES_BOOKMARKS - - - - - - - - - - - - - - -#endif - @@ -103,12 +86,8 @@ -#ifdef MOZ_PLACES_BOOKMARKS -#else - -#endif -#ifdef MOZ_PLACES -#ifdef MOZ_PLACES_BOOKMARKS -#endif -#endif 10) - count = 10; - - if (count == 0) - return; - - const NC_NS = "http://home.netscape.com/NC-rdf#"; - - if (!gRDF) - gRDF = Components.classes["@mozilla.org/rdf/rdf-service;1"] - .getService(Components.interfaces.nsIRDFService); - - var builder = history.builder.QueryInterface(Components.interfaces.nsIXULTreeBuilder); - - var beforeItem = document.getElementById("endHistorySeparator"); - - var nameResource = gRDF.GetResource(NC_NS + "Name"); - - var endSep = beforeItem; - var showSep = false; - - for (var i = count-1; i >= 0; i--) { - var res = builder.getResourceAtIndex(i); - var url = res.Value; - var titleRes = history.database.GetTarget(res, nameResource, true); - if (!titleRes) - continue; - - showSep = true; - var titleLiteral = titleRes.QueryInterface(Components.interfaces.nsIRDFLiteral); - beforeItem = constructGoMenuItem(goMenu, beforeItem, url, titleLiteral.Value); - } - - if (showSep) - endSep.hidden = false; -} -#endif - -#ifndef MOZ_PLACES_BOOKMARKS -function addBookmarkAs(aBrowser, aBookmarkAllTabs, aIsWebPanel) -{ - const browsers = aBrowser.browsers; - - // we only disable the menu item on onpopupshowing; if we get - // here via keyboard shortcut, we need to pretend like - // nothing happened if we have no tabs - if ((!browsers || browsers.length == 1) && aBookmarkAllTabs) - return; - - if (browsers && browsers.length > 1) - addBookmarkForTabBrowser(aBrowser, aBookmarkAllTabs); - else - addBookmarkForBrowser(aBrowser.webNavigation, aIsWebPanel); -} - -function addBookmarkForTabBrowser(aTabBrowser, aBookmarkAllTabs, aSelect) -{ - var tabsInfo = []; - var currentTabInfo = { name: "", url: "", charset: null }; - - const activeBrowser = aTabBrowser.selectedBrowser; - const browsers = aTabBrowser.browsers; - for (var i = 0; i < browsers.length; ++i) { - var webNav = browsers[i].webNavigation; - var url = webNav.currentURI.spec; - var name = ""; - var charSet, description; - try { - var doc = webNav.document; - name = doc.title || url; - charSet = doc.characterSet; - description = BookmarksUtils.getDescriptionFromDocument(doc); - } catch (e) { - name = url; - } - tabsInfo[i] = { name: name, url: url, charset: charSet, description: description }; - if (browsers[i] == activeBrowser) - currentTabInfo = tabsInfo[i]; - } - var dialogArgs = currentTabInfo; - if (aBookmarkAllTabs) { - dialogArgs = { name: gNavigatorBundle.getString("bookmarkAllTabsDefault") }; - dialogArgs.bBookmarkAllTabs = true; - } - - dialogArgs.objGroup = tabsInfo; - openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", - BROWSER_ADD_BM_FEATURES, dialogArgs); -} - -function addBookmarkForBrowser(aDocShell, aIsWebPanel) -{ - // Bug 52536: We obtain the URL and title from the nsIWebNavigation - // associated with a rather than from a DOMWindow. - // This is because when a full page plugin is loaded, there is - // no DOMWindow (?) but information about the loaded document - // may still be obtained from the webNavigation. - var url = aDocShell.currentURI.spec; - var title, charSet = null; - var description; - try { - title = aDocShell.document.title || url; - charSet = aDocShell.document.characterSet; - description = BookmarksUtils.getDescriptionFromDocument(aDocShell.document); - } - catch (e) { - title = url; - } - BookmarksUtils.addBookmark(url, title, charSet, aIsWebPanel, description); -} -#endif - function openLocation() { if (gURLBar && isElementVisible(gURLBar)) { @@ -1975,13 +1739,9 @@ function getShortcutOrURI(aURL, aPostDataRef) { return engine.getSubmission(param, null).uri.spec; try { -#ifdef MOZ_PLACES_BOOKMARKS var shortcutURI = PlacesUtils.bookmarks.getURIForKeyword(keyword); shortcutURL = shortcutURI.spec; aPostDataRef.value = PlacesUtils.getPostDataForURI(shortcutURI); -#else - shortcutURL = BMSVC.resolveKeyword(keyword, aPostDataRef); -#endif } catch(ex) {} if (!shortcutURL) @@ -1998,14 +1758,7 @@ function getShortcutOrURI(aURL, aPostDataRef) { if (matches) [, shortcutURL, charset] = matches; else { - try { - //XXX Bug 317472 will add lastCharset support to places. -#ifndef MOZ_PLACES_BOOKMARKS - charset = BMSVC.getLastCharset(shortcutURL); -#endif - } catch (ex) { - Components.utils.reportError(ex); - } + //XXX Bug 317472 will add lastCharset support to places. } var encodedParam = ""; @@ -2716,18 +2469,8 @@ var bookmarksButtonObserver = { { var split = aXferData.data.split("\n"); var url = split[0]; - if (url != aXferData.data) { //do nothing if it's not a valid URL -#ifndef MOZ_PLACES_BOOKMARKS - var dialogArgs = { - name: split[1], - url: url - } - openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", - BROWSER_ADD_BM_FEATURES, dialogArgs); -#else + if (url != aXferData.data) // do nothing if it's not a valid URL PlacesUtils.showMinimalAddBookmarkUI(makeURI(url), split[1]); -#endif - } }, onDragOver: function (aEvent, aFlavour, aDragSession) @@ -3337,31 +3080,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) SetClickAndHoldHandlers(); #endif -#ifdef MOZ_PLACES_BOOKMARKS initBookmarksToolbar(); -#else - // fix up the personal toolbar folder - var bt = document.getElementById("bookmarks-ptf"); - if (bt) { - var btf = BMSVC.getBookmarksToolbarFolder().Value; - var btchevron = document.getElementById("bookmarks-chevron"); - bt.ref = btf; - btchevron.ref = btf; - // no uniqueness is guaranteed, so we have to remove first - try { - bt.database.RemoveObserver(BookmarksToolbarRDFObserver); - } catch (ex) { - // ignore - } - bt.database.AddObserver(BookmarksToolbarRDFObserver); - bt.builder.rebuild(); - btchevron.builder.rebuild(); - - // fake a resize; this function takes care of flowing bookmarks - // from the bar to the overflow item - BookmarksToolbar.resizeFunc(null); - } -#endif #ifndef TOOLBAR_CUSTOMIZATION_SHEET // XXX Shouldn't have to do this, but I do @@ -3565,7 +3284,6 @@ nsBrowserStatusHandler.prototype = PageProxySetIcon(aBrowser.mIconURL); } -#ifdef MOZ_PLACES_BOOKMARKS // Save this favicon in the favicon service if (aBrowser.mIconURL) { var faviconService = Components.classes["@mozilla.org/browser/favicon-service;1"] @@ -3574,7 +3292,6 @@ nsBrowserStatusHandler.prototype = .getService(Components.interfaces.nsIIOService).newURI(aBrowser.mIconURL, null, null); faviconService.setAndLoadFaviconForPage(aBrowser.currentURI, uri, false); } -#endif }, onProgressChange : function (aWebProgress, aRequest, @@ -3638,10 +3355,6 @@ nsBrowserStatusHandler.prototype = var browser = gBrowser.mCurrentBrowser; if (!gBrowser.mTabbedMode && !browser.mIconURL) gBrowser.useDefaultIcon(gBrowser.mCurrentTab); -#ifndef MOZ_PLACES_BOOKMARKS - if (browser.mIconURL) - BookmarksUtils.loadFavIcon(browser.currentURI.spec, browser.mIconURL); -#endif } } @@ -4438,21 +4151,10 @@ function asyncOpenWebPanel(event) // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. -#ifndef MOZ_PLACES_BOOKMARKS - var dialogArgs = { - name: wrapper.getAttribute("title"), - url: wrapper.href, - bWebPanel: true - } - openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", - BROWSER_ADD_BM_FEATURES, dialogArgs); - event.preventDefault(); -#else PlacesUtils.showMinimalAddBookmarkUI(makeURI(wrapper.href), wrapper.getAttribute("title"), null, null, true, true); event.preventDefault(); -#endif return false; } else if (target == "_search") { @@ -5162,24 +4864,9 @@ function AddKeywordForSearchField() else spec += "?" + formData.join("&"); -#ifndef MOZ_PLACES_BOOKMARKS - var dialogArgs = { - name: "", - url: spec, - charset: node.ownerDocument.characterSet, - bWebPanel: false, - keyword: "", - bNeedKeyword: true, - postData: postData, - description: BookmarksUtils.getDescriptionFromDocument(node.ownerDocument) - } - openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", - BROWSER_ADD_BM_FEATURES, dialogArgs); -#else var description = PlacesUtils.getDescriptionFromDocument(node.ownerDocument); PlacesUtils.showMinimalAddBookmarkUI(makeURI(spec), "", description, null, null, null, "", postData); -#endif } function SwitchDocumentDirection(aWindow) { @@ -5447,28 +5134,6 @@ var FeedHandler = { href = "feed:" + href; this.loadFeed(href, event); }, - -#ifndef MOZ_PLACES_BOOKMARKS - /** - * Adds a Live Bookmark to a feed - * @param url - * The URL of the feed being bookmarked - * @title title - * The title of the feed. Optional. - * @subtitle subtitle - * A short description of the feed. Optional. - */ - addLiveBookmark: function(url, feedTitle, feedSubtitle) { - var doc = gBrowser.selectedBrowser.contentDocument; - var title = (arguments.length > 1) ? feedTitle : doc.title; - var description; - if (arguments.length > 2) - description = feedSubtitle; - else - description = BookmarksUtils.getDescriptionFromDocument(doc); - BookmarksUtils.addLivemark(doc.baseURI, url, title, description); - }, -#endif loadFeed: function(href, event) { var feeds = gBrowser.selectedBrowser.feeds; @@ -5571,9 +5236,7 @@ var FeedHandler = { } }; -#ifdef MOZ_PLACES #include browser-places.js -#endif #include browser-contentPrefSink.js #include browser-textZoom.js @@ -5631,13 +5294,6 @@ var AugmentTabs = { } }; -/** -* History menu initialization -*/ -#ifndef MOZ_PLACES -var HistoryMenu = {}; -#endif - HistoryMenu.toggleRecentlyClosedTabs = function PHM_toggleRecentlyClosedTabs() { // enable/disable the Recently Closed Tabs sub menu var undoPopup = document.getElementById("historyUndoPopup"); @@ -5751,9 +5407,8 @@ function formatURL(aFormat, aIsPref) { } /** - * This object encapsulates both legacy and places-based implementations - * of the bookmark-all-tabs command. It also takes care of updating the command - * enabled-state when tabs are created or removed. + * This also takes care of updating the command enabled-state when tabs are + * created or removed. */ function BookmarkAllTabsHandler() { this._command = document.getElementById("Browser:BookmarkAllTabs"); @@ -5785,11 +5440,7 @@ BookmarkAllTabsHandler.prototype = { }, doCommand: function BATH_doCommand() { -#ifdef MOZ_PLACES_BOOKMARKS PlacesCommandHook.bookmarkCurrentPages(); -#else - addBookmarkAs(gBrowser, true); -#endif }, // nsIDOMEventListener diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 95397d79006..d260dbee73a 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -44,10 +44,7 @@ # ***** END LICENSE BLOCK ***** - -#ifdef MOZ_PLACES -#endif @@ -55,9 +52,7 @@ -#ifdef MOZ_PLACES -#endif # All DTD information is stored in a separate file so that it can be shared by # hiddenWindow.xul. @@ -134,27 +129,9 @@ -#ifndef MOZ_PLACES -# The hacky hidden tree used by the Go menu to build items. -#include browser-gotreehack.inc -#endif - -#ifndef MOZ_PLACES_BOOKMARKS - - - - -#endif - -#else - onpopupshowing="return BookmarksToolbar.fillInBTTooltip(document.tooltipNode)"> -#endif