--- a/browser/base/content/browser-doctype.inc
+++ b/browser/base/content/browser-doctype.inc
@@ -10,18 +10,16 @@
<!ENTITY % charsetDTD SYSTEM "chrome://global/locale/charsetOverlay.dtd" >
%charsetDTD;
<!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd" >
%textcontextDTD;
#ifdef TOOLBAR_CUSTOMIZATION_SHEET
<!ENTITY % customizeToolbarDTD SYSTEM "chrome://global/locale/customizeToolbar.dtd">
%customizeToolbarDTD;
#endif
-#ifdef MOZ_PLACES
<!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
%placesDTD;
-#endif
#ifdef MOZ_SAFE_BROWSING
<!ENTITY % safebrowsingDTD SYSTEM "chrome://browser/locale/safebrowsing/phishing-afterload-warning-message.dtd">
%safebrowsingDTD;
#endif
]>
deleted file mode 100644
--- a/browser/base/content/browser-gotreehack.inc
+++ /dev/null
@@ -1,23 +0,0 @@
- <!-- Total hack. Used by the Go menu to build up items. -->
- <tree id="hiddenHistoryTree" hidden="true" collapsed="true" datasources="rdf:null"
- flags="dont-build-content"
- hidecolumnpicker="true">
- <template>
- <rule>
- <treechildren>
- <treeitem uri="rdf:*" rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
- <treerow>
- <treecell label="rdf:http://home.netscape.com/NC-rdf#Name"/>
- <treecell label="rdf:http://home.netscape.com/NC-rdf#Date" hidden="true"/>
- </treerow>
- </treeitem>
- </treechildren>
- </rule>
- </template>
- <treecols id="hiddenHistoryTreeCols">
- <treecol flex="1" id="Name"
- hideheader="true" primary="true"/>
- <treecol id="Date" hidden="true" hideheader="true"
- sort="rdf:http://home.netscape.com/NC-rdf#Date" sortActive="true" sortDirection="descending"/>
- </treecols>
- </tree>
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -318,17 +318,16 @@
<menuseparator hidden="true" id="documentDirection-separator"/>
<menuitem hidden="true" id="documentDirection-swap"
label="&bidiSwitchPageDirectionItem.label;"
accesskey="&bidiSwitchPageDirectionItem.accesskey;"
oncommand="SwitchDocumentDirection(window.content)"/>
</menupopup>
</menu>
-#ifdef MOZ_PLACES
<menu id="history-menu"
oncommand="var url = event.target.getAttribute('statustext'); if (url) openUILink(url, event, false, true);"
onclick="checkForMiddleClick(this, event);"
label="&historyMenu.label;"
accesskey="&historyMenu.accesskey;">
<menupopup id="goPopup"
type="places"
onpopupshowing="HistoryMenu.onPopupShowing(this);"
@@ -362,104 +361,17 @@
<menu id="historyUndoMenu" label="&historyUndoMenu.label;" disabled="true">
<menupopup id="historyUndoPopup" onpopupshowing="HistoryMenu.populateUndoSubmenu();"/>
</menu>
<menuseparator id="endUndoSeparator"/>
<menuitem observes="viewHistorySidebar" label="&historyShowSidebarCmd.label;"
key="key_gotoHistory"/>
</menupopup>
</menu>
-#else
- <menu id="go-menu" label="&historyMenu.label;" accesskey="&historyMenu.accesskey;"
- oncommand="var url = event.target.getAttribute('statustext'); if (url) openUILink(url, event, false, true);"
- onclick="checkForMiddleClick(this, event);">
- <menupopup id="goPopup" onpopupshowing="updateGoMenu(event, this);" onpopuphiding="onGoMenuHidden(event);">
- <menuitem label="&backCmd.label;"
-#ifdef XP_MACOSX
- key="goBackKb2"
-#else
- key="goBackKb"
-#endif
- oncommand="BrowserBack(event, true)"
- onclick="checkForMiddleClick(this, event);">
- <observes element="Browser:Back" attribute="disabled" />
- </menuitem>
- <menuitem label="&forwardCmd.label;"
-#ifdef XP_MACOSX
- key="goForwardKb2"
-#else
- key="goForwardKb"
-#endif
- oncommand="BrowserForward(event, true)"
- onclick="checkForMiddleClick(this, event);">
- <observes element="Browser:Forward" attribute="disabled" />
- </menuitem>
-
- <menuitem label="&goHomeCmd.label;"
- command="Browser:Home"
- key="goHome"/>
- <menuseparator id="startHistorySeparator"/>
- <menuseparator hidden="true" id="endHistorySeparator"/>
- <menu id="historyUndoMenu" label="&historyUndoMenu.label;" disabled="true">
- <menupopup id="historyUndoPopup" onpopupshowing="HistoryMenu.populateUndoSubmenu();"/>
- </menu>
- <menuseparator id="endUndoSeparator"/>
- <menuitem observes="viewHistorySidebar" label="&historyShowSidebarCmd.label;"
- key="key_gotoHistory"/>
- </menupopup>
- </menu>
-#endif
-
-#ifndef MOZ_PLACES_BOOKMARKS
- <menu id="bookmarks-menu" label="&bookmarksMenu.label;" accesskey="&bookmarksMenu.accesskey;"
- datasources="rdf:bookmarks rdf:files"
- ref="NC:BookmarksRoot" flags="dont-test-empty"
- template='bookmarks-template'
- infer="forward-proxy"
- onpopupshowing="BookmarksMenu.onShowMenu(event.target)"
- onpopuphidden="BookmarksMenu.onHideMenu(event.target)"
- oncommand="BookmarksMenu.loadBookmark(event, event.target, this.database)"
- onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
- ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
- ondragdrop="nsDragAndDrop.drop(event, BookmarksMenuDNDObserver); event.stopPropagation()"
- ondragenter="nsDragAndDrop.dragEnter(event, BookmarksMenuDNDObserver); event.stopPropagation()"
- ondragexit="nsDragAndDrop.dragExit(event, BookmarksMenuDNDObserver); event.stopPropagation()"
- ondragover="nsDragAndDrop.dragOver(event, BookmarksMenuDNDObserver); event.stopPropagation()">
- <menupopup id="menu_BookmarksPopup" contextmenu='bookmarks-context-menu'>
- <menuitem key="addBookmarkAsKb"
- label="&addCurPageAsCmd.label;"
- command="Browser:AddBookmarkAs"/>
- <menuitem id="subscribeToPageMenuitem"
- label="&subscribeToPageMenuitem.label;"
- oncommand="return FeedHandler.subscribeToFeed(null, event);"
- onclick="checkForMiddleClick(this, event);"
- disabled="true"/>
- <menu id="subscribeToPageMenupopup"
- label="&subscribeToPageMenupopup.label;"
- hidden="true">
- <menupopup id="subscribeToPageSubmenuMenupopup"
- onpopupshowing="return FeedHandler.buildFeedList(event.target);"
- oncommand="return FeedHandler.subscribeToFeed(null, event);"
- onclick="checkForMiddleClick(this, event);"/>
- </menu>
- <menuitem id="bookmarkAllCmd"
-# Accel+Shift+A-F are reserved on GTK2
-#ifndef MOZ_WIDGET_GTK2
- key="bookmarkAllTabsKb"
-#endif
- label="&bookmarkAllCmd.label;"
- command="Browser:BookmarkAllTabs"/>
- <menuitem key="manBookmarkKb"
- label="&manBookmarksCmd.label;"
- oncommand="toOpenWindowByType('bookmarks:manager', 'chrome://browser/content/bookmarks/bookmarksManager.xul');"/>
- <menuseparator/>
- </menupopup>
- </menu>
-#else
<menu id="bookmarksMenu"
label="&bookmarksMenu.label;" accesskey="&bookmarksMenu.accesskey;"
ondragenter="PlacesMenuDNDController.onBookmarksMenuDragEnter(event);"
ondragdrop="nsDragAndDrop.drop(event, BookmarksMenuDropHandler);"
ondragover="nsDragAndDrop.dragOver(event, BookmarksMenuDropHandler);"
ondragexit="PlacesMenuDNDController.onDragExit(event);">
<menupopup id="bookmarksMenuPopup"
type="places" asyncinit="true"
@@ -486,17 +398,16 @@
</menu>
<menuitem label="&addCurPagesCmd.label;"
command="Browser:BookmarkAllTabs" key="bookmarkAllTabsKb"/>
<menuitem label="&manBookmarksCmd.label;"
command="Browser:ShowBookmarks" key="manBookmarkKb"/>
<menuseparator builder="start"/>
</menupopup>
</menu>
-#endif
<menu id="tools-menu" label="&toolsMenu.label;" accesskey="&toolsMenu.accesskey;">
<menupopup id="menu_ToolsPopup">
<menuitem label="&search.label;" accesskey="&search.accesskey;"
key="key_search" command="Tools:Search"/>
<menuseparator/>
<menuitem id="menu_openDownloads" label="&downloads.label;"
accesskey="&downloads.accesskey;"
@@ -529,111 +440,8 @@
</menupopup>
</menu>
#ifdef XP_MACOSX
<menu id="windowMenu" />
#endif
<menu id="helpMenu" />
</menubar>
-
-#ifndef MOZ_PLACES_BOOKMARKS
- <template id='bookmarks-template' xmlns:nc="http://home.netscape.com/NC-rdf#">
- <rule parent="hbox" rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
- <toolbarseparator uri="rdf:*"
- rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>
- </rule>
- <rule parent="hbox" rdf:type="http://home.netscape.com/NC-rdf#Livemark">
- <toolbarbutton type="menu" class="bookmark-item" uri="rdf:*" editable="true"
- rdf:type="http://home.netscape.com/NC-rdf#Folder"
- label="rdf:http://home.netscape.com/NC-rdf#Name"
- livemark="true"
- chromedir="&locale.dir;">
-#ifdef XP_MACOSX
- <menupopup/>
-#else
- <menupopup contextmenu="bookmarks-context-menu"/>
-#endif
- </toolbarbutton>
- </rule>
- <rule parent="hbox" iscontainer="true">
- <toolbarbutton type="menu" class="bookmark-item" uri="rdf:*" editable="true"
- rdf:type="http://home.netscape.com/NC-rdf#Folder"
- label="rdf:http://home.netscape.com/NC-rdf#Name">
-#ifdef XP_MACOSX
- <menupopup/>
-#else
- <menupopup contextmenu="bookmarks-context-menu"/>
-#endif
- </toolbarbutton>
- </rule>
- <rule parent="hbox" rdf:type="http://home.netscape.com/NC-rdf#MicsumBookmark">
- <toolbarbutton class="bookmark-item-microsummarized bookmark-item"
- uri="rdf:*" editable="true"
- status="rdf:http://home.netscape.com/WEB-rdf#status"
- rdf:type="http://home.netscape.com/NC-rdf#Bookmark"
- image="rdf:http://home.netscape.com/NC-rdf#Icon"
- statustext="rdf:http://home.netscape.com/NC-rdf#URL"
- tooltip="btTooltip"
- label="rdf:http://home.netscape.com/NC-rdf#GeneratedTitle"/>
- </rule>
- <rule parent="hbox">
- <toolbarbutton class="bookmark-item" uri="rdf:*" editable="true"
- status="rdf:http://home.netscape.com/WEB-rdf#status"
- rdf:type="http://home.netscape.com/NC-rdf#Bookmark"
- image="rdf:http://home.netscape.com/NC-rdf#Icon"
- statustext="rdf:http://home.netscape.com/NC-rdf#URL"
- tooltip="btTooltip"
- label="rdf:http://home.netscape.com/NC-rdf#Name"/>
- </rule>
- <rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
- <menupopup>
- <menuseparator uri="rdf:*" />
- </menupopup>
- </rule>
- <rule rdf:type="http://home.netscape.com/NC-rdf#Livemark">
- <menupopup>
- <menu class="menu-iconic bookmark-item" uri="rdf:*"
- label="rdf:http://home.netscape.com/NC-rdf#Name"
- type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
- livemark="true">
-#ifdef XP_MACOSX
- <menupopup/>
-#else
- <menupopup contextmenu="bookmarks-context-menu"/>
-#endif
- </menu>
- </menupopup>
- </rule>
- <rule iscontainer="true">
- <menupopup>
- <menu class="menu-iconic bookmark-item" uri="rdf:*"
- label="rdf:http://home.netscape.com/NC-rdf#Name"
- type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
-#ifdef XP_MACOSX
- <menupopup/>
-#else
- <menupopup contextmenu="bookmarks-context-menu"/>
-#endif
- </menu>
- </menupopup>
- </rule>
- <rule rdf:type="http://home.netscape.com/NC-rdf#MicsumBookmark">
- <menupopup>
- <menuitem class="menuitem-iconic bookmark-item" uri="rdf:*"
- label="rdf:http://home.netscape.com/NC-rdf#GeneratedTitle"
- image="rdf:http://home.netscape.com/NC-rdf#Icon"
- status="rdf:http://home.netscape.com/WEB-rdf#status"
- statustext="rdf:http://home.netscape.com/NC-rdf#URL"/>
- </menupopup>
- </rule>
- <rule>
- <menupopup>
- <menuitem class="menuitem-iconic bookmark-item" uri="rdf:*"
- label="rdf:http://home.netscape.com/NC-rdf#Name"
- image="rdf:http://home.netscape.com/NC-rdf#Icon"
- status="rdf:http://home.netscape.com/WEB-rdf#status"
- statustext="rdf:http://home.netscape.com/NC-rdf#URL"/>
- </menupopup>
- </rule>
- </template>
-
-#endif
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -47,33 +47,16 @@
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
<stringbundle id="bundle_shell" src="chrome://browser/locale/shellservice.properties"/>
<stringbundle id="bundle_preferences" src="chrome://browser/locale/preferences/preferences.properties"/>
</stringbundleset>
<commandset id="mainCommandSet">
<command id="cmd_newNavigator" oncommand="OpenBrowserWindow()"/>
-#ifndef MOZ_PLACES_BOOKMARKS
- <command id="cmd_bm_open" oncommand="goDoCommand('cmd_bm_open');"/>
- <command id="cmd_bm_openinnewwindow" oncommand="goDoCommand('cmd_bm_openinnewwindow');"/>
- <command id="cmd_bm_openinnewtab" oncommand="goDoCommand('cmd_bm_openinnewtab');"/>
- <command id="cmd_bm_openfolder" oncommand="goDoCommand('cmd_bm_openfolder');"/>
- <command id="cmd_bm_managefolder" oncommand="goDoCommand('cmd_bm_managefolder');"/>
- <command id="cmd_bm_newfolder" oncommand="goDoCommand('cmd_bm_newfolder');"/>
- <command id="cmd_bm_newbookmark" oncommand="goDoCommand('cmd_bm_newbookmark');"/>
- <command id="cmd_bm_newseparator" oncommand="goDoCommand('cmd_bm_newseparator');"/>
- <command id="cmd_bm_properties" oncommand="goDoCommand('cmd_bm_properties');"/>
- <command id="cmd_bm_refreshlivemark" oncommand="goDoCommand('cmd_bm_refreshlivemark');"/>
- <command id="cmd_bm_refreshmicrosummary" oncommand="goDoCommand('cmd_bm_refreshmicrosummary');"/>
- <command id="cmd_bm_rename" oncommand="goDoCommand('cmd_bm_rename');"/>
- <command id="cmd_bm_moveBookmark" oncommand="goDoCommand('cmd_bm_moveBookmark');"/>
- <command id="cmd_bm_sortbyname" oncommand="goDoCommand('cmd_bm_sortbyname');"/>
-#endif
-
<command id="cmd_handleBackspace" oncommand="BrowserHandleBackspace();" />
<command id="cmd_handleShiftBackspace" oncommand="BrowserHandleShiftBackspace();" />
<command id="cmd_newNavigatorTab" oncommand="BrowserOpenTab();"/>
<command id="Browser:OpenFile" oncommand="BrowserOpenFileWindow();"/>
<command id="Browser:SavePage" oncommand="saveDocument(window.content.document);"/>
<command id="Browser:SaveFrame" oncommand="saveFrameDocument();"/>
@@ -98,22 +81,18 @@
oncommand="gFindBar.onFindCommand();"
observes="isImage"/>
<command id="cmd_findAgain"
oncommand="gFindBar.onFindAgainCommand(false);"
observes="isImage"/>
<command id="cmd_findPrevious"
oncommand="gFindBar.onFindAgainCommand(true);"
observes="isImage"/>
-#ifdef MOZ_PLACES_BOOKMARKS
<command id="Browser:AddBookmarkAs"
oncommand="PlacesCommandHook.bookmarkCurrentPage();"/>
-#else
- <command id="Browser:AddBookmarkAs" oncommand="addBookmarkAs(document.getElementById('content'), false);"/>
-#endif
<!-- The command is disabled for the hidden window. Otherwise its enabled
state is handled by the BookmarkAllTabsHandler object. -->
<command id="Browser:BookmarkAllTabs"
oncommand="gBookmarkAllTabsHandler.doCommand();"
disabled="true"/>
<command id="Browser:Home" oncommand="BrowserHome();"/>
<command id="Browser:Back" oncommand="BrowserBack();" disabled="true"/>
<command id="Browser:Forward" oncommand="BrowserForward();" disabled="true"/>
@@ -130,24 +109,20 @@
'chrome://mozapps/content/downloads/downloads.xul',
'chrome,dialog=no,resizable');"/>
<command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
<command id="Tools:Sanitize"
oncommand="Cc[GLUE_CID].getService(Ci.nsIBrowserGlue).sanitize(window || null);"/>
<command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
</commandset>
-#ifdef MOZ_PLACES
<commandset id="placesCommands">
-#ifdef MOZ_PLACES_BOOKMARKS
<command id="Browser:ShowBookmarks"
oncommand="PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_BOOKMARKS);"/>
-#endif
</commandset>
-#endif
<broadcasterset id="mainBroadcasterSet">
<broadcaster id="viewBookmarksSidebar" autoCheck="false" label="&bookmarksButton.label;"
type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/bookmarks/bookmarksPanel.xul"
oncommand="toggleSidebar('viewBookmarksSidebar');"/>
<!-- for both places and non-places, the sidebar lives at
chrome://browser/content/history/history-panel.xul so there are no
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -55,24 +55,16 @@
# 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 *****
const kXULNS =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-#ifndef MOZ_PLACES
-# For Places-enabled builds, this is in
-# chrome://browser/content/places/controller.js
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cr = Components.results;
-#endif
-
const nsIWebNavigation = Components.interfaces.nsIWebNavigation;
const MAX_HISTORY_MENU_ITEMS = 15;
// bookmark dialog features
#ifdef XP_MACOSX
const BROWSER_ADD_BM_FEATURES = "centerscreen,chrome,dialog,resizable,modal";
#else
@@ -143,23 +135,16 @@ function pageShowEventHandlers(event)
if (gBrowser.mTabbedMode) {
var targetBrowserIndex = gBrowser.getBrowserIndexForDocument(event.originalTarget);
if (targetBrowserIndex == -1)
return;
targetBrowser = gBrowser.getBrowserAtIndex(targetBrowserIndex);
} else {
targetBrowser = gBrowser.mCurrentBrowser;
}
-
-#ifndef MOZ_PLACES_BOOKMARKS
- // update the last visited date
- if (targetBrowser.currentURI.spec)
- BMSVC.updateLastVisitedDate(targetBrowser.currentURI.spec,
- targetBrowser.contentDocument.characterSet);
-#endif
}
/**
* Determine whether or not the content area is displaying a page with frames,
* and if so, toggle the display of the 'save frame as' menu item.
**/
function getContentAreaFrameCount()
{
@@ -293,25 +278,19 @@ function addBookmarkMenuitems()
}
function BookmarkThisTab()
{
var tab = getBrowser().mContextTab;
if (tab.localName != "tab")
tab = getBrowser().mCurrentTab;
-#ifdef MOZ_PLACES_BOOKMARKS
- PlacesCommandHook.bookmarkPage(tab.linkedBrowser);
-#else
- addBookmarkAs(tab.linkedBrowser, false);
-#endif
+ PlacesCommandHook.bookmarkPage(tab.linkedBrowser)
}
-#ifdef MOZ_PLACES_BOOKMARKS
-
/**
* Global bookmarks observer for browser-window specific stuff
*/
var gBookmarksObserver = {
QueryInterface: function G_BO_QueryInterface(aIID) {
if (aIID.equals(Ci.nsINavBookmarkObserver) ||
aIID.equals(Ci.nsISupports))
return this;
@@ -348,17 +327,16 @@ var gBookmarksObserver = {
function initBookmarksToolbar() {
var bt = document.getElementById("bookmarksBarContent");
if (!bt)
return;
bt.place =
PlacesUtils.getQueryStringForFolder(PlacesUtils.bookmarks.toolbarFolder);
}
-#endif
const gSessionHistoryObserver = {
observe: function(subject, topic, data)
{
if (topic != "browser:purge-session-history")
return;
var backCommand = document.getElementById("Browser:Back");
@@ -1030,37 +1008,20 @@ function delayedStartup()
var sidebar = document.getElementById("sidebar");
var sidebarBox = document.getElementById("sidebar-box");
sidebar.setAttribute("src", sidebarBox.getAttribute("src"));
}
// add bookmark options to context menu for tabs
addBookmarkMenuitems();
-#ifndef MOZ_PLACES_BOOKMARKS
- initServices();
- initBMService();
- // now load bookmarks
- BMSVC.readBookmarks();
- var bt = document.getElementById("bookmarks-ptf");
- if (bt) {
- var btf = BMSVC.getBookmarksToolbarFolder().Value;
- bt.ref = btf;
- document.getElementById("bookmarks-chevron").ref = btf;
- bt.database.AddObserver(BookmarksToolbarRDFObserver);
- }
- window.addEventListener("resize", BookmarksToolbar.resizeFunc, false);
- document.getElementById("PersonalToolbar")
- .controllers.appendController(BookmarksMenuController);
-#else
PlacesMenuDNDController.init();
initBookmarksToolbar();
PlacesUtils.bookmarks.addObserver(gBookmarksObserver, false);
-#endif
// called when we go into full screen, even if it is
// initiated by a web page script
window.addEventListener("fullscreen", onFullScreen, true);
if (gIsLoadingBlank && gURLBar && isElementVisible(gURLBar))
focusElement(gURLBar);
else
@@ -1186,33 +1147,17 @@ function BrowserShutdown()
os.removeObserver(gSessionHistoryObserver, "browser:purge-session-history");
os.removeObserver(gXPInstallObserver, "xpinstall-install-blocked");
try {
gBrowser.removeProgressListener(window.XULBrowserWindow);
} catch (ex) {
}
-#ifdef MOZ_PLACES_BOOKMARKS
PlacesUtils.bookmarks.removeObserver(gBookmarksObserver);
-#else
- try {
- document.getElementById("PersonalToolbar")
- .controllers.removeController(BookmarksMenuController);
- } catch (ex) {
- }
-
- var bt = document.getElementById("bookmarks-ptf");
- if (bt) {
- try {
- bt.database.RemoveObserver(BookmarksToolbarRDFObserver);
- } catch (ex) {
- }
- }
-#endif
try {
gPrefService.removeObserver(gAutoHideTabbarPrefListener.domain,
gAutoHideTabbarPrefListener);
gPrefService.removeObserver(gHomeButton.prefDomain, gHomeButton);
} catch (ex) {
Components.utils.reportError(ex);
}
@@ -1295,22 +1240,16 @@ function nonBrowserWindowStartup()
gNavigatorBundle = document.getElementById("bundle_browser");
setTimeout(nonBrowserWindowDelayedStartup, 0);
}
function nonBrowserWindowDelayedStartup()
{
- // loads the services
-#ifndef MOZ_PLACES_BOOKMARKS
- initServices();
- initBMService();
-#endif
-
// init global pref service
gPrefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch2);
// Set up Sanitize Item
gSanitizeListener = new SanitizeListener();
}
#endif
@@ -1622,191 +1561,16 @@ function loadOneOrMoreURIs(aURIString)
// so that we don't disrupt startup
try {
gBrowser.loadTabs(aURIString.split("|"), false, true);
}
catch (e) {
}
}
-#ifndef MOZ_PLACES
-function constructGoMenuItem(goMenu, beforeItem, url, title)
-{
- var menuitem = document.createElementNS(kXULNS, "menuitem");
- menuitem.setAttribute("statustext", url);
- menuitem.setAttribute("label", title);
- goMenu.insertBefore(menuitem, beforeItem);
- return menuitem;
-}
-
-function onGoMenuHidden(aEvent)
-{
- if (aEvent.target == aEvent.currentTarget)
- setTimeout(destroyGoMenuItems, 0, document.getElementById('goPopup'));
-}
-
-function destroyGoMenuItems(goMenu) {
- var startSeparator = document.getElementById("startHistorySeparator");
- var endSeparator = document.getElementById("endHistorySeparator");
- endSeparator.hidden = true;
-
- // Destroy the items.
- var destroy = false;
- for (var i = 0; i < goMenu.childNodes.length; i++) {
- var item = goMenu.childNodes[i];
- if (item == endSeparator)
- break;
-
- if (destroy) {
- i--;
- goMenu.removeChild(item);
- }
-
- if (item == startSeparator)
- destroy = true;
- }
-}
-
-function updateGoMenu(aEvent, goMenu)
-{
- if (aEvent.target != aEvent.currentTarget)
- return;
-
- // In case the timer didn't fire.
- destroyGoMenuItems(goMenu);
-
- // enable/disable RCT sub menu
- // do this here, before the early return
- HistoryMenu.toggleRecentlyClosedTabs();
-
- var history = document.getElementById("hiddenHistoryTree");
-
- if (history.hidden) {
- history.hidden = false;
- var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"]
- .getService(Components.interfaces.nsIRDFDataSource);
- history.database.AddDataSource(globalHistory);
- }
-
- if (!history.ref)
- history.ref = "NC:HistoryRoot";
-
- var count = history.view.rowCount;
- if (count > 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 <browser/> 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)) {
gURLBar.focus();
gURLBar.select();
return;
}
#ifdef XP_MACOSX
@@ -1970,47 +1734,36 @@ function getShortcutOrURI(aURL, aPostDat
param = aURL.substr(offset + 1);
}
var engine = searchService.getEngineByAlias(keyword);
if (engine)
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)
return aURL;
var postData = "";
if (aPostDataRef && aPostDataRef.value)
postData = unescape(aPostDataRef.value);
if (/%s/i.test(shortcutURL) || /%s/i.test(postData)) {
var charset = "";
const re = /^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/;
var matches = shortcutURL.match(re);
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 = "";
if (charset)
encodedParam = escape(converFromUnicode(charset, param));
else // Default charset is UTF-8
encodedParam = encodeURIComponent(param);
@@ -2711,28 +2464,18 @@ function openHomeDialog(aURL)
}
}
var bookmarksButtonObserver = {
onDrop: function (aEvent, aXferData, aDragSession)
{
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)
{
var statusTextFld = document.getElementById("statusbar-display");
statusTextFld.label = gNavigatorBundle.getString("droponbookmarksbutton");
aDragSession.dragAction = Components.interfaces.nsIDragService.DRAGDROP_ACTION_LINK;
},
@@ -3332,41 +3075,17 @@ function BrowserToolboxCustomizeDone(aTo
}
#ifdef XP_MACOSX
// make sure to re-enable click-and-hold
if (!getBoolPref("ui.click_hold_context_menus", false))
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
window.focus();
#endif
}
var FullScreen =
@@ -3560,26 +3279,24 @@ nsBrowserStatusHandler.prototype =
if (gProxyFavIcon &&
gBrowser.mCurrentBrowser == aBrowser &&
gBrowser.userTypedValue === null)
{
// update the favicon in the URL bar
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"]
.getService(Components.interfaces.nsIFaviconService);
var uri = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService).newURI(aBrowser.mIconURL, null, null);
faviconService.setAndLoadFaviconForPage(aBrowser.currentURI, uri, false);
}
-#endif
},
onProgressChange : function (aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress)
{
if (aMaxTotalProgress > 0) {
// This is highly optimized. Don't touch this code unless
@@ -3633,20 +3350,16 @@ nsBrowserStatusHandler.prototype =
else if (aStateFlags & nsIWebProgressListener.STATE_STOP) {
if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
if (aWebProgress.DOMWindow == content) {
if (aRequest)
this.endDocumentLoad(aRequest, aStatus);
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
}
}
// This (thanks to the filter) is a network stop or the last
// request stop outside of loading the document, stop throbbers
// and progress bars and such
if (aRequest) {
var msg = "";
@@ -4433,31 +4146,20 @@ function asyncOpenWebPanel(event)
loadURI(url, null, postData.value, false);
event.preventDefault();
return false;
}
else if (linkNode.getAttribute("rel") == "sidebar") {
// 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") {
// Used in WinIE as a way of transiently loading pages in a sidebar. We
// mimic that WinIE functionality here and also load the page transiently.
// DISALLOW_INHERIT_PRINCIPAL is used here in order to also
// block javascript and data: links targeting the sidebar.
@@ -5157,34 +4859,19 @@ function AddKeywordForSearchField()
var postData;
if (isURLEncoded)
postData = formData.join("&");
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) {
aWindow.document.dir = (aWindow.document.dir == "ltr" ? "rtl" : "ltr");
for (var run = 0; run < aWindow.frames.length; run++)
SwitchDocumentDirection(aWindow.frames[run]);
}
@@ -5442,38 +5129,16 @@ var FeedHandler = {
Ci.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL);
var feedURI = makeURI(href, document.characterSet);
// Use the feed scheme so X-Moz-Is-Feed will be set
// The value doesn't matter
if (/^https?/.test(feedURI.scheme))
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;
try {
openUILink(href, event, false, true, false, null);
}
finally {
// We might default to a livebookmarks modal dialog,
@@ -5566,19 +5231,17 @@ var FeedHandler = {
feedButton.setAttribute("tooltiptext",
gNavigatorBundle.getString("feedHasFeedsNew"));
}
}
}
}
};
-#ifdef MOZ_PLACES
#include browser-places.js
-#endif
#include browser-contentPrefSink.js
#include browser-textZoom.js
/**
* This object is for augmenting tabs
*/
var AugmentTabs = {
@@ -5626,23 +5289,16 @@ var AugmentTabs = {
// only add the menu of there are tabs to restore
var ss = Cc["@mozilla.org/browser/sessionstore;1"].
getService(Ci.nsISessionStore);
AugmentTabs.undoCloseTabMenu.hidden = !(ss.getClosedTabCount(window) > 0);
}
}
};
-/**
-* 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");
// get closed-tabs from nsSessionStore
var ss = Cc["@mozilla.org/browser/sessionstore;1"].
getService(Ci.nsISessionStore);
// no restorable tabs, so disable menu
@@ -5746,19 +5402,18 @@ function undoCloseTab(aIndex) {
* Currently supported built-ins are LOCALE, APP, and any value from nsIXULAppInfo, uppercased.
*/
function formatURL(aFormat, aIsPref) {
var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
return aIsPref ? formatter.formatURLPref(aFormat) : formatter.formatURL(aFormat);
}
/**
- * 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");
gBrowser.addEventListener("TabOpen", this, true);
gBrowser.addEventListener("TabClose", this, true);
this._updateCommandState();
}
@@ -5780,21 +5435,17 @@ BookmarkAllTabsHandler.prototype = {
if (numTabs > 1)
this._command.removeAttribute("disabled");
else
this._command.setAttribute("disabled", "true");
},
doCommand: function BATH_doCommand() {
-#ifdef MOZ_PLACES_BOOKMARKS
PlacesCommandHook.bookmarkCurrentPages();
-#else
- addBookmarkAs(gBrowser, true);
-#endif
},
// nsIDOMEventListener
handleEvent: function(aEvent) {
this._updateCommandState(aEvent.type == "TabClose");
}
};
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -39,30 +39,25 @@
# 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 *****
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
-
-#ifdef MOZ_PLACES
<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
-#endif
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/toolbar.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>
-#ifdef MOZ_PLACES
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
-#endif
# All DTD information is stored in a separate file so that it can be shared by
# hiddenWindow.xul.
#include browser-doctype.inc
<window id="main-window"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
@@ -129,37 +124,19 @@
<popup id="placesContext"/>
<tooltip id="urlTooltip">
<label crop="center" flex="1"/>
</tooltip>
</popupset>
-#ifndef MOZ_PLACES
-# The hacky hidden tree used by the Go menu to build items.
-#include browser-gotreehack.inc
-#endif
-
-#ifndef MOZ_PLACES_BOOKMARKS
- <!-- bookmarks context menu -->
- <popupset>
- <menupopup id="bookmarks-context-menu"
- onpopupshowing="return BookmarksMenu.createContextMenu(event);"
- onpopuphidden ="BookmarksMenu.destroyContextMenu(event);"/>
- </popupset>
-#endif
-
<!-- bookmarks toolbar tooltip -->
<tooltip id="btTooltip" noautohide="true"
-#ifdef MOZ_PLACES_BOOKMARKS
onpopupshowing="return BookmarksEventHandler.fillInBTTooltip(document.tooltipNode)">
-#else
- onpopupshowing="return BookmarksToolbar.fillInBTTooltip(document.tooltipNode)">
-#endif
<vbox id="btTooltipTextBox" flex="1">
<label id="btTitleText" />
<label id="btUrlText" />
</vbox>
</tooltip>
<toolbox id="navigator-toolbox" class="toolbox-top" mode="icons"
defaultmode="icons">
@@ -318,76 +295,25 @@
<toolbarbutton id="print-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&printButton.label;" command="cmd_print"
tooltiptext="&printButton.tooltip;"/>
<toolbaritem id="throbber-box" title="&throbberItem.title;" align="center" pack="center">
<button id="navigator-throbber" disabled="true"/>
</toolbaritem>
-#ifdef MOZ_PLACES_BOOKMARKS
<toolbaritem flex="1" id="personal-bookmarks" title="&bookmarksItem.title;">
<hbox id="bookmarksBarContent" flex="1" type="places"
context="placesContext" asyncinit="true"
onclick="BookmarksEventHandler.onClick(event);"
oncommand="BookmarksEventHandler.onCommand(event);"
onpopupshowing="BookmarksEventHandler.onPopupShowing(event);"
ondragexit="PlacesMenuDNDController.onDragExit(event);"
tooltip="btTooltip"/>
</toolbaritem>
-#else
- <toolbaritem id="personal-bookmarks" title="&bookmarksItem.title;" flex="1"
- class="chromeclass-directories">
- <stack id="bookmarks-stack" flex="1" style="min-width:0px; width:0px; overflow: hidden;"
- onpopupshowing="BookmarksToolbar.setOpenedMenu(event);"
- onpopuphidden="BookmarksToolbar.unsetOpenedMenu(event);">
- <hbox id="bookmarks-ptf" class="bookmarks-toolbar-items" contextmenu="bookmarks-context-menu"
- flex="1" style="min-width:0px; width:0px;padding-left: 3px;"
- datasources="rdf:bookmarks rdf:files"
- template="bookmarks-template" flags="dont-test-empty"
- infer="forward-proxy"
- rdf:type="http://home.netscape.com/NC-rdf#Folder"
- onpopupshowing="BookmarksMenu.onShowMenu(event.target)"
- onpopuphidden="BookmarksMenu.onHideMenu(event.target)"
- oncommand="BookmarksMenu.loadBookmark(event, event.target, this.database)"
- onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
- ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
- ondragdrop="nsDragAndDrop.drop(event, BookmarksMenuDNDObserver); event.stopPropagation()"
- ondragenter="nsDragAndDrop.dragEnter(event, BookmarksMenuDNDObserver); event.stopPropagation()"
- ondragexit="nsDragAndDrop.dragExit(event, BookmarksMenuDNDObserver); event.stopPropagation()"
- ondragover="nsDragAndDrop.dragOver(event, BookmarksMenuDNDObserver); event.stopPropagation()">
- </hbox>
- <hbox class="bookmarks-toolbar-overflow-items" mousethrough="always">
- <hbox mousethrough="always" id="overflow-padder"/>
- <toolbarbutton id="bookmarks-chevron" type="menu" class="chevron"
- chromedir="&locale.dir;"
- mousethrough="never" collapsed="true"
- datasources="rdf:bookmarks rdf:files"
- template="bookmarks-template" flags="dont-test-empty"
- onpopupshowing="BookmarksMenu.onShowMenu(event.target)"
- onpopuphidden="BookmarksMenu.onHideMenu(event.target)"
- oncommand="BookmarksMenu.loadBookmark(event, event.target, this.database)"
- onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
- ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
- ondragdrop="nsDragAndDrop.drop(event, BookmarksMenuDNDObserver); event.stopPropagation()"
- ondragenter="nsDragAndDrop.dragEnter(event, BookmarksMenuDNDObserver); event.stopPropagation()"
- ondragexit="nsDragAndDrop.dragExit(event, BookmarksMenuDNDObserver); event.stopPropagation()"
- ondragover="nsDragAndDrop.dragOver(event, BookmarksMenuDNDObserver); event.stopPropagation()">
- <menupopup onpopupshowing="if (event.target == this) BookmarksToolbar.updateOverflowMenu(this);"
-#ifndef XP_MACOSX
- contextmenu="bookmarks-context-menu"
-#endif
- />
- </toolbarbutton>
- </hbox>
- <toolbarbutton class="bookmark-item bookmarks-toolbar-customize" mousethrough="never"
- label="&bookmarksToolbarItem.label;"/>
- </stack>
- </toolbaritem>
-#endif
<toolbarbutton id="downloads-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
observes="Tools:Downloads"
ondragdrop="nsDragAndDrop.drop(event, DownloadsButtonDNDObserver); event.stopPropagation()"
ondragover="nsDragAndDrop.dragOver(event, DownloadsButtonDNDObserver); event.stopPropagation()"
ondragenter="nsDragAndDrop.dragEnter(event, DownloadsButtonDNDObserver); event.stopPropagation()"
ondragexit="nsDragAndDrop.dragExit(event, DownloadsButtonDNDObserver); event.stopPropagation()"
label="&downloads.label;"
@@ -462,29 +388,22 @@
tooltiptext="&fullScreenClose.tooltip;"
oncommand="BrowserTryToCloseWindow();"/>
</hbox>
#endif
</toolbar>
<toolbarset id="customToolbars" context="toolbar-context-menu"/>
-#ifdef MOZ_PLACES_BOOKMARKS
<toolbar id="PersonalToolbar" mode="icons" iconsize="small"
class="chromeclass-directories"
context="toolbar-context-menu"
defaultset="bookmarksBarShowPlaces,personal-bookmarks"
toolbarname="&personalbarCmd.label;" accesskey="&personalbarCmd.accesskey;"
customizable="true"/>
-#else
- <toolbar id="PersonalToolbar" class="chromeclass-directories" iconsize="small"
- customizable="true" defaultset="personal-bookmarks" mode="icons"
- toolbarname="&personalbarCmd.label;" accesskey="&personalbarCmd.accesskey;"
- context="toolbar-context-menu"/>
-#endif
</toolbox>
<stack id="browser-stack" flex="1">
<hbox flex="1" id="browser">
<vbox id="sidebar-box" hidden="true" class="chromeclass-extrachrome">
<sidebarheader align="center">
<label id="sidebar-title" persist="value" flex="1" crop="end" control="sidebar"/>
<image id="sidebar-throbber"/>
--- a/browser/base/content/browserMountPoints.inc
+++ b/browser/base/content/browserMountPoints.inc
@@ -1,22 +1,12 @@
<stringbundleset id="stringbundleset"/>
<commandset id="mainCommandSet"/>
<commandset id="baseMenuCommandSet"/>
-#ifdef MOZ_PLACES_BOOKMARKS
<commandset id="placesCommands"/>
-#endif
<broadcasterset id="mainBroadcasterSet"/>
<keyset id="mainKeyset"/>
<keyset id="baseMenuKeyset"/>
-<menubar id="main-menubar"/>
-
-#ifndef MOZ_PLACES_BOOKMARKS
-<template id="bookmarks-template"/>
-#endif
-
-#ifndef MOZ_PLACES
-<tree id="hiddenHistoryTree"/>
-#endif
+<menubar id="main-menubar"/>
\ No newline at end of file
--- a/browser/base/content/global-scripts.inc
+++ b/browser/base/content/global-scripts.inc
@@ -32,25 +32,13 @@
# 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 *****
-# These are loaded by placesOverlay in places-enabled builds
-#ifndef MOZ_PLACES
-<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
-<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
-<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
-#endif
-
<script type="application/x-javascript" src="chrome://global/content/printUtils.js"/>
-
-#ifndef MOZ_PLACES_BOOKMARKS
-<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarks.js"/>
-<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarksMenu.js"/>
-#endif
<script type="application/x-javascript" src="chrome://global/content/viewZoomOverlay.js"/>
<script type="application/x-javascript" src="chrome://browser/content/browser.js"/>
<script type="application/x-javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
<script type="application/x-javascript" src="chrome://global/content/viewSourceUtils.js"/>
--- a/browser/base/content/macBrowserOverlay.xul
+++ b/browser/base/content/macBrowserOverlay.xul
@@ -35,26 +35,22 @@
# 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 *****
-#ifdef MOZ_PLACES
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
-#endif
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>
-#ifdef MOZ_PLACES
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
-#endif
# All DTD information is stored in a separate file so that it can be shared by
# hiddenWindow.xul.
#include browser-doctype.inc
<overlay id="hidden-overlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@@ -67,18 +63,13 @@
<script type="application/x-javascript">
addEventListener("load", nonBrowserWindowStartup, false);
</script>
# All sets except for popupsets (commands, keys, stringbundles and broadcasters) *must* go into the
# browser-sets.inc file for sharing with hiddenWindow.xul.
#include browser-sets.inc
-#ifndef MOZ_PLACES
-# The hacky hidden tree used by the Go menu to build items.
-#include browser-gotreehack.inc
-#endif
-
# The entire main menubar is placed into browser-menubar.inc, so that it can be shared by
# hiddenWindow.xul.
#include browser-menubar.inc
</overlay>
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -1111,50 +1111,30 @@ nsContextMenu.prototype = {
uri = uri.replace(/%LOCALE%/, escape(locale)).replace(/%VERSION%/, version);
var newWindowPref = gPrefService.getIntPref("browser.link.open_newwindow");
var where = newWindowPref == 3 ? "tab" : "window";
openUILinkIn(uri, where);
},
-#ifdef MOZ_PLACES_BOOKMARKS
bookmarkThisPage: function CM_bookmarkThisPage() {
PlacesCommandHook.bookmarkPage(this.browser);
},
bookmarkLink: function CM_bookmarkLink() {
PlacesCommandHook.bookmarkLink(this.linkURL, this.linkText());
},
addBookmarkForFrame: function CM_addBookmarkForFrame() {
var doc = this.target.ownerDocument;
var uri = this.target.ownerDocument.documentURIObject;
var description = PlacesUtils.getDescriptionFromDocument(doc);
PlacesUtils.showAddBookmarkUI(uri, doc.title, description);
},
-#else
- bookmarkThisPage: function CM_bookmarkThisPage() {
- addBookmarkAs(this.browser);
- },
-
- bookmarkLink: function CM_bookmarkLink() {
- BookmarksUtils.addBookmark(this.linkURL, this.linkText());
- },
-
- addBookmarkForFrame: function CM_addBookmarkForFrame() {
- var doc = this.target.ownerDocument;
- var uri = doc.location.href;
- var title = doc.title;
- var description = BookmarksUtils.getDescriptionFromDocument(doc);
- if (!title)
- title = uri;
- BookmarksUtils.addBookmark(uri, title, doc.charset, description);
- },
-#endif
savePageAs: function CM_savePageAs() {
saveDocument(this.browser.contentDocument);
},
sendPage: function CM_sendPage() {
MailIntegration.sendLinkForWindow(this.browser.contentWindow);
},
--- a/browser/base/content/web-panels.xul
+++ b/browser/base/content/web-panels.xul
@@ -35,46 +35,34 @@
# 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 *****
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
-#ifdef MOZ_PLACES
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
-#endif
<!DOCTYPE page [
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
<!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd">
%textcontextDTD;
]>
<page id="webpanels-window"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="load()" onunload="unload()">
-# These are loaded by placesOverlay in places-enabled builds
-#ifndef MOZ_PLACES
- <script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
- <script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
- <script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
-#endif
<script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"/>
<script type="application/x-javascript" src="chrome://browser/content/browser.js"/>
<script type="application/x-javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
<script type="application/x-javascript" src="chrome://browser/content/nsContextMenu.js"/>
<script type="application/x-javascript" src="chrome://browser/content/web-panels.js"/>
-#ifndef MOZ_PLACES_BOOKMARKS
- <script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarks.js"/>
- <script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarksMenu.js"/>
-#endif
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_browser" src="chrome://browser/locale/browser.properties"/>
</stringbundleset>
<commandset id="mainCommandset">
<command id="Browser:Back"
oncommand="getPanelBrowser().webNavigation.goBack();"
--- a/browser/build.mk
+++ b/browser/build.mk
@@ -44,19 +44,15 @@ TIERS += app
ifdef MOZ_EXTENSIONS
tier_app_dirs += extensions
endif
ifdef MOZ_BRANDING_DIRECTORY
tier_app_dirs += $(MOZ_BRANDING_DIRECTORY)
endif
-ifndef MOZ_PLACES_BOOKMARKS
-tier_app_dirs += xpfe/components/search
-endif
-
tier_app_dirs += browser
installer:
@$(MAKE) -C browser/installer installer
package:
@$(MAKE) -C browser/installer
--- a/browser/components/Makefile.in
+++ b/browser/components/Makefile.in
@@ -60,27 +60,18 @@ DIRS = \
microsummaries \
migration \
preferences \
search \
sessionstore \
shell \
sidebar \
feeds \
+ places \
$(NULL)
-ifdef MOZ_PLACES
-DIRS += places
-else
-DIRS += history
-endif
-
-ifndef MOZ_PLACES_BOOKMARKS
-DIRS += bookmarks
-endif
-
ifdef MOZ_SAFE_BROWSING
DIRS += safebrowsing
endif
DIRS += build
include $(topsrcdir)/config/rules.mk
--- a/browser/components/build/Makefile.in
+++ b/browser/components/build/Makefile.in
@@ -37,62 +37,44 @@ REQUIRES = \
microsummaries \
$(NULL)
EXPORTS = nsBrowserCompsCID.h
CPPSRCS = nsModule.cpp \
$(NULL)
-ifndef MOZ_PLACES_BOOKMARKS
-REQUIRES += bookmarks
-endif
-
ifeq ($(OS_ARCH),WINNT)
DEFINES += -DPSTOREC_DLL=\"$(subst \,\\,$(WINDIR))\\system32\\pstorec.dll\"
OS_LIBS += $(call EXPAND_LIBNAME,ole32 shell32)
endif
LOCAL_INCLUDES = \
-I$(srcdir)/../migration/src \
-I$(srcdir)/../shell/src \
-I$(srcdir)/../feeds/src \
+ -I$(srcdir)/../places/src \
$(NULL)
-ifndef MOZ_PLACES_BOOKMARKS
-LOCAL_INCLUDES += -I$(srcdir)/../bookmarks/src
-else
-LOCAL_INCLUDES += -I$(srcdir)/../places/src
-endif
-
ifeq ($(OS_ARCH),WINNT)
OS_LIBS += $(call EXPAND_LIBNAME,version)
endif
SHARED_LIBRARY_LIBS = \
../migration/src/$(LIB_PREFIX)migration_s.$(LIB_SUFFIX) \
../feeds/src/$(LIB_PREFIX)browser_feeds_s.$(LIB_SUFFIX) \
+ ../places/src/$(LIB_PREFIX)browserplaces_s.$(LIB_SUFFIX) \
$(NULL)
ifneq (,$(filter windows mac cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
SHARED_LIBRARY_LIBS += ../shell/src/$(LIB_PREFIX)shellservice_s.$(LIB_SUFFIX) \
$(NULL)
endif
-ifndef MOZ_PLACES_BOOKMARKS
-SHARED_LIBRARY_LIBS += \
- ../bookmarks/src/$(LIB_PREFIX)bookmarks_s.$(LIB_SUFFIX) \
- $(NULL)
-else
-SHARED_LIBRARY_LIBS += \
- ../places/src/$(LIB_PREFIX)browserplaces_s.$(LIB_SUFFIX) \
- $(NULL)
-endif
-
ifdef MOZ_SAFE_BROWSING
REQUIRES += safebrowsing
LOCAL_INCLUDES += -I$(srcdir)/../safebrowsing/src
SHARED_LIBRARY_LIBS += ../safebrowsing/src/$(LIB_PREFIX)safebrowsing_s.$(LIB_SUFFIX)
endif
EXTRA_DSO_LDOPTS += \
$(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib) \
--- a/browser/components/build/nsModule.cpp
+++ b/browser/components/build/nsModule.cpp
@@ -34,22 +34,17 @@
* 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 "nsIGenericFactory.h"
#include "nsBrowserCompsCID.h"
-#ifndef MOZ_PLACES_BOOKMARKS
-#include "nsBookmarksService.h"
-#include "nsForwardProxyDataSource.h"
-#else
#include "nsPlacesImportExportService.h"
-#endif
#ifdef XP_WIN
#include "nsWindowsShellService.h"
#elif defined(XP_MACOSX)
#include "nsMacShellService.h"
#elif defined(MOZ_WIDGET_GTK2)
#include "nsGNOMEShellService.h"
#endif
#include "nsProfileMigrator.h"
@@ -75,22 +70,17 @@
#include "nsAboutFeeds.h"
#include "nsIAboutModule.h"
#ifdef MOZ_SAFE_BROWSING
#include "nsDocNavStartProgressListener.h"
#endif
/////////////////////////////////////////////////////////////////////////////
-#ifndef MOZ_PLACES_BOOKMARKS
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsBookmarksService, Init)
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsForwardProxyDataSource, Init)
-#else
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPlacesImportExportService)
-#endif
#ifdef XP_WIN
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsShellService)
#elif defined(XP_MACOSX)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
#elif defined(MOZ_WIDGET_GTK2)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
#endif
#if !defined(XP_BEOS)
@@ -129,48 +119,22 @@ static const nsModuleComponentInfo compo
#elif defined(MOZ_WIDGET_GTK2)
{ "Browser Shell Service",
NS_SHELLSERVICE_CID,
NS_SHELLSERVICE_CONTRACTID,
nsGNOMEShellServiceConstructor },
#endif
-#ifndef MOZ_PLACES_BOOKMARKS
-
- { "Bookmarks",
- NS_BOOKMARKS_SERVICE_CID,
- NS_BOOKMARKS_SERVICE_CONTRACTID,
- nsBookmarksServiceConstructor },
-
- { "Bookmarks",
- NS_BOOKMARKS_SERVICE_CID,
- NS_BOOKMARKS_DATASOURCE_CONTRACTID,
- nsBookmarksServiceConstructor },
-
- { "Bookmarks",
- NS_BOOKMARKS_SERVICE_CID,
- "@mozilla.org/embeddor.implemented/bookmark-charset-resolver;1",
- nsBookmarksServiceConstructor },
-
- { "Bookmarks Forward Proxy Inference Data Source",
- NS_RDF_FORWARDPROXY_INFER_DATASOURCE_CID,
- NS_RDF_INFER_DATASOURCE_CONTRACTID_PREFIX "forward-proxy",
- nsForwardProxyDataSourceConstructor },
-
-#else
-
{ "Places Import/Export Service",
NS_PLACESIMPORTEXPORTSERVICE_CID,
NS_PLACESIMPORTEXPORTSERVICE_CONTRACTID,
nsPlacesImportExportServiceConstructor},
-#endif
-
{ "Feed Sniffer",
NS_FEEDSNIFFER_CID,
NS_FEEDSNIFFER_CONTRACTID,
nsFeedSnifferConstructor,
nsFeedSniffer::Register },
{ "about:feeds Page",
NS_ABOUTFEEDS_CID,
--- a/browser/components/dirprovider/nsBrowserDirectoryProvider.cpp
+++ b/browser/components/dirprovider/nsBrowserDirectoryProvider.cpp
@@ -108,26 +108,18 @@ nsBrowserDirectoryProvider::GetFile(cons
*aResult = nsnull;
// NOTE: This function can be reentrant through the NS_GetSpecialDirectory
// call, so be careful not to cause infinite recursion.
nsCOMPtr<nsIFile> file;
char const* leafName = nsnull;
-#ifndef MOZ_PLACES_BOOKMARKS
- PRBool restoreBookmarksBackup = PR_FALSE;
- PRBool ensureFilePermissions = PR_FALSE;
-#endif
if (!strcmp(aKey, NS_APP_BOOKMARKS_50_FILE)) {
-#ifndef MOZ_PLACES_BOOKMARKS
- ensureFilePermissions = PR_TRUE;
- restoreBookmarksBackup = PR_TRUE;
-#endif
leafName = "bookmarks.html";
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
nsCString path;
rv = prefs->GetCharPref("browser.bookmarks.file", getter_Copies(path));
if (NS_SUCCEEDED(rv)) {
NS_NewNativeLocalFile(path, PR_TRUE, (nsILocalFile**)(nsIFile**) getter_AddRefs(file));
@@ -179,49 +171,17 @@ nsBrowserDirectoryProvider::GetFile(cons
return rv;
rv = parentDir->Clone(getter_AddRefs(file));
if (NS_FAILED(rv))
return rv;
file->AppendNative(leafstr);
}
-#ifndef MOZ_PLACES_BOOKMARKS
- PRBool exists;
- rv = file->Exists(&exists);
- if (restoreBookmarksBackup && NS_SUCCEEDED(rv) && exists) {
- PRInt64 fileSize;
- file->GetFileSize(&fileSize);
- if (fileSize == 0)
- {
- file->Remove(PR_FALSE);
- exists = PR_FALSE;
- }
- }
-
- if (NS_SUCCEEDED(rv) && !exists) {
- if (!restoreBookmarksBackup ||
- NS_FAILED(RestoreBookmarksFromBackup(leafstr, parentDir, file)))
- EnsureProfileFile(leafstr, parentDir, file);
- }
-
- if (ensureFilePermissions) {
- PRBool fileToEnsureExists;
- PRBool isWritable;
- if (NS_SUCCEEDED(file->Exists(&fileToEnsureExists)) && fileToEnsureExists
- && NS_SUCCEEDED(file->IsWritable(&isWritable)) && !isWritable) {
- PRUint32 permissions;
- if (NS_SUCCEEDED(file->GetPermissions(&permissions))) {
- rv = file->SetPermissions(permissions | 0600);
- NS_ASSERTION(NS_SUCCEEDED(rv), "failed to ensure file permissions");
- }
- }
- }
-#endif
*aPersist = PR_TRUE;
NS_ADDREF(*aResult = file);
return NS_OK;
}
static void
AppendFileKey(const char *key, nsIProperties* aDirSvc,
@@ -333,62 +293,16 @@ static const nsModuleComponentInfo compo
kContractID,
nsBrowserDirectoryProviderConstructor,
nsBrowserDirectoryProvider::Register,
nsBrowserDirectoryProvider::Unregister
}
};
NS_IMPL_NSGETMODULE(BrowserDirProvider, components)
-#ifndef MOZ_PLACES_BOOKMARKS
-nsresult
-nsBrowserDirectoryProvider::RestoreBookmarksFromBackup(const nsACString& aLeafName,
- nsIFile* aParentDir,
- nsIFile* aTarget)
-{
- nsresult rv;
-
- nsCOMPtr<nsIFile> backupFile;
- rv = aParentDir->Clone(getter_AddRefs(backupFile));
- if (NS_FAILED(rv))
- return rv;
-
- backupFile->AppendNative(nsDependentCString("bookmarks.bak"));
-
- PRBool exists;
- rv = backupFile->Exists(&exists);
- if (NS_FAILED(rv) || !exists)
- return NS_ERROR_FAILURE;
-
- return backupFile->CopyToNative(aParentDir, aLeafName);
-}
-
-void
-nsBrowserDirectoryProvider::EnsureProfileFile(const nsACString& aLeafName,
- nsIFile* aParentDir,
- nsIFile* aTarget)
-{
- nsresult rv;
-
- nsCOMPtr<nsIFile> defaults;
- rv = NS_GetSpecialDirectory(NS_APP_PROFILE_DEFAULTS_50_DIR,
- getter_AddRefs(defaults));
- if (NS_FAILED(rv))
- return;
-
- defaults->AppendNative(aLeafName);
-
- PRBool exists;
- rv = defaults->Exists(&exists);
- if (NS_FAILED(rv) || !exists)
- return;
-
- defaults->CopyToNative(aParentDir, aLeafName);
-}
-#endif
NS_IMPL_ISUPPORTS1(nsBrowserDirectoryProvider::AppendingEnumerator,
nsISimpleEnumerator)
NS_IMETHODIMP
nsBrowserDirectoryProvider::AppendingEnumerator::HasMoreElements(PRBool *aResult)
{
*aResult = mNext ? PR_TRUE : PR_FALSE;
return NS_OK;
--- a/browser/components/feeds/src/FeedConverter.js
+++ b/browser/components/feeds/src/FeedConverter.js
@@ -385,21 +385,17 @@ var FeedResultService = {
// "web" should have been handled elsewhere
LOG("unexpected handler: " + handler);
// fall through
case "bookmarks":
var wm =
Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
var topWindow = wm.getMostRecentWindow("navigator:browser");
-#ifdef MOZ_PLACES_BOOKMARKS
topWindow.PlacesCommandHook.addLiveBookmark(spec, title, subtitle);
-#else
- topWindow.FeedHandler.addLiveBookmark(spec, title, subtitle);
-#endif
break;
}
},
/**
* See nsIFeedService.idl
*/
addFeedResult: function FRS_addFeedResult(feedResult) {
--- a/browser/components/feeds/src/FeedWriter.js
+++ b/browser/components/feeds/src/FeedWriter.js
@@ -90,22 +90,18 @@ const PREF_SHOW_FIRST_RUN_UI = "browser.
const FW_CLASSID = Components.ID("{49bb6593-3aff-4eb3-a068-2712c28bd58e}");
const FW_CLASSNAME = "Feed Writer";
const FW_CONTRACTID = "@mozilla.org/browser/feeds/result-writer;1";
const TITLE_ID = "feedTitleText";
const SUBTITLE_ID = "feedSubtitleText";
-#ifdef MOZ_PLACES
const NH_CONTRACTID = "@mozilla.org/browser/nav-history-service;1";
const FAV_CONTRACTID = "@mozilla.org/browser/favicon-service;1";
-#else
-const ICON_DATAURL_PREFIX = "data:image/x-icon;base64,";
-#endif
function FeedWriter() {
}
FeedWriter.prototype = {
_getPropertyAsBag: function FW__getPropertyAsBag(container, property) {
return container.fields.getProperty(property).
QueryInterface(Ci.nsIPropertyBag2);
},
@@ -148,27 +144,25 @@ FeedWriter.prototype = {
// the rules specified in |flags|, so we'll never "linkify" the link...
element.setAttribute(attribute, uri);
}
catch (e) {
// Not allowed to load this link because secman.checkLoadURIStr threw
}
},
-#ifdef MOZ_PLACES
__faviconService: null,
get _faviconService() {
if (!this.__faviconService) {
this.__faviconService =
Cc[FAV_CONTRACTID].getService(Ci.nsIFaviconService);
}
return this.__faviconService;
},
-#endif
__bundle: null,
get _bundle() {
if (!this.__bundle) {
this.__bundle = Cc["@mozilla.org/intl/stringbundle;1"].
getService(Ci.nsIStringBundleService).
createBundle(URI_BUNDLE);
}
@@ -708,20 +702,18 @@ FeedWriter.prototype = {
menuItem.id = "chooseApplicationMenuItem";
menuItem.setAttribute("label", this._getString("chooseApplicationMenuItem"));
handlersMenuPopup.appendChild(menuItem);
// separator
handlersMenuPopup.appendChild(this._document.createElementNS(XUL_NS,
"menuseparator"));
-#ifdef MOZ_PLACES
var historySvc = Cc[NH_CONTRACTID].getService(Ci.nsINavHistoryService);
historySvc.addObserver(this, false);
-#endif
// List of web handlers
var wccr =
Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"].
getService(Ci.nsIWebContentConverterService);
var handlers = wccr.getContentHandlers(TYPE_MAYBE_FEED, {});
if (handlers.length != 0) {
for (var i = 0; i < handlers.length; ++i) {
@@ -730,27 +722,22 @@ FeedWriter.prototype = {
menuItem.setAttribute("label", handlers[i].name);
menuItem.setAttribute("handlerType", "web");
menuItem.setAttribute("webhandlerurl", handlers[i].uri);
handlersMenuPopup.appendChild(menuItem);
// For privacy reasons we cannot set the image attribute directly
// to the icon url, see Bug 358878
var uri = makeURI(handlers[i].uri);
-#ifdef MOZ_PLACES
if (!this._setFaviconForWebReader(uri, menuItem)) {
if (uri && /^https?/.test(uri.scheme)) {
var iconURL = makeURI(uri.prePath + "/favicon.ico");
this._faviconService.setAndLoadFaviconForPage(uri, iconURL, true);
}
}
-#else
- if (uri && /^https?/.test(uri.scheme))
- new iconDataURIGenerator(uri.prePath + "/favicon.ico", menuItem);
-#endif
}
}
this._setSelectedHandler();
// "Always use..." checkbox initial state
this._setAlwaysUseCheckedState();
this._setAlwaysUseLabel();
@@ -866,20 +853,18 @@ FeedWriter.prototype = {
Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch2);
prefs.removeObserver(PREF_SELECTED_ACTION, this);
prefs.removeObserver(PREF_SELECTED_READER, this);
prefs.removeObserver(PREF_SELECTED_WEB, this);
prefs.removeObserver(PREF_SELECTED_APP, this);
this._removeFeedFromCache();
-#ifdef MOZ_PLACES
var historySvc = Cc[NH_CONTRACTID].getService(Ci.nsINavHistoryService);
historySvc.removeObserver(this);
-#endif
},
_removeFeedFromCache: function FW__removeFeedFromCache() {
if (this._feedURI) {
var feedService =
Cc["@mozilla.org/browser/feeds/result-service;1"].
getService(Ci.nsIFeedResultService);
feedService.removeFeedResult(this._feedURI);
@@ -986,17 +971,16 @@ FeedWriter.prototype = {
this._setSelectedHandler();
break;
case PREF_SELECTED_ACTION:
this._setAlwaysUseCheckedState();
}
}
},
-#ifdef MOZ_PLACES
/**
* Sets the icon for the given web-reader item in the readers menu
* if the favicon-service has the necessary icon stored.
* @param aURI
* the reader URI.
* @param aMenuItem
* the reader item in the readers menulist.
* @return true if the icon was set, false otherwise.
@@ -1046,17 +1030,16 @@ FeedWriter.prototype = {
onBeginUpdateBatch: function() { },
onEndUpdateBatch: function() { },
onVisit: function() { },
onTitleChanged: function() { },
onDeleteURI: function() { },
onClearHistory: function() { },
onPageExpired: function() { },
-#endif
/**
* See nsIClassInfo
*/
getInterfaces: function WCCR_getInterfaces(countRef) {
var interfaces =
[Ci.nsIFeedWriter, Ci.nsIClassInfo, Ci.nsISupports];
countRef.value = interfaces.length;
@@ -1071,132 +1054,23 @@ FeedWriter.prototype = {
implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
flags: Ci.nsIClassInfo.DOM_OBJECT,
QueryInterface: function FW_QueryInterface(iid) {
if (iid.equals(Ci.nsIFeedWriter) ||
iid.equals(Ci.nsIClassInfo) ||
iid.equals(Ci.nsIDOMEventListener) ||
iid.equals(Ci.nsIObserver) ||
-#ifdef MOZ_PLACES
iid.equals(Ci.nsINavHistoryObserver) ||
-#endif
iid.equals(Ci.nsISupports))
return this;
throw Cr.NS_ERROR_NO_INTERFACE;
}
};
-#ifndef MOZ_PLACES
-function iconDataURIGenerator(aURISpec, aElement) {
- var ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- var chan = ios.newChannelFromURI(makeURI(aURISpec));
- chan.notificationCallbacks = this;
- chan.asyncOpen(this, null);
-
- this._channel = chan;
- this._bytes = [];
- this._element = aElement;
-}
-iconDataURIGenerator.prototype = {
- _channel: null,
- _countRead: 0,
- _stream: null,
-
- QueryInterface: function FW_IDUG_loadQI(aIID) {
- if (aIID.equals(Ci.nsISupports) ||
- aIID.equals(Ci.nsIRequestObserver) ||
- aIID.equals(Ci.nsIStreamListener) ||
- aIID.equals(Ci.nsIChannelEventSink) ||
- aIID.equals(Ci.nsIInterfaceRequestor) ||
- aIID.equals(Ci.nsIBadCertListener) ||
- // See bug 358878 comment 11
- aIID.equals(Ci.nsIPrompt) ||
- // See FIXME comment below
- aIID.equals(Ci.nsIHttpEventSink) ||
- aIID.equals(Ci.nsIProgressEventSink) ||
- false)
- return this;
-
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
-
- // nsIRequestObserver
- onStartRequest: function FW_IDUG_loadStartR(aRequest, aContext) {
- this._stream = Cc["@mozilla.org/binaryinputstream;1"].
- createInstance(Ci.nsIBinaryInputStream);
- },
-
- onStopRequest: function FW_IDUG_loadStopR(aRequest, aContext, aStatusCode) {
- var requestFailed = !Components.isSuccessCode(aStatusCode);
- if (!requestFailed && (aRequest instanceof Ci.nsIHttpChannel))
- requestFailed = !aRequest.requestSucceeded;
-
- if (!requestFailed && this._countRead != 0) {
- var str = String.fromCharCode.apply(null, this._bytes);
- try {
- var dataURI = ICON_DATAURL_PREFIX + btoa(str);
- this._element.setAttribute("image", dataURI);
- }
- catch(ex) {}
- }
- this._channel = null;
- this._element = null;
- },
-
- // nsIStreamListener
- onDataAvailable: function FW_IDUG_loadDAvailable(aRequest, aContext,
- aInputStream, aOffset,
- aCount) {
- this._stream.setInputStream(aInputStream);
-
- // Get a byte array of the data
- this._bytes = this._bytes.concat(this._stream.readByteArray(aCount));
- this._countRead += aCount;
- },
-
- // nsIChannelEventSink
- onChannelRedirect: function FW_IDUG_loadCRedirect(aOldChannel, aNewChannel,
- aFlags) {
- this._channel = aNewChannel;
- },
-
- // nsIInterfaceRequestor
- getInterface: function FW_IDUG_load_GI(aIID) {
- return this.QueryInterface(aIID);
- },
-
- // nsIBadCertListener
- confirmUnknownIssuer: function FW_IDUG_load_CUI(aSocketInfo, aCert,
- aCertAddType) {
- return false;
- },
-
- confirmMismatchDomain: function FW_IDUG_load_CMD(aSocketInfo, aTargetURL,
- aCert) {
- return false;
- },
-
- confirmCertExpired: function FW_IDUG_load_CCE(aSocketInfo, aCert) {
- return false;
- },
-
- notifyCrlNextupdate: function FW_IDUG_load_NCN(aSocketInfo, aTargetURL, aCert) {
- },
-
- // FIXME: bug 253127
- // nsIHttpEventSink
- onRedirect: function (aChannel, aNewChannel) { },
- // nsIProgressEventSink
- onProgress: function (aRequest, aContext, aProgress, aProgressMax) { },
- onStatus: function (aRequest, aContext, aStatus, aStatusArg) { }
-};
-#endif
-
var Module = {
QueryInterface: function M_QueryInterface(iid) {
if (iid.equals(Ci.nsIModule) ||
iid.equals(Ci.nsISupports))
return this;
throw Cr.NS_ERROR_NO_INTERFACE;
},
--- a/browser/components/microsummaries/public/Makefile.in
+++ b/browser/components/microsummaries/public/Makefile.in
@@ -39,15 +39,11 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = microsummaries
XPIDL_MODULE = microsummaries
-ifdef MOZ_PLACES_BOOKMARKS
XPIDLSRCS = nsIMicrosummaryService.idl
-else
-XPIDLSRCS = nsIMicrosummaryServiceNonPlaces.idl
-endif
include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/browser/components/microsummaries/public/nsIMicrosummaryServiceNonPlaces.idl
+++ /dev/null
@@ -1,355 +0,0 @@
-
-#include "nsISupports.idl"
-
-interface nsIDOMDocument;
-interface nsIDOMNode;
-interface nsIURI;
-interface nsISimpleEnumerator;
-interface nsIMicrosummary;
-
-[scriptable, uuid(cb284a83-1ca5-4000-9841-ce345ce84915)]
-interface nsIMicrosummaryObserver : nsISupports
-{
- /**
- * Called when an observed microsummary updates its content.
- * Since an observer might watch multiple microsummaries at the same time,
- * the microsummary whose content has been updated gets passed
- * to this handler.
- * XXX Should this be onContentUpdated?
- *
- * @param microsummary
- * the microsummary whose content has just been updated
- *
- */
- void onContentLoaded(in nsIMicrosummary microsummary);
-
- /**
- * Called when an element is appended to a microsummary set.
- * XXX Should this be in a separate nsICollectionObserver interface?
- *
- * @param microsummary
- * the microsummary that has just been appended to the set
- *
- */
- void onElementAppended(in nsIMicrosummary microsummary);
-};
-
-
-[scriptable, uuid(05b48344-d0a7-427e-934e-9a6e0d5ecced)]
-interface nsIMicrosummaryGenerator : nsISupports
-{
- // Has the generator itself, which may be a remote resource, been loaded.
- readonly attribute boolean loaded;
-
- // An arbitrary descriptive name for this microsummary generator.
- readonly attribute AUTF8String name;
-
- // The canonical location and unique identifier of the generator.
- // It tells us where the generator comes from and where to go for updates.
- //
- // For generators referenced by web pages via <link> tags, this URI is
- // the URL specified by the tag.
- //
- // For generators installed via nsSidebar::addMicrosummaryGenerator,
- // this URI is a URN of the form urn:source:<url>, where <url> is the
- // remote location from which we installed the generator.
- //
- // For generators installed via some other mechanism (f.e. an extension
- // that dynamically creates generators), this URI is a URN in a form
- // of the extension's own choosing, with the only restriction being that
- // the URI be globally unique. To ensure this, we recommend that such
- // extensions incorporate UUIDs created by nsUUIDGenerator into the URNs
- // of the generators they create.
- readonly attribute nsIURI uri;
-
- /**
- * microsummary-generator equivalence test
- * generators equal if their canonical locations equal, see uri attribute.
- */
- boolean equals(in nsIMicrosummaryGenerator aOther);
-
- // For generators installed by the user or bundled with the browser, the
- // local URI points to the location of the local file containing the
- // generator's XML.
- readonly attribute nsIURI localURI;
-
- // Whether or not this generator needs page content to generate
- // a microsummary. Microsummaries generated by XSLT templates need page
- // content, while those which represent the actual microsummary content
- // do not.
- readonly attribute boolean needsPageContent;
-
- /**
- * Generate a microsummary by processing the generator template
- * against the page content. If a generator doesn't need content,
- * pass null as the parameter to this method.
- *
- * XXX In the future, this should support returning rich text content,
- * so perhaps we should make it return a DOM node now and have the caller
- * convert that to text if it doesn't support rich content.
- *
- * @param pageContent
- * the content of the page being summarized
- * @returns the text result of processing the template
- *
- */
- AString generateMicrosummary(in nsIDOMNode aPageContent);
-
- /**
- * Calculate the interval until the microsummary should be updated for
- * the next time, depending on the page content. If the generator doesn't
- * specify an interval, null is returned.
- *
- * @param pageContent
- * the content of the page being summarized
- * @returns the interval in milliseconds until the next update request
- *
- */
- long calculateUpdateInterval(in nsIDOMNode aPageContent);
-};
-
-
-[scriptable, uuid(a999eabf-68f9-45c2-919f-2ad33777e3e3)]
-interface nsIMicrosummary : nsISupports
-{
- // the URI of the page being summarized
- readonly attribute nsIURI pageURI;
-
- // The generator that generates this microsummary. May need to be loaded.
- attribute nsIMicrosummaryGenerator generator;
-
- // The content of the microsummary.
- // Since generators and pages can be remote resources, and we need them
- // to generate the content, this may not always be available.
- readonly attribute AString content;
-
- // The minimum interval after which this microsummary would like to be refreshed
- // (or null if it doesn't care).
- readonly attribute long updateInterval;
-
- /**
- * Add a microsummary observer to this microsummary.
- *
- * @param observer
- * the microsummary observer to add
- *
- */
- void addObserver(in nsIMicrosummaryObserver observer);
-
- /**
- * Remove a microsummary observer from this microsummary.
- *
- * @param observer
- * the microsummary observer to remove
- *
- */
- void removeObserver(in nsIMicrosummaryObserver observer);
-
- /**
- * Microsummary equivalence test
- * Microsummaries equal if they summarize the same page with the same
- * microsummary-generator (see also nsIMicrosummaryGenerator::equals).
- *
- * Note: this method returns false if either objects don't have a generator
- */
- boolean equals(in nsIMicrosummary aOther);
-
- /**
- * Update the microsummary, first loading its generator and page content
- * as necessary. If you want know when a microsummary finishes updating,
- * add an observer before calling this method.
- *
- */
- void update();
-};
-
-[scriptable, uuid(7111e88d-fecd-4b17-b7a9-1fa74e23153f)]
-interface nsIMicrosummarySet : nsISupports
-{
- /**
- * Add a microsummary observer to this microsummary set. Adding an observer
- * to a set is the equivalent of adding it to each constituent microsummary.
- *
- * @param observer
- * the microsummary observer to add
- *
- */
- void addObserver(in nsIMicrosummaryObserver observer);
-
- /**
- * Remove a microsummary observer from this microsummary.
- *
- * @param observer
- * the microsummary observer to remove
- *
- */
- void removeObserver(in nsIMicrosummaryObserver observer);
-
- /**
- * Retrieve a enumerator of microsummaries in the set.
- *
- * @returns an enumerator of nsIMicrosummary objects
- *
- */
- nsISimpleEnumerator Enumerate();
-};
-
-
-[scriptable, uuid(edec7c28-4b06-4692-842f-8bf238e61ac1)]
-interface nsIMicrosummaryService : nsISupports
-{
- /**
- * Install the microsummary generator from the resource at the supplied URI.
- * Callable by content via the addMicrosummaryGenerator() sidebar method.
- *
- * @param generatorURI
- * the URI of the resource providing the generator
- *
- */
- void addGenerator(in nsIURI generatorURI);
-
- /**
- * Install the microsummary generator in the given XML definition.
- *
- * @param xmlDefinition
- * an nsIDOMDocument XML document defining the generator
- *
- * @returns the newly-installed nsIMicrosummaryGenerator object
- *
- */
- nsIMicrosummaryGenerator installGenerator(in nsIDOMDocument xmlDefinition);
-
- /**
- * Get the set of bookmarks with microsummaries.
- *
- * In the old RDF-based bookmarks datastore, bookmark IDs are nsIRDFResource
- * objects. In the new Places-based datastore, they are nsIURI objects.
- *
- * @returns an nsISimpleEnumerator enumeration of bookmark IDs
- *
- */
- nsISimpleEnumerator getBookmarks();
-
- /**
- * Get the set of microsummaries available for a given page. The set
- * might change after this method returns, since this method will trigger
- * an asynchronous load of the page in question (if it isn't already loaded)
- * to see if it references any page-specific microsummaries.
- *
- * If the caller passes a bookmark ID, and one of the microsummaries
- * is the current one for the bookmark, this method will retrieve content
- * from the datastore for that microsummary, which is useful when callers
- * want to display a list of microsummaries for a page that isn't loaded,
- * and they want to display the actual content of the selected microsummary
- * immediately (rather than after the content is asynchronously loaded).
- *
- * @param pageURI
- * the URI of the page for which to retrieve available microsummaries
- *
- * @param bookmarkID (optional)
- * the ID of the bookmark for which this method is being called
- *
- * @returns an nsIMicrosummarySet of nsIMicrosummaries for the given page
- *
- */
- nsIMicrosummarySet getMicrosummaries(in nsIURI pageURI,
- in nsISupports bookmarkID);
-
- /**
- * Get the current microsummary for the given bookmark.
- *
- * @param bookmarkID
- * the bookmark for which to get the current microsummary
- *
- * @returns the current microsummary for the bookmark, or null
- * if the bookmark does not have a current microsummary
- *
- */
- nsIMicrosummary getMicrosummary(in nsISupports bookmarkID);
-
- /**
- * Set the current microsummary for the given bookmark.
- *
- * @param bookmarkID
- * the bookmark for which to set the current microsummary
- *
- * @param microsummary
- * the microsummary to set as the current one
- *
- */
- void setMicrosummary(in nsISupports bookmarkID,
- in nsIMicrosummary microsummary);
-
- /**
- * Remove the current microsummary for the given bookmark.
- *
- * @param bookmarkID
- * the bookmark for which to remove the current microsummary
- *
- */
- void removeMicrosummary(in nsISupports bookmarkID);
-
- /**
- * Whether or not the given bookmark has a current microsummary.
- *
- * @param bookmarkID
- * the bookmark for which to set the current microsummary
- *
- * @returns a boolean representing whether or not the given bookmark
- * has a current microsummary
- *
- */
- boolean hasMicrosummary(in nsISupports bookmarkID);
-
- /**
- * Whether or not the given microsummary is the current microsummary
- * for the given bookmark.
- *
- * @param bookmarkID
- * the bookmark to check
- *
- * @param microsummary
- * the microsummary to check
- *
- * @returns whether or not the microsummary is the current one
- * for the bookmark
- *
- */
- boolean isMicrosummary(in nsISupports bookmarkID,
- in nsIMicrosummary microsummary);
-
- /**
- * Refresh a microsummary, updating its value in the datastore and UI.
- * If this method can refresh the microsummary instantly, it will.
- * Otherwise, it'll asynchronously download the necessary information
- * (the generator and/or page) before refreshing the microsummary.
- *
- * Callers should check the "content" property of the returned microsummary
- * object to distinguish between sync and async refreshes. If its value
- * is "null", then it's an async refresh, and the caller should register
- * itself as an nsIMicrosummaryObserver via nsIMicrosummary.addObserver()
- * to find out when the refresh completes.
- *
- * @param bookmarkID
- * the bookmark whose microsummary is being refreshed
- *
- * @returns the microsummary being refreshed
- *
- */
- nsIMicrosummary refreshMicrosummary(in nsISupports bookmarkID);
-};
-
-[scriptable, uuid(f9e577a8-19d9-4ca0-a140-b9e43f014470)]
-interface nsILiveTitleNotificationSubject : nsISupports
-{
- // The ID of the bookmark displaying this title.
- // Note: in the old bookmarks code, this is an RDF resource. In Places
- // it is currently a URI, but after the fix for bug 360133 lands it will
- // become an integer.
- readonly attribute nsISupports bookmarkID;
-
- // The microsummary being displayed as the live title for the bookmark.
- // The actual value of the microsummary (i.e. the string that gets displayed
- // to the user) is stored in the content property of this object.
- readonly attribute nsIMicrosummary microsummary;
-};
--- a/browser/components/microsummaries/src/nsMicrosummaryService.js
+++ b/browser/components/microsummaries/src/nsMicrosummaryService.js
@@ -51,43 +51,28 @@ const NS_ERROR_MODULE_DOM = 2152923136;
const NS_ERROR_DOM_BAD_URI = NS_ERROR_MODULE_DOM + 1012;
// How often to check for microsummaries that need updating, in milliseconds.
const CHECK_INTERVAL = 15 * 1000; // 15 seconds
const MICSUM_NS = new Namespace("http://www.mozilla.org/microsummaries/0.1");
const XSLT_NS = new Namespace("http://www.w3.org/1999/XSL/Transform");
-#ifdef MOZ_PLACES_BOOKMARKS
const FIELD_MICSUM_GEN_URI = "microsummary/generatorURI";
const FIELD_MICSUM_EXPIRATION = "microsummary/expiration";
const FIELD_GENERATED_TITLE = "bookmarks/generatedTitle";
const FIELD_CONTENT_TYPE = "bookmarks/contentType";
-#else
-const NC_NS = "http://home.netscape.com/NC-rdf#";
-const RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
-const FIELD_RDF_TYPE = RDF_NS + "type";
-const VALUE_MICSUM_BOOKMARK = NC_NS + "MicsumBookmark";
-const VALUE_NORMAL_BOOKMARK = NC_NS + "Bookmark";
-const FIELD_MICSUM_GEN_URI = NC_NS + "MicsumGenURI";
-const FIELD_MICSUM_EXPIRATION = NC_NS + "MicsumExpiration";
-const FIELD_GENERATED_TITLE = NC_NS + "GeneratedTitle";
-const FIELD_CONTENT_TYPE = NC_NS + "ContentType";
-const FIELD_BOOKMARK_URL = NC_NS + "URL";
-#endif
const MAX_SUMMARY_LENGTH = 4096;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
function MicrosummaryService() { this._init() }
MicrosummaryService.prototype = {
-
-#ifdef MOZ_PLACES_BOOKMARKS
// Bookmarks Service
__bms: null,
get _bms() {
if (!this.__bms)
this.__bms = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
return this.__bms;
},
@@ -95,42 +80,16 @@ MicrosummaryService.prototype = {
// Annotation Service
__ans: null,
get _ans() {
if (!this.__ans)
this.__ans = Cc["@mozilla.org/browser/annotation-service;1"].
getService(Ci.nsIAnnotationService);
return this.__ans;
},
-#else
- // RDF Service
- __rdf: null,
- get _rdf() {
- if (!this.__rdf)
- this.__rdf = Cc["@mozilla.org/rdf/rdf-service;1"].
- getService(Ci.nsIRDFService);
- return this.__rdf;
- },
-
- // Bookmarks Data Source
- __bmds: null,
- get _bmds() {
- if (!this.__bmds)
- this.__bmds = this._rdf.GetDataSource("rdf:bookmarks");
- return this.__bmds;
- },
-
- // Old Bookmarks Service
- __bms: null,
- get _bms() {
- if (!this.__bms)
- this.__bms = this._bmds.QueryInterface(Ci.nsIBookmarksService);
- return this.__bms;
- },
-#endif
// IO Service
__ios: null,
get _ios() {
if (!this.__ios)
this.__ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return this.__ios;
@@ -150,38 +109,16 @@ MicrosummaryService.prototype = {
* @param spec
* The string spec of the URI.
* @returns An nsIURI object.
*/
_uri: function MSS__uri(spec) {
return this._ios.newURI(spec, null, null);
},
-#ifndef MOZ_PLACES_BOOKMARKS
- /**
- * Make an RDF resource from a URI spec.
- * @param uriSpec
- * The URI spec to convert into a resource.
- * @returns An nsIRDFResource object.
- */
- _resource: function MSS__resource(uriSpec) {
- return this._rdf.GetResource(uriSpec);
- },
-
- /**
- * Make an RDF literal from a string.
- * @param str
- * The string from which to construct the literal.
- * @returns An nsIRDFLiteral object
- */
- _literal: function MSS__literal(str) {
- return this._rdf.GetLiteral(str);
- },
-#endif
-
// Directory Locator
__dirs: null,
get _dirs() {
if (!this.__dirs)
this.__dirs = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);
return this.__dirs;
},
@@ -293,21 +230,17 @@ MicrosummaryService.prototype = {
_updateMicrosummary: function MSS__updateMicrosummary(bookmarkID, microsummary) {
// Get the current live title to see if it's actually changed.
var oldValue = null;
if (this._hasField(bookmarkID, FIELD_GENERATED_TITLE))
oldValue = this._getField(bookmarkID, FIELD_GENERATED_TITLE);
// A string identifying the bookmark to use when logging the update.
-#ifdef MOZ_PLACES_BOOKMARKS
var bookmarkIdentity = bookmarkID;
-#else
- var bookmarkIdentity = bookmarkID.Value + " (" + microsummary.pageURI.spec + ")";
-#endif
if (oldValue == null || oldValue != microsummary.content) {
this._setField(bookmarkID, FIELD_GENERATED_TITLE, microsummary.content);
var subject = new LiveTitleNotificationSubject(bookmarkID, microsummary);
LOG("updated live title for " + bookmarkIdentity +
" from '" + (oldValue == null ? "<no live title>" : oldValue) +
"' to '" + microsummary.content + "'");
this._obs.notifyObservers(subject, "microsummary-livetitle-updated", oldValue);
@@ -616,34 +549,26 @@ MicrosummaryService.prototype = {
for (var genURISpec in this._localGenerators) {
var generator = this._localGenerators[genURISpec];
if (generator.appliesToURI(pageURI)) {
var microsummary = new Microsummary(pageURI, generator);
// If this is the current microsummary for this bookmark, load the content
// from the datastore so it shows up immediately in microsummary picking UI.
-#ifdef MOZ_PLACES_BOOKMARKS
if (bookmarkID != -1 && this.isMicrosummary(bookmarkID, microsummary))
-#else
- if (bookmarkID && this.isMicrosummary(bookmarkID, microsummary))
-#endif
microsummary._content = this._getField(bookmarkID, FIELD_GENERATED_TITLE);
microsummaries.AppendElement(microsummary);
}
}
// If a bookmark identifier has been provided, list its microsummary
// synchronously, if any.
-#ifdef MOZ_PLACES_BOOKMARKS
if (bookmarkID != -1 && this.hasMicrosummary(bookmarkID)) {
-#else
- if (bookmarkID && this.hasMicrosummary(bookmarkID)) {
-#endif
var currentMicrosummary = this.getMicrosummary(bookmarkID);
if (!microsummaries.hasItemForMicrosummary(currentMicrosummary))
microsummaries.AppendElement(currentMicrosummary);
}
// Get microsummaries defined by the page. If we don't have the page,
// download it asynchronously, and then finish populating the set.
var resource = getLoadedMicrosummaryResource(pageURI);
@@ -694,17 +619,16 @@ MicrosummaryService.prototype = {
var bookmarkID = bookmarks[i];
if (this._hasField(bookmarkID, fieldName) &&
this._getField(bookmarkID, fieldName) == oldValue)
this._setField(bookmarkID, fieldName, newValue);
}
},
-#ifdef MOZ_PLACES_BOOKMARKS
/**
* Get the set of bookmarks with microsummaries.
*
* This is the internal version of this method, which is not accessible
* via XPCOM but is more performant; inside this component, use this version.
* Outside the component, use getBookmarks (no underscore prefix) instead.
*
* @returns an array of place: uris representing bookmarks items
@@ -743,140 +667,19 @@ MicrosummaryService.prototype = {
_hasField: function MSS__hasField(aBookmarkId, fieldName) {
return this._ans.itemHasAnnotation(aBookmarkId, fieldName);
},
_getPageForBookmark: function MSS__getPageForBookmark(aBookmarkId) {
return this._bms.getBookmarkURI(aBookmarkId);
},
-#else
/**
* Get the set of bookmarks with microsummaries.
*
- * This is the internal version of this method, which is not accessible
- * via XPCOM but is more performant; inside this component, use this version.
- * Outside the component, use getBookmarks (no underscore prefix) instead.
- *
- * @returns an array of bookmark IDs
- *
- */
- _getBookmarks: function MSS__getBookmarks() {
- var bookmarks = [];
-
- var resources = this._bmds.GetSources(this._resource(FIELD_RDF_TYPE),
- this._resource(VALUE_MICSUM_BOOKMARK),
- true);
- while (resources.hasMoreElements()) {
- var resource = resources.getNext().QueryInterface(Ci.nsIRDFResource);
-
- // When a bookmark gets deleted or cut, most of its arcs get removed
- // from the data source, but a few of them remain, in particular its RDF
- // type arc. So just because this resource has a MicsumBookmark type,
- // that doesn't mean it's a real bookmark! We need to check.
- if (!this._bms.isBookmarkedResource(resource))
- continue;
-
- bookmarks.push(resource);
- }
-
- return bookmarks;
- },
-
- _getField: function MSS__getField(bookmarkID, fieldName) {
- var bookmarkResource = bookmarkID.QueryInterface(Ci.nsIRDFResource);
- var fieldValue;
-
- var node = this._bmds.GetTarget(bookmarkResource,
- this._resource(fieldName),
- true);
- if (node) {
- if (fieldName == FIELD_RDF_TYPE)
- fieldValue = node.QueryInterface(Ci.nsIRDFResource).Value;
- else
- fieldValue = node.QueryInterface(Ci.nsIRDFLiteral).Value;
- }
- else
- fieldValue = null;
-
- return fieldValue;
- },
-
- _setField: function MSS__setField(bookmarkID, fieldName, fieldValue) {
- var bookmarkResource = bookmarkID.QueryInterface(Ci.nsIRDFResource);
-
- if (this._hasField(bookmarkID, fieldName)) {
- var oldValue = this._getField(bookmarkID, fieldName);
- this._bmds.Change(bookmarkResource,
- this._resource(fieldName),
- this._literal(oldValue),
- this._literal(fieldValue));
- }
- else {
- this._bmds.Assert(bookmarkResource,
- this._resource(fieldName),
- this._literal(fieldValue),
- true);
- }
- },
-
- _clearField: function MSS__clearField(bookmarkID, fieldName) {
- var bookmarkResource = bookmarkID.QueryInterface(Ci.nsIRDFResource);
-
- var node = this._bmds.GetTarget(bookmarkResource,
- this._resource(fieldName),
- true);
- if (node) {
- this._bmds.Unassert(bookmarkResource,
- this._resource(fieldName),
- node);
- }
- },
-
- _hasField: function MSS__hasField(bookmarkID, fieldName) {
- var bookmarkResource = bookmarkID.QueryInterface(Ci.nsIRDFResource);
-
- var node = this._bmds.GetTarget(bookmarkResource,
- this._resource(fieldName),
- true);
- return node ? true : false;
- },
-
- /**
- * Get the URI of the page to which a given bookmark refers.
- *
- * @param bookmarkResource
- * an nsIResource uniquely identifying the bookmark
- *
- * @returns an nsIURI object representing the bookmark's page,
- * or null if the bookmark doesn't exist
- *
- */
- _getPageForBookmark: function MSS__getPageForBookmark(bookmarkID) {
- var bookmarkResource = bookmarkID.QueryInterface(Ci.nsIRDFResource);
-
- var node = this._bmds.GetTarget(bookmarkResource,
- this._resource(NC_NS + "URL"),
- true);
-
- if (!node)
- return null;
-
- var pageSpec = node.QueryInterface(Ci.nsIRDFLiteral).Value;
- var pageURI = this._uri(pageSpec);
- return pageURI;
- },
-#endif
-
- /**
- * Get the set of bookmarks with microsummaries.
- *
- * Bookmark IDs are nsIRDFResource objects on builds with old RDF-based
- * bookmarks and nsIURI objects on builds with new Places-based bookmarks.
- *
* This is the external version of this method and is accessible via XPCOM.
* Use it outside this component. Inside the component, use _getBookmarks
* (with underscore prefix) instead for performance.
*
* @returns an nsISimpleEnumerator enumeration of bookmark IDs
*
*/
getBookmarks: function MSS_getBookmarks() {
@@ -927,42 +730,16 @@ MicrosummaryService.prototype = {
* @param bookmarkID
* the bookmark for which to set the current microsummary
*
* @param microsummary
* the microsummary to set as the current one
*
*/
setMicrosummary: function MSS_setMicrosummary(bookmarkID, microsummary) {
-#ifndef MOZ_PLACES_BOOKMARKS
- // Make sure that the bookmark is of type MicsumBookmark
- // because that's what the template rules are matching
- if (this._getField(bookmarkID, FIELD_RDF_TYPE) != VALUE_MICSUM_BOOKMARK) {
- // Force the bookmark trees to rebuild, since they don't seem
- // to be rebuilding on their own (bug 348928).
- this._bmds.beginUpdateBatch();
-
- var bookmarkResource = bookmarkID.QueryInterface(Ci.nsIRDFResource);
- if (this._hasField(bookmarkID, FIELD_RDF_TYPE)) {
- var oldValue = this._getField(bookmarkID, FIELD_RDF_TYPE);
- this._bmds.Change(bookmarkResource,
- this._resource(FIELD_RDF_TYPE),
- this._resource(oldValue),
- this._resource(VALUE_MICSUM_BOOKMARK));
- }
- else {
- this._bmds.Assert(bookmarkResource,
- this._resource(FIELD_RDF_TYPE),
- this._resource(VALUE_MICSUM_BOOKMARK),
- true);
- }
-
- this._bmds.endUpdateBatch();
- }
-#endif
this._setField(bookmarkID, FIELD_MICSUM_GEN_URI, microsummary.generator.uri.spec);
if (microsummary.content) {
this._updateMicrosummary(bookmarkID, microsummary);
}
else {
// Display a static title initially (unless there's already one set)
if (!this._hasField(bookmarkID, FIELD_GENERATED_TITLE))
@@ -976,33 +753,16 @@ MicrosummaryService.prototype = {
/**
* Remove the current microsummary for the given bookmark.
*
* @param bookmarkID
* the bookmark for which to remove the current microsummary
*
*/
removeMicrosummary: function MSS_removeMicrosummary(bookmarkID) {
-#ifndef MOZ_PLACES_BOOKMARKS
- // Set the bookmark's RDF type back to the normal bookmark type
- if (this._getField(bookmarkID, FIELD_RDF_TYPE) == VALUE_MICSUM_BOOKMARK) {
- // Force the bookmark trees to rebuild, since they don't seem
- // to be rebuilding on their own (bug 348928).
- this._bmds.beginUpdateBatch();
-
- var bookmarkResource = bookmarkID.QueryInterface(Ci.nsIRDFResource);
- this._bmds.Change(bookmarkResource,
- this._resource(FIELD_RDF_TYPE),
- this._resource(VALUE_MICSUM_BOOKMARK),
- this._resource(VALUE_NORMAL_BOOKMARK));
-
- this._bmds.endUpdateBatch();
- }
-#endif
-
var fields = [FIELD_MICSUM_GEN_URI,
FIELD_MICSUM_EXPIRATION,
FIELD_GENERATED_TITLE,
FIELD_CONTENT_TYPE];
for ( var i = 0; i < fields.length; i++ ) {
var field = fields[i];
if (this._hasField(bookmarkID, field))
--- a/browser/components/migration/src/Makefile.in
+++ b/browser/components/migration/src/Makefile.in
@@ -60,27 +60,20 @@ REQUIRES = \
rdf \
satchel \
intl \
unicharutil \
windowwatcher \
dom \
docshell \
xulapp \
+ places \
+ browserplaces \
$(NULL)
-ifdef MOZ_PLACES
-REQUIRES += places
-endif
-ifndef MOZ_PLACES_BOOKMARKS
-REQUIRES += bookmarks
-else
-REQUIRES += browserplaces
-endif
-
CPPSRCS = nsProfileMigrator.cpp \
nsBrowserProfileMigratorUtils.cpp \
nsNetscapeProfileMigratorBase.cpp \
nsSeamonkeyProfileMigrator.cpp \
nsPhoenixProfileMigrator.cpp \
$(NULL)
ifneq ($(OS_ARCH),BeOS)
--- a/browser/components/migration/src/nsBrowserProfileMigratorUtils.cpp
+++ b/browser/components/migration/src/nsBrowserProfileMigratorUtils.cpp
@@ -32,24 +32,20 @@
* 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 "nsBrowserProfileMigratorUtils.h"
-#ifdef MOZ_PLACES_BOOKMARKS
#include "nsINavBookmarksService.h"
#include "nsBrowserCompsCID.h"
#include "nsToolkitCompsCID.h"
#include "nsIPlacesImportExportService.h"
-#else
-#include "nsIBookmarksService.h"
-#endif
#include "nsIFile.h"
#include "nsIInputStream.h"
#include "nsILineInputStream.h"
#include "nsIProperties.h"
#include "nsIProfileMigrator.h"
#include "nsIURI.h"
#include "nsNetUtil.h"
@@ -220,51 +216,16 @@ AnnotatePersonalToolbarFolder(nsIFile* a
}
nsresult
ImportBookmarksHTML(nsIFile* aBookmarksFile,
const PRUnichar* aImportSourceNameKey)
{
nsresult rv;
-#ifndef MOZ_PLACES_BOOKMARKS
- nsCOMPtr<nsIBookmarksService> bms =
- do_GetService("@mozilla.org/browser/bookmarks-service;1", &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsISupportsArray> params =
- do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIRDFService> rdfs =
- do_GetService("@mozilla.org/rdf/rdf-service;1", &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIRDFResource> prop;
- rv = rdfs->GetResource(NC_URI(URL), getter_AddRefs(prop));
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIRDFLiteral> url;
- nsAutoString path;
- aBookmarksFile->GetPath(path);
- rdfs->GetLiteral(path.get(), getter_AddRefs(url));
-
- params->AppendElement(prop);
- params->AppendElement(url);
-
- nsCOMPtr<nsIRDFResource> importCmd;
- rv = rdfs->GetResource(NC_URI(command?cmd=import), getter_AddRefs(importCmd));
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIRDFResource> root;
- rv = rdfs->GetResource(NS_LITERAL_CSTRING("NC:BookmarksRoot"),
- getter_AddRefs(root));
- NS_ENSURE_SUCCESS(rv, rv);
-#endif // MOZ_PLACES_BOOKMARKS
-
// Look for the localized name of the bookmarks toolbar
nsCOMPtr<nsIStringBundleService> bundleService =
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
@@ -273,17 +234,16 @@ ImportBookmarksHTML(nsIFile* aBookmarksF
bundle->GetStringFromName(aImportSourceNameKey, getter_Copies(sourceName));
const PRUnichar* sourceNameStrings[] = { sourceName.get() };
nsString importedBookmarksTitle;
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
sourceNameStrings, 1,
getter_Copies(importedBookmarksTitle));
-#ifdef MOZ_PLACES_BOOKMARKS
// Get the bookmarks service
nsCOMPtr<nsINavBookmarksService> bms =
do_GetService(NS_NAVBOOKMARKSSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
// Create an imported bookmarks folder under the bookmarks menu.
PRInt64 root;
rv = bms->GetBookmarksRoot(&root);
@@ -293,33 +253,10 @@ ImportBookmarksHTML(nsIFile* aBookmarksF
rv = bms->CreateFolder(root, importedBookmarksTitle, -1, &folder);
NS_ENSURE_SUCCESS(rv, rv);
// Import the bookmarks into the folder.
nsCOMPtr<nsILocalFile> localFile(do_QueryInterface(aBookmarksFile));
NS_ENSURE_TRUE(localFile, NS_ERROR_FAILURE);
nsCOMPtr<nsIPlacesImportExportService> importer = do_GetService(NS_PLACESIMPORTEXPORTSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
- rv = importer->ImportHTMLFromFileToFolder(localFile, folder, PR_FALSE);
-#else
- nsCOMPtr<nsIRDFResource> folder;
- bms->CreateFolderInContainer(importedBookmarksTitle.get(), root, -1,
- getter_AddRefs(folder));
-
- nsCOMPtr<nsIRDFResource> folderProp;
- rv = rdfs->GetResource(NC_URI(Folder), getter_AddRefs(folderProp));
- NS_ENSURE_SUCCESS(rv, rv);
-
- params->AppendElement(folderProp);
- params->AppendElement(folder);
-
- nsCOMPtr<nsISupportsArray> sources =
- do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
- sources->AppendElement(folder);
-
- nsCOMPtr<nsIRDFDataSource> ds = do_QueryInterface(bms, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = ds->DoCommand(sources, importCmd, params);
-#endif
- return rv;
+ return importer->ImportHTMLFromFileToFolder(localFile, folder, PR_FALSE);
}
--- a/browser/components/migration/src/nsIEProfileMigrator.cpp
+++ b/browser/components/migration/src/nsIEProfileMigrator.cpp
@@ -80,22 +80,18 @@
#include "nsIRDFRemoteDataSource.h"
#include "nsIURI.h"
#include "nsILoginManager.h"
#include "nsILoginInfo.h"
#include "nsIFormHistory.h"
#include "nsIRDFService.h"
#include "nsIRDFContainer.h"
#include "nsIURL.h"
-#ifdef MOZ_PLACES_BOOKMARKS
#include "nsINavBookmarksService.h"
#include "nsBrowserCompsCID.h"
-#else
-#include "nsIBookmarksService.h"
-#endif
#include "nsIStringBundle.h"
#include "nsNetUtil.h"
#include "nsToolkitCompsCID.h"
#include "nsUnicharUtils.h"
#include "nsIWindowsRegKey.h"
#define TRIDENTPROFILE_BUNDLE "chrome://browser/locale/migration/migration.properties"
@@ -1160,61 +1156,42 @@ nsIEProfileMigrator::AddDataToFormHistor
//
nsresult
nsIEProfileMigrator::CopyFavorites(PRBool aReplace) {
// If "aReplace" is true, merge into the root level of bookmarks. Otherwise, create
// a folder called "Imported IE Favorites" and place all the Bookmarks there.
nsresult rv;
-#ifdef MOZ_PLACES_BOOKMARKS
nsCOMPtr<nsINavBookmarksService> bms(do_GetService(NS_NAVBOOKMARKSSERVICE_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv, rv);
PRInt64 root;
rv = bms->GetBookmarksRoot(&root);
NS_ENSURE_SUCCESS(rv, rv);
-#else
- nsCOMPtr<nsIRDFService> rdf(do_GetService("@mozilla.org/rdf/rdf-service;1"));
- nsCOMPtr<nsIRDFResource> root;
- rdf->GetResource(NS_LITERAL_CSTRING("NC:BookmarksRoot"), getter_AddRefs(root));
-
- nsCOMPtr<nsIBookmarksService> bms(do_GetService("@mozilla.org/browser/bookmarks-service;1"));
- NS_ENSURE_TRUE(bms, NS_ERROR_FAILURE);
- PRBool dummy;
- bms->ReadBookmarks(&dummy);
-#endif
nsAutoString personalToolbarFolderName;
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 folder;
-#else
- nsCOMPtr<nsIRDFResource> folder;
-#endif
if (!aReplace) {
nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIStringBundle> bundle;
bundleService->CreateBundle(TRIDENTPROFILE_BUNDLE, getter_AddRefs(bundle));
nsString sourceNameIE;
bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameIE").get(),
getter_Copies(sourceNameIE));
const PRUnichar* sourceNameStrings[] = { sourceNameIE.get() };
nsString importedIEFavsTitle;
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
sourceNameStrings, 1, getter_Copies(importedIEFavsTitle));
-#ifdef MOZ_PLACES_BOOKMARKS
bms->CreateFolder(root, importedIEFavsTitle, -1, &folder);
-#else
- bms->CreateFolderInContainer(importedIEFavsTitle.get(), root, -1, getter_AddRefs(folder));
-#endif
}
else {
// Locate the Links toolbar folder, we want to replace the Personal Toolbar content with
// Favorites in this folder.
nsCOMPtr<nsIWindowsRegKey> regKey =
do_CreateInstance("@mozilla.org/windows-registry-key;1");
NS_NAMED_LITERAL_STRING(toolbarKey,
"Software\\Microsoft\\Internet Explorer\\Toolbar");
@@ -1240,54 +1217,43 @@ nsIEProfileMigrator::CopyFavorites(PRBoo
// If |favoritesDirectory| is null, it means that we're on a Windows
// platform that does not have a Favorites folder, e.g. Windows 95
// (early SRs, before IE integrated with the shell). Only try to
// read Favorites folder if it exists on the machine.
if (favoritesDirectory) {
rv = ParseFavoritesFolder(favoritesDirectory, folder, bms, personalToolbarFolderName, PR_TRUE);
if (NS_FAILED(rv)) return rv;
-#ifdef MOZ_PLACES_BOOKMARKS
// after importing the favorites,
// we need to set this pref so that on startup
// we don't blow away what we just imported
nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
NS_ENSURE_TRUE(pref, NS_ERROR_FAILURE);
rv = pref->SetBoolPref("browser.places.importBookmarksHTML", PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
-#endif
}
return CopySmartKeywords(root);
}
nsresult
-#ifdef MOZ_PLACES_BOOKMARKS
nsIEProfileMigrator::CopySmartKeywords(PRInt64 aParentFolder)
-#else
-nsIEProfileMigrator::CopySmartKeywords(nsIRDFResource* aParentFolder)
-#endif
{
nsCOMPtr<nsIWindowsRegKey> regKey =
do_CreateInstance("@mozilla.org/windows-registry-key;1");
NS_NAMED_LITERAL_STRING(searchUrlKey,
"Software\\Microsoft\\Internet Explorer\\SearchUrl");
if (regKey &&
NS_SUCCEEDED(regKey->Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
searchUrlKey, nsIWindowsRegKey::ACCESS_READ))) {
-#ifdef MOZ_PLACES_BOOKMARKS
nsresult rv;
nsCOMPtr<nsINavBookmarksService> bms(do_GetService(NS_NAVBOOKMARKSSERVICE_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv, rv);
PRInt64 keywordsFolder = 0;
-#else
- nsCOMPtr<nsIBookmarksService> bms(do_GetService("@mozilla.org/browser/bookmarks-service;1"));
- nsCOMPtr<nsIRDFResource> keywordsFolder, bookmark;
-#endif
nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID);
nsCOMPtr<nsIStringBundle> bundle;
bundleService->CreateBundle(TRIDENTPROFILE_BUNDLE, getter_AddRefs(bundle));
int offset = 0;
@@ -1300,68 +1266,36 @@ nsIEProfileMigrator::CopySmartKeywords(n
nsString sourceNameIE;
bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameIE").get(),
getter_Copies(sourceNameIE));
const PRUnichar* sourceNameStrings[] = { sourceNameIE.get() };
nsString importedIESearchUrlsTitle;
bundle->FormatStringFromName(NS_LITERAL_STRING("importedSearchURLsFolder").get(),
sourceNameStrings, 1, getter_Copies(importedIESearchUrlsTitle));
-#ifdef MOZ_PLACES_BOOKMARKS
bms->CreateFolder(aParentFolder, importedIESearchUrlsTitle, -1, &keywordsFolder);
-#else
- bms->CreateFolderInContainer(importedIESearchUrlsTitle.get(), aParentFolder, -1,
- getter_AddRefs(keywordsFolder));
-#endif
}
nsCOMPtr<nsIWindowsRegKey> childKey;
if (NS_SUCCEEDED(regKey->OpenChild(keyName,
nsIWindowsRegKey::ACCESS_READ,
getter_AddRefs(childKey)))) {
nsAutoString url;
if (NS_SUCCEEDED(childKey->ReadStringValue(EmptyString(), url))) {
nsCOMPtr<nsIURI> uri;
if (NS_FAILED(NS_NewURI(getter_AddRefs(uri), url))) {
NS_WARNING("Invalid url while importing smart keywords of MS IE");
++offset;
childKey->Close();
continue;
}
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 id;
bms->InsertBookmark(keywordsFolder, uri,
nsINavBookmarksService::DEFAULT_INDEX, keyName,
&id);
-#else
- nsCAutoString hostCStr;
- uri->GetHost(hostCStr);
- NS_ConvertUTF8toUTF16 host(hostCStr);
-
- const PRUnichar* nameStrings[] = { host.get() };
- nsString keywordName;
- nsresult rv = bundle->FormatStringFromName(
- NS_LITERAL_STRING("importedSearchURLsTitle").get(),
- nameStrings, 1, getter_Copies(keywordName));
-
- const PRUnichar* descStrings[] = { keyName.get(), host.get() };
- nsString keywordDesc;
- rv = bundle->FormatStringFromName(
- NS_LITERAL_STRING("importedSearchUrlDesc").get(),
- descStrings, 2, getter_Copies(keywordDesc));
- bms->CreateBookmarkInContainer(keywordName.get(),
- url.get(),
- keyName.get(),
- keywordDesc.get(),
- nsnull,
- nsnull,
- keywordsFolder,
- -1,
- getter_AddRefs(bookmark));
-#endif
}
childKey->Close();
}
++offset;
}
}
@@ -1394,23 +1328,18 @@ nsIEProfileMigrator::ResolveShortcut(con
urlFile->Release();
}
urlLink->Release();
}
}
nsresult
nsIEProfileMigrator::ParseFavoritesFolder(nsIFile* aDirectory,
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 aParentFolder,
nsINavBookmarksService* aBookmarksService,
-#else
- nsIRDFResource* aParentResource,
- nsIBookmarksService* aBookmarksService,
-#endif
const nsAString& aPersonalToolbarFolderName,
PRBool aIsAtRootLevel)
{
nsresult rv;
nsCOMPtr<nsISimpleEnumerator> entries;
rv = aDirectory->GetDirectoryEntries(getter_AddRefs(entries));
if (NS_FAILED(rv)) return rv;
@@ -1461,97 +1390,39 @@ nsIEProfileMigrator::ParseFavoritesFolde
// Look for and strip out the .lnk extension.
NS_NAMED_LITERAL_STRING(lnkExt, ".lnk");
PRInt32 lnkExtStart = bookmarkName.Length() - lnkExt.Length();
if (StringEndsWith(bookmarkName, lnkExt,
CaseInsensitiveCompare))
bookmarkName.SetLength(lnkExtStart);
-#ifdef MOZ_PLACES_BOOKMARKS
nsCOMPtr<nsIURI> bookmarkURI;
rv = NS_NewFileURI(getter_AddRefs(bookmarkURI), localFile);
NS_ENSURE_SUCCESS(rv, rv);
PRInt64 id;
rv = aBookmarksService->InsertBookmark(aParentFolder, bookmarkURI,
nsINavBookmarksService::DEFAULT_INDEX,
bookmarkName, &id);
NS_ENSURE_SUCCESS(rv, rv);
-#else
- nsCAutoString spec;
- nsCOMPtr<nsIFile> filePath(localFile);
- // Get the file url format (file:///...) of the native file path.
- rv = NS_GetURLSpecFromFile(filePath, spec);
- if (NS_FAILED(rv)) continue;
-
- nsCOMPtr<nsIRDFResource> bookmark;
- // Here it's assumed that NS_GetURLSpecFromFile returns spec in UTF-8.
- // It is very likely to be ASCII (with everything escaped beyond file://),
- // but we don't lose much assuming that it's UTF-8. This is not perf.
- // critical.
- aBookmarksService->CreateBookmarkInContainer(bookmarkName.get(),
- NS_ConvertUTF8toUTF16(spec).get(),
- nsnull,
- nsnull,
- nsnull,
- nsnull,
- aParentResource,
- -1,
- getter_AddRefs(bookmark));
-#endif
if (NS_FAILED(rv)) continue;
}
else if (isDir) {
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 folder;
-#else
- nsCOMPtr<nsIRDFResource> folder;
-#endif
if (bookmarkName.Equals(aPersonalToolbarFolderName)) {
-#ifdef MOZ_PLACES_BOOKMARKS
aBookmarksService->GetToolbarFolder(&folder);
// If we're here, it means the user's doing a _replace_ import which means
// clear out the content of this folder, and replace it with the new content
aBookmarksService->RemoveFolderChildren(folder);
-#else
- aBookmarksService->GetBookmarksToolbarFolder(getter_AddRefs(folder));
-
- // If we're here, it means the user's doing a _replace_ import which means
- // clear out the content of this folder, and replace it with the new content
- nsCOMPtr<nsIRDFContainer> ctr(do_CreateInstance("@mozilla.org/rdf/container;1"));
- nsCOMPtr<nsIRDFDataSource> bmds(do_QueryInterface(aBookmarksService));
- ctr->Init(bmds, folder);
-
- nsCOMPtr<nsISimpleEnumerator> e;
- ctr->GetElements(getter_AddRefs(e));
-
- PRBool hasMore;
- e->HasMoreElements(&hasMore);
- while (hasMore) {
- nsCOMPtr<nsIRDFResource> b;
- e->GetNext(getter_AddRefs(b));
-
- ctr->RemoveElement(b, PR_FALSE);
-
- e->HasMoreElements(&hasMore);
- }
-#endif
}
else {
-#ifdef MOZ_PLACES_BOOKMARKS
rv = aBookmarksService->CreateFolder(aParentFolder,
bookmarkName,
nsINavBookmarksService::DEFAULT_INDEX,
&folder);
-#else
- rv = aBookmarksService->CreateFolderInContainer(bookmarkName.get(),
- aParentResource,
- -1,
- getter_AddRefs(folder));
-#endif
if (NS_FAILED(rv)) continue;
}
rv = ParseFavoritesFolder(currFile, folder, aBookmarksService, aPersonalToolbarFolderName, PR_FALSE);
if (NS_FAILED(rv)) continue;
}
else {
nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
@@ -1565,43 +1436,24 @@ nsIEProfileMigrator::ParseFavoritesFolde
bookmarkName.Length() - extension.Length() - 1));
nsAutoString path;
currFile->GetPath(path);
nsCString resolvedURL;
ResolveShortcut(path, getter_Copies(resolvedURL));
-#ifdef MOZ_PLACES_BOOKMARKS
nsCOMPtr<nsIURI> resolvedURI;
rv = NS_NewURI(getter_AddRefs(resolvedURI), resolvedURL);
NS_ENSURE_SUCCESS(rv, rv);
PRInt64 id;
rv = aBookmarksService->InsertBookmark(aParentFolder, resolvedURI,
nsINavBookmarksService::DEFAULT_INDEX,
name, &id);
if (NS_FAILED(rv)) continue;
-#else
- nsCOMPtr<nsIRDFResource> bookmark;
- // As far as I can tell reading the MSDN API document,
- // IUniformResourceLocator::GetURL (used by ResolveShortcut) returns a
- // URL in ASCII (with non-ASCII characters escaped) and it doesn't yet
- // support IDN (i18n) hostname. However, it may in the future so that
- // using UTF8toUTF16 wouldn't be a bad idea.
- rv = aBookmarksService->CreateBookmarkInContainer(name.get(),
- NS_ConvertUTF8toUTF16(resolvedURL).get(),
- nsnull,
- nsnull,
- nsnull,
- nsnull,
- aParentResource,
- -1,
- getter_AddRefs(bookmark));
-#endif
- if (NS_FAILED(rv)) continue;
}
}
while (1);
return rv;
}
nsresult
--- a/browser/components/migration/src/nsIEProfileMigrator.h
+++ b/browser/components/migration/src/nsIEProfileMigrator.h
@@ -45,21 +45,17 @@
#include <windows.h>
#include "nsIBrowserProfileMigrator.h"
#include "nsIObserverService.h"
#include "nsVoidArray.h"
class nsIFile;
class nsICookieManager2;
class nsIRDFResource;
-#ifdef MOZ_PLACES_BOOKMARKS
class nsINavBookmarksService;
-#else
-class nsIBookmarksService;
-#endif
class nsIPrefBranch;
#import PSTOREC_DLL raw_interfaces_only
using namespace PSTORECLib;
class nsIEProfileMigrator : public nsIBrowserProfileMigrator {
public:
NS_DECL_NSIBROWSERPROFILEMIGRATOR
@@ -85,31 +81,22 @@ protected:
void EnumerateUsernames(const nsAString& aKey, PRUnichar* aData, unsigned long aCount, nsVoidArray* aSignonsFound);
void GetUserNameAndPass(unsigned char* data, unsigned long len, unsigned char** username, unsigned char** pass);
nsresult CopyFormData(PRBool aReplace);
nsresult AddDataToFormHistory(const nsAString& aKey, PRUnichar* data, unsigned long len);
nsresult CopyFavorites(PRBool aReplace);
void ResolveShortcut(const nsString &aFileName, char** aOutURL);
-#ifdef MOZ_PLACES_BOOKMARKS
nsresult ParseFavoritesFolder(nsIFile* aDirectory,
PRInt64 aParentFolder,
nsINavBookmarksService* aBookmarksService,
const nsAString& aPersonalToolbarFolderName,
PRBool aIsAtRootLevel);
nsresult CopySmartKeywords(PRInt64 aParentFolder);
-#else
- nsresult ParseFavoritesFolder(nsIFile* aDirectory,
- nsIRDFResource* aParentResource,
- nsIBookmarksService* aBookmarksService,
- const nsAString& aPersonalToolbarFolderName,
- PRBool aIsAtRootLevel);
- nsresult CopySmartKeywords(nsIRDFResource* aParentFolder);
-#endif
nsresult CopyCookiesFromBuffer(char *aBuffer, PRUint32 aBufferLength,
nsICookieManager2 *aCookieManager);
void DelimitField(char **aBuffer, const char *aBufferEnd, char **aField);
time_t FileTimeToTimeT(const char *aLowDateIntString,
const char *aHighDateIntString);
void GetUserStyleSheetFile(nsIFile **aUserFile);
--- a/browser/components/migration/src/nsOperaProfileMigrator.cpp
+++ b/browser/components/migration/src/nsOperaProfileMigrator.cpp
@@ -35,22 +35,18 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsAppDirectoryServiceDefs.h"
#include "nsBrowserProfileMigratorUtils.h"
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"
#include "nsDocShellCID.h"
-#ifdef MOZ_PLACES_BOOKMARKS
#include "nsINavBookmarksService.h"
#include "nsBrowserCompsCID.h"
-#else
-#include "nsIBookmarksService.h"
-#endif
#include "nsIBrowserProfileMigrator.h"
#include "nsIBrowserHistory.h"
#include "nsICookieManager2.h"
#include "nsIGlobalHistory.h"
#include "nsIInputStream.h"
#include "nsILineInputStream.h"
#include "nsILocalFile.h"
#include "nsINIParser.h"
@@ -1036,105 +1032,71 @@ nsOperaProfileMigrator::CopyBookmarks(PR
nsCOMPtr<nsIInputStream> fileInputStream;
NS_NewLocalFileInputStream(getter_AddRefs(fileInputStream), operaBookmarks);
if (!fileInputStream) return NS_ERROR_OUT_OF_MEMORY;
nsCOMPtr<nsILineInputStream> lineInputStream(do_QueryInterface(fileInputStream));
nsresult rv;
-#ifdef MOZ_PLACES_BOOKMARKS
nsCOMPtr<nsINavBookmarksService> bms(do_GetService(NS_NAVBOOKMARKSSERVICE_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv, rv);
PRInt64 root;
rv = bms->GetBookmarksRoot(&root);
NS_ENSURE_SUCCESS(rv, rv);
PRInt64 parentFolder;
-#else
- nsCOMPtr<nsIBookmarksService> bms(do_GetService("@mozilla.org/browser/bookmarks-service;1"));
- NS_ENSURE_TRUE(bms, NS_ERROR_FAILURE);
- PRBool dummy;
- bms->ReadBookmarks(&dummy);
-
- nsCOMPtr<nsIRDFService> rdf(do_GetService("@mozilla.org/rdf/rdf-service;1"));
- nsCOMPtr<nsIRDFResource> root;
- rdf->GetResource(NS_LITERAL_CSTRING("NC:BookmarksRoot"),
- getter_AddRefs(root));
- nsCOMPtr<nsIRDFResource> parentFolder;
-#endif
nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(NS_STRINGBUNDLE_CONTRACTID));
nsCOMPtr<nsIStringBundle> bundle;
bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
if (!aReplace) {
nsString sourceNameOpera;
bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameOpera").get(),
getter_Copies(sourceNameOpera));
const PRUnichar* sourceNameStrings[] = { sourceNameOpera.get() };
nsString importedOperaHotlistTitle;
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
sourceNameStrings, 1,
getter_Copies(importedOperaHotlistTitle));
-#ifdef MOZ_PLACES_BOOKMARKS
bms->CreateFolder(parentFolder, importedOperaHotlistTitle,
nsINavBookmarksService::DEFAULT_INDEX, &parentFolder);
-#else
- bms->CreateFolderInContainer(importedOperaHotlistTitle.get(),
- root, -1, getter_AddRefs(parentFolder));
-#endif
}
else
parentFolder = root;
#if defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
printf("*** about to copy smart keywords\n");
CopySmartKeywords(bms, bundle, parentFolder);
printf("*** done copying smart keywords\n");
#endif
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 toolbar;
rv = bms->GetToolbarFolder(&toolbar);
NS_ENSURE_SUCCESS(rv, rv);
-#else
- nsCOMPtr<nsIRDFResource> toolbar;
- bms->GetBookmarksToolbarFolder(getter_AddRefs(toolbar));
-
- if (aReplace)
- ClearToolbarFolder(bms, toolbar);
-#endif
rv = ParseBookmarksFolder(lineInputStream, parentFolder, toolbar, bms);
NS_ENSURE_SUCCESS(rv, rv);
-#ifdef MOZ_PLACES_BOOKMARKS
// after importing the favorites,
// we need to set this pref so that on startup
// we don't blow away what we just imported
nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
NS_ENSURE_TRUE(pref, NS_ERROR_FAILURE);
rv = pref->SetBoolPref("browser.places.importBookmarksHTML", PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
-#endif
- return rv;
+ return NS_OK;
}
#if defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
nsresult
-#ifdef MOZ_PLACES_BOOKMARKS
nsOperaProfileMigrator::CopySmartKeywords(nsINavBookmarksService* aBMS,
nsIStringBundle* aBundle,
PRInt64 aParentFolder)
-#else
-nsOperaProfileMigrator::CopySmartKeywords(nsIBookmarksService* aBMS,
- nsIStringBundle* aBundle,
- nsIRDFResource* aParentFolder)
-#endif
{
nsresult rv;
nsCOMPtr<nsIFile> smartKeywords;
mOperaProfile->Clone(getter_AddRefs(smartKeywords));
smartKeywords->Append(NS_LITERAL_STRING("search.ini"));
nsCOMPtr<nsILocalFile> lf(do_QueryInterface(smartKeywords));
@@ -1151,26 +1113,20 @@ nsOperaProfileMigrator::CopySmartKeyword
getter_Copies(sourceNameOpera));
const PRUnichar* sourceNameStrings[] = { sourceNameOpera.get() };
nsString importedSearchUrlsTitle;
aBundle->FormatStringFromName(NS_LITERAL_STRING("importedSearchURLsFolder").get(),
sourceNameStrings, 1,
getter_Copies(importedSearchUrlsTitle));
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 keywordsFolder;
rv = aBMS->CreateFolder(aParentFolder, importedSearchUrlsTitle,
nsINavBookmarksService::DEFAULT_INDEX, &keywordsFolder);
NS_ENSURE_SUCCESS(rv, rv);
-#else
- nsCOMPtr<nsIRDFResource> keywordsFolder;
- aBMS->CreateFolderInContainer(importedSearchUrlsTitle.get(),
- aParentFolder, -1, getter_AddRefs(keywordsFolder));
-#endif
PRInt32 sectionIndex = 1;
nsCAutoString name, url, keyword;
do {
nsCAutoString section("Search Engine ");
section.AppendInt(sectionIndex++);
rv = parser.GetString(section.get(), "Name", name);
@@ -1221,73 +1177,29 @@ nsOperaProfileMigrator::CopySmartKeyword
uri->GetHost(hostCStr);
NS_ConvertASCIItoUTF16 host(hostCStr);
const PRUnichar* descStrings[] = { NS_ConvertUTF8toUTF16(keyword).get(), host.get() };
nsString keywordDesc;
aBundle->FormatStringFromName(NS_LITERAL_STRING("importedSearchUrlDesc").get(),
descStrings, 2, getter_Copies(keywordDesc));
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 newId;
rv = aBMS->InsertBookmark(keywordsFolder, uri,
nsINavBookmarksService::DEFAULT_INDEX,
nameStr, &newId);
NS_ENSURE_SUCCESS(rv, rv);
// TODO -- set bookmark keyword to keyword and description to keywordDesc.
-#else
- nsCOMPtr<nsIRDFResource> itemRes;
-
- // XXX We don't know for sure how Opera deals with IDN hostnames in URL.
- // Assuming it's in UTF-8 is rather safe because it covers two cases
- // (UTF-8 and ASCII) out of three cases (the last is a non-UTF-8
- // multibyte encoding).
- rv = aBMS->CreateBookmarkInContainer(nameStr.get(),
- NS_ConvertUTF8toUTF16(url).get(),
- NS_ConvertUTF8toUTF16(keyword).get(),
- keywordDesc.get(),
- nsnull,
- nsnull,
- keywordsFolder,
- -1,
- getter_AddRefs(itemRes));
-#endif
}
while (1);
return rv;
}
#endif
-#ifndef MOZ_PLACES_BOOKMARKS
-void
-nsOperaProfileMigrator::ClearToolbarFolder(nsIBookmarksService* aBookmarksService, nsIRDFResource* aToolbarFolder)
-{
- // If we're here, it means the user's doing a _replace_ import which means
- // clear out the content of this folder, and replace it with the new content
- nsCOMPtr<nsIRDFContainer> ctr(do_CreateInstance("@mozilla.org/rdf/container;1"));
- nsCOMPtr<nsIRDFDataSource> bmds(do_QueryInterface(aBookmarksService));
- ctr->Init(bmds, aToolbarFolder);
-
- nsCOMPtr<nsISimpleEnumerator> e;
- ctr->GetElements(getter_AddRefs(e));
-
- PRBool hasMore;
- e->HasMoreElements(&hasMore);
- while (hasMore) {
- nsCOMPtr<nsIRDFResource> b;
- e->GetNext(getter_AddRefs(b));
-
- ctr->RemoveElement(b, PR_FALSE);
-
- e->HasMoreElements(&hasMore);
- }
-}
-#endif
-
typedef enum { LineType_FOLDER,
LineType_BOOKMARK,
LineType_SEPARATOR,
LineType_NAME,
LineType_URL,
LineType_KEYWORD,
LineType_DESCRIPTION,
LineType_ONTOOLBAR,
@@ -1331,25 +1243,19 @@ static LineType GetLineType(nsAString& a
return LineType_NL; // Newlines separate bookmarks
return LineType_OTHER;
}
typedef enum { EntryType_BOOKMARK, EntryType_FOLDER } EntryType;
nsresult
nsOperaProfileMigrator::ParseBookmarksFolder(nsILineInputStream* aStream,
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 aParent,
PRInt64 aToolbar,
nsINavBookmarksService* aBMS)
-#else
- nsIRDFResource* aParent,
- nsIRDFResource* aToolbar,
- nsIBookmarksService* aBMS)
-#endif
{
nsresult rv;
PRBool moreData = PR_FALSE;
nsAutoString buffer;
EntryType entryType = EntryType_BOOKMARK;
nsAutoString name, keyword, description;
nsCAutoString url;
PRBool onToolbar = PR_FALSE;
@@ -1392,70 +1298,43 @@ nsOperaProfileMigrator::ParseBookmarksFo
if (NS_LITERAL_STRING("YES").Equals(data))
onToolbar = PR_TRUE;
break;
case LineType_NL: {
// XXX We don't know for sure how Opera deals with IDN hostnames in URL.
// Assuming it's in UTF-8 is rather safe because it covers two cases
// (UTF-8 and ASCII) out of three cases (the last is a non-UTF-8
// multibyte encoding).
-#ifndef MOZ_PLACES_BOOKMARKS
- nsCOMPtr<nsIRDFResource> itemRes;
-#endif
if (entryType == EntryType_BOOKMARK) {
if (!name.IsEmpty() && !url.IsEmpty()) {
-#ifdef MOZ_PLACES_BOOKMARKS
nsCOMPtr<nsIURI> uri;
rv = NS_NewURI(getter_AddRefs(uri), url);
if (NS_FAILED(rv))
continue;
PRInt64 id;
rv = aBMS->InsertBookmark(onToolbar ? aToolbar : aParent,
uri, nsINavBookmarksService::DEFAULT_INDEX,
name, &id);
if (NS_FAILED(rv))
continue;
-#else
- rv = aBMS->CreateBookmarkInContainer(name.get(),
- NS_ConvertUTF8toUTF16(url).get(),
- keyword.get(),
- description.get(),
- nsnull,
- nsnull,
- onToolbar ? aToolbar : aParent,
- -1,
- getter_AddRefs(itemRes));
- if (NS_FAILED(rv))
- continue;
-#endif
name.Truncate();
url.Truncate();
keyword.Truncate();
description.Truncate();
onToolbar = PR_FALSE;
}
}
else if (entryType == EntryType_FOLDER) {
if (!name.IsEmpty()) {
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 newFolder;
rv = aBMS->CreateFolder(onToolbar ? aToolbar : aParent,
name, nsINavBookmarksService::DEFAULT_INDEX, &newFolder);
if (NS_FAILED(rv))
continue;
rv = ParseBookmarksFolder(aStream, newFolder, aToolbar, aBMS);
-#else
- rv = aBMS->CreateFolderInContainer(name.get(),
- onToolbar ? aToolbar : aParent,
- -1,
- getter_AddRefs(itemRes));
- if (NS_FAILED(rv))
- continue;
- rv = ParseBookmarksFolder(aStream, itemRes, aToolbar, aBMS);
-#endif
name.Truncate();
}
}
break;
}
case LineType_OTHER:
break;
}
--- a/browser/components/migration/src/nsOperaProfileMigrator.h
+++ b/browser/components/migration/src/nsOperaProfileMigrator.h
@@ -47,21 +47,17 @@
#include "nsVoidArray.h"
class nsICookieManager2;
class nsILineInputStream;
class nsILocalFile;
class nsINIParser;
class nsIPermissionManager;
class nsIPrefBranch;
-#ifdef MOZ_PLACES_BOOKMARKS
class nsINavBookmarksService;
-#else
-class nsIBookmarksService;
-#endif
class nsIRDFResource;
class nsOperaProfileMigrator : public nsIBrowserProfileMigrator
{
public:
NS_DECL_NSIBROWSERPROFILEMIGRATOR
NS_DECL_ISUPPORTS
@@ -103,39 +99,26 @@ protected:
nsresult CopyProxySettings(nsINIParser &aParser, nsIPrefBranch* aBranch);
nsresult GetInteger(nsINIParser &aParser, const char* aSectionName,
const char* aKeyName, PRInt32* aResult);
nsresult CopyCookies(PRBool aReplace);
nsresult CopyHistory(PRBool aReplace);
nsresult CopyBookmarks(PRBool aReplace);
-#ifdef MOZ_PLACES_BOOKMARKS
void ClearToolbarFolder(nsINavBookmarksService * aBookmarksService, PRInt64 aToolbarFolder);
nsresult ParseBookmarksFolder(nsILineInputStream* aStream,
PRInt64 aFolder,
PRInt64 aToolbar,
nsINavBookmarksService* aBMS);
#if defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
nsresult CopySmartKeywords(nsINavBookmarksService* aBMS,
nsIStringBundle* aBundle,
PRInt64 aParentFolder);
#endif // defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
-#else
- void ClearToolbarFolder(nsIBookmarksService* aBookmarksService, nsIRDFResource* aToolbarFolder);
- nsresult ParseBookmarksFolder(nsILineInputStream* aStream,
- nsIRDFResource* aFolder,
- nsIRDFResource* aToolbar,
- nsIBookmarksService* aBMS);
-#if defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
- nsresult CopySmartKeywords(nsIBookmarksService* aBMS,
- nsIStringBundle* aBundle,
- nsIRDFResource* aParentFolder);
-#endif // defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
-#endif // MOZ_PLACES_BOOKMARKS
void GetOperaProfile(const PRUnichar* aProfile, nsILocalFile** aFile);
private:
nsCOMPtr<nsILocalFile> mOperaProfile;
nsCOMPtr<nsISupportsArray> mProfiles;
nsCOMPtr<nsIObserverService> mObserverService;
};
--- a/browser/components/migration/src/nsSafariProfileMigrator.cpp
+++ b/browser/components/migration/src/nsSafariProfileMigrator.cpp
@@ -36,22 +36,18 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsAppDirectoryServiceDefs.h"
#include "nsBrowserProfileMigratorUtils.h"
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"
#include "nsDocShellCID.h"
-#ifdef MOZ_PLACES_BOOKMARKS
#include "nsINavBookmarksService.h"
#include "nsBrowserCompsCID.h"
-#else
-#include "nsIBookmarksService.h"
-#endif
#include "nsIBrowserHistory.h"
#include "nsICookieManager2.h"
#include "nsIFileProtocolHandler.h"
#include "nsIFormHistory.h"
#include "nsIIOService.h"
#include "nsILocalFileMac.h"
#include "nsIObserverService.h"
#include "nsIPrefService.h"
@@ -891,39 +887,23 @@ nsSafariProfileMigrator::CopyHistory(PRB
nsresult
nsSafariProfileMigrator::CopyBookmarks(PRBool aReplace)
{
// If "aReplace" is true, merge into the root level of bookmarks. Otherwise, create
// a folder called "Imported IE Favorites" and place all the Bookmarks there.
nsresult rv;
-#ifdef MOZ_PLACES_BOOKMARKS
nsCOMPtr<nsINavBookmarksService> bms(do_GetService(NS_NAVBOOKMARKSSERVICE_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv, rv);
PRInt64 root;
rv = bms->GetBookmarksRoot(&root);
NS_ENSURE_SUCCESS(rv, rv);
PRInt64 folder;
-#else
- nsCOMPtr<nsIRDFService> rdf(do_GetService("@mozilla.org/rdf/rdf-service;1", &rv));
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIRDFResource> root;
- rdf->GetResource(NS_LITERAL_CSTRING("NC:BookmarksRoot"), getter_AddRefs(root));
-
- nsCOMPtr<nsIBookmarksService> bms(do_GetService("@mozilla.org/browser/bookmarks-service;1", &rv));
- NS_ENSURE_SUCCESS(rv, rv);
-
- PRBool dummy;
- bms->ReadBookmarks(&dummy);
-
- nsCOMPtr<nsIRDFResource> folder;
-#endif
if (!aReplace) {
nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIStringBundle> bundle;
bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
nsString sourceNameSafari;
@@ -931,23 +911,18 @@ nsSafariProfileMigrator::CopyBookmarks(P
getter_Copies(sourceNameSafari));
const PRUnichar* sourceNameStrings[] = { sourceNameSafari.get() };
nsString importedSafariBookmarksTitle;
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
sourceNameStrings, 1,
getter_Copies(importedSafariBookmarksTitle));
-#ifdef MOZ_PLACES_BOOKMARKS
bms->CreateFolder(root, importedSafariBookmarksTitle, nsINavBookmarksService::DEFAULT_INDEX,
&folder);
-#else
- bms->CreateFolderInContainer(importedSafariBookmarksTitle.get(), root, -1,
- getter_AddRefs(folder));
-#endif
}
else {
// In non-replace mode we are merging at the top level.
folder = root;
}
nsCOMPtr<nsIProperties> fileLocator(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID));
nsCOMPtr<nsILocalFile> safariBookmarksFile;
@@ -974,43 +949,36 @@ nsSafariProfileMigrator::CopyBookmarks(P
(CFNumberRef)::CFDictionaryGetValue(safariBookmarks,
CFSTR("WebBookmarkFileVersion"));
PRInt32 value = 0;
if (::CFNumberGetValue(intValue, kCFNumberSInt32Type, &value) && value ==1) {
CFArrayRef children =
(CFArrayRef)::CFDictionaryGetValue(safariBookmarks, CFSTR("Children"));
if (children) {
rv = ParseBookmarksFolder(children, folder, bms, PR_TRUE);
-#ifdef MOZ_PLACES_BOOKMARKS
if (NS_SUCCEEDED(rv)) {
// after importing the favorites,
// we need to set this pref so that on startup
// we don't blow away what we just imported
nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
NS_ENSURE_TRUE(pref, NS_ERROR_FAILURE);
rv = pref->SetBoolPref("browser.places.importBookmarksHTML", PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
}
-#endif
}
}
}
::CFRelease(safariBookmarks);
return rv;
}
nsresult
nsSafariProfileMigrator::ParseBookmarksFolder(CFArrayRef aChildren,
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 aParentFolder,
nsINavBookmarksService * aBookmarksService,
-#else
- nsIRDFResource* aParentResource,
- nsIBookmarksService* aBookmarksService,
-#endif
PRBool aIsAtRootLevel)
{
nsresult rv = NS_OK;
CFIndex count = ::CFArrayGetCount(aChildren);
for (PRInt32 i = 0; i < count; ++i) {
CFDictionaryRef entry = (CFDictionaryRef)::CFArrayGetValueAtIndex(aChildren, i);
@@ -1029,87 +997,57 @@ nsSafariProfileMigrator::ParseBookmarksF
continue;
CFArrayRef children = (CFArrayRef)::CFDictionaryGetValue(entry,
CFSTR("Children"));
// Look for the BookmarksBar Bookmarks and add them into the appropriate
// Personal Toolbar Root
if (title.EqualsLiteral("BookmarksBar") && aIsAtRootLevel) {
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 toolbarFolder;
aBookmarksService->GetToolbarFolder(&toolbarFolder);
-#else
- nsCOMPtr<nsIRDFResource> toolbarFolder;
- aBookmarksService->GetBookmarksToolbarFolder(getter_AddRefs(toolbarFolder));
-#endif
rv |= ParseBookmarksFolder(children,
toolbarFolder,
aBookmarksService,
PR_FALSE);
}
// Look for the BookmarksMenu Bookmarks and flatten them into the top level
else if (title.EqualsLiteral("BookmarksMenu") && aIsAtRootLevel) {
rv |= ParseBookmarksFolder(children,
-#ifdef MOZ_PLACES_BOOKMARKS
aParentFolder,
-#else
- aParentResource,
-#endif
aBookmarksService,
PR_TRUE);
}
else {
// Encountered a Folder, so create one in our Bookmarks DataSource and then
// parse the contents of the Safari one into it...
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 folder;
rv |= aBookmarksService->CreateFolder(aParentFolder, title,
nsINavBookmarksService::DEFAULT_INDEX,
&folder);
-#else
- nsCOMPtr<nsIRDFResource> folder;
- rv |= aBookmarksService->CreateFolderInContainer(title.get(),
- aParentResource,
- -1,
- getter_AddRefs(folder));
-#endif
rv |= ParseBookmarksFolder(children,
folder,
aBookmarksService,
PR_FALSE);
}
}
else if (type.EqualsLiteral("WebBookmarkTypeLeaf")) {
// Encountered a Bookmark, so add it to the current folder...
CFDictionaryRef URIDictionary = (CFDictionaryRef)
::CFDictionaryGetValue(entry, CFSTR("URIDictionary"));
nsAutoString title, url;
if (GetDictionaryStringValue(URIDictionary, CFSTR("title"), title) &&
GetDictionaryStringValue(entry, CFSTR("URLString"), url)) {
-#ifdef MOZ_PLACES_BOOKMARKS
nsCOMPtr<nsIURI> uri;
PRInt64 id;
rv |= NS_NewURI(getter_AddRefs(uri), url);
rv |= aBookmarksService->InsertBookmark(aParentFolder, uri,
nsINavBookmarksService::DEFAULT_INDEX,
title, &id);
-#else
- nsCOMPtr<nsIRDFResource> bookmark;
- rv |= aBookmarksService->CreateBookmarkInContainer(title.get(),
- url.get(),
- nsnull,
- nsnull,
- nsnull,
- nsnull,
- aParentResource,
- -1,
- getter_AddRefs(bookmark));
-#endif
}
}
}
return rv;
}
// nsSafariProfileMigrator::HasFormDataToImport()
// if we add support for "~/Library/Safari/Form Values",
--- a/browser/components/migration/src/nsSafariProfileMigrator.h
+++ b/browser/components/migration/src/nsSafariProfileMigrator.h
@@ -88,23 +88,18 @@ public:
static void CleanResource(nsIRDFDataSource* aDataSource, nsIRDFResource* aResource);
protected:
nsresult CopyPreferences(PRBool aReplace);
nsresult CopyCookies(PRBool aReplace);
nsresult CopyHistory(PRBool aReplace);
nsresult CopyBookmarks(PRBool aReplace);
nsresult ParseBookmarksFolder(CFArrayRef aChildren,
-#ifdef MOZ_PLACES_BOOKMARKS
PRInt64 aParentFolder,
nsINavBookmarksService * aBookmarksService,
-#else
- nsIRDFResource* aParentResource,
- nsIBookmarksService* aBookmarksService,
-#endif
PRBool aIsAtRootLevel);
nsresult CopyFormData(PRBool aReplace);
nsresult CopyOtherData(PRBool aReplace);
nsresult ProfileHasContentStyleSheet(PRBool *outExists);
nsresult GetSafariUserStyleSheet(nsILocalFile** aResult);
private:
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -284,17 +284,16 @@ BrowserGlue.prototype = {
return Sanitizer;
},
/**
* Initialize Places
* - imports the bookmarks html file if bookmarks datastore is empty
*/
_initPlaces: function bg__initPlaces() {
-#ifdef MOZ_PLACES_BOOKMARKS
// we need to instantiate the history service before we check the
// the browser.places.importBookmarksHTML pref, as
// nsNavHistory::ForceMigrateBookmarksDB() will set that pref
// if we need to force a migration (due to a schema change)
var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
var importBookmarks = false;
@@ -333,31 +332,28 @@ BrowserGlue.prototype = {
// save old bookmarks.html file as bookmarks.preplaces.html
try {
bookmarksFile.copyTo(profDir, "bookmarks.preplaces.html");
} catch(ex) {
dump("nsBrowserGlue::_initPlaces(): copy of bookmarks.html to bookmarks.preplaces.html failed: " + ex + "\n");
}
}
}
-#endif
},
/**
* Places shut-down tasks
* - back up and archive bookmarks
*/
_shutdownPlaces: function bg__shutdownPlaces() {
-#ifdef MOZ_PLACES_BOOKMARKS
// backup bookmarks to bookmarks.html
var importer =
Cc["@mozilla.org/browser/places/import-export-service;1"].
getService(Ci.nsIPlacesImportExportService);
importer.backupBookmarksFile();
-#endif
},
// ------------------------------
// public nsIBrowserGlue members
// ------------------------------
sanitize: function(aParentWindow)
{
--- a/browser/components/places/Makefile.in
+++ b/browser/components/places/Makefile.in
@@ -38,19 +38,15 @@
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
-DIRS = public
-
-ifdef MOZ_PLACES_BOOKMARKS
- DIRS += src
-endif
+DIRS = public src
ifdef ENABLE_TESTS
DIRS += tests
endif
include $(topsrcdir)/config/rules.mk
--- a/browser/components/places/content/controller.js
+++ b/browser/components/places/content/controller.js
@@ -152,17 +152,16 @@ PlacesController.prototype = {
if (PlacesUtils.nodeIsURI(nodes[i])) {
if (oneLinkIsSelected)
return true;
oneLinkIsSelected = true;
}
}
}
return false;
-#ifdef MOZ_PLACES_BOOKMARKS
case "placesCmd_new:folder":
case "placesCmd_new:livemark":
return this._canInsert() &&
this._view.peerDropTypes
.indexOf(PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER) != -1;
case "placesCmd_new:bookmark":
return this._canInsert() &&
this._view.peerDropTypes.indexOf(PlacesUtils.TYPE_X_MOZ_URL) != -1;
@@ -224,17 +223,16 @@ PlacesController.prototype = {
if (this._view.hasSingleSelection) {
var selectedNode = this._view.selectedNode;
if (PlacesUtils.nodeIsFolder(selectedNode) &&
selectedNode.itemId != PlacesUtils.toolbarFolderId) {
return true;
}
}
return false;
-#endif
default:
return false;
}
},
supportsCommand: function PC_supportsCommand(aCommand) {
//LOG("supportsCommand: " + command);
// Non-Places specific commands that we also support
@@ -285,17 +283,16 @@ PlacesController.prototype = {
this.openSelectedNodeIn("window");
break;
case "placesCmd_open:tab":
this.openSelectedNodeIn("tab");
break;
case "placesCmd_open:tabs":
this.openLinksInTabs();
break;
-#ifdef MOZ_PLACES_BOOKMARKS
case "placesCmd_new:folder":
this.newItem("folder");
break;
case "placesCmd_new:bookmark":
this.newItem("bookmark");
break;
case "placesCmd_new:livemark":
this.newItem("livemark");
@@ -316,17 +313,16 @@ PlacesController.prototype = {
this.reloadSelectedMicrosummary();
break;
case "placesCmd_sortBy:name":
this.sortFolderByName();
break;
case "placesCmd_setAsBookmarksToolbarFolder":
this.setBookmarksToolbarFolder();
break;
-#endif
}
},
onEvent: function PC_onEvent(eventName) { },
/**
* Determine whether or not the selection can be removed, either by the
@@ -1499,21 +1495,19 @@ var PlacesControllerDragHelper = {
}
};
function goUpdatePlacesCommands() {
goUpdateCommand("placesCmd_open");
goUpdateCommand("placesCmd_open:window");
goUpdateCommand("placesCmd_open:tab");
goUpdateCommand("placesCmd_open:tabs");
-#ifdef MOZ_PLACES_BOOKMARKS
goUpdateCommand("placesCmd_new:folder");
goUpdateCommand("placesCmd_new:bookmark");
goUpdateCommand("placesCmd_new:livemark");
goUpdateCommand("placesCmd_new:separator");
goUpdateCommand("placesCmd_show:info");
goUpdateCommand("placesCmd_moveBookmarks");
goUpdateCommand("placesCmd_setAsBookmarksToolbarFolder");
goUpdateCommand("placesCmd_reload");
goUpdateCommand("placesCmd_reloadMicrosummary");
goUpdateCommand("placesCmd_sortBy:name");
-#endif
}
--- a/browser/components/places/content/history-panel.js
+++ b/browser/components/places/content/history-panel.js
@@ -100,22 +100,18 @@ function GroupBy(groupingType)
function historyAddBookmarks()
{
// no need to check gHistoryTree.view.selection.count
// node will be null if there is a multiple selection
// or if the selected item is not a URI node
var node = gHistoryTree.selectedURINode;
if (!node)
return;
-
-#ifdef MOZ_PLACES_BOOKMARKS
+
PlacesUtils.showMinimalAddBookmarkUI(PlacesUtils._uri(node.uri), node.title);
-#else
- BookmarksUtils.addBookmark(node.uri, node.title, undefined);
-#endif
}
function SetSortingAndGrouping(aOptions)
{
const NHQO = Ci.nsINavHistoryQueryOptions;
var sortingMode;
var groups = [];
switch (gHistoryGrouping) {
--- a/browser/components/places/content/history-panel.xul
+++ b/browser/components/places/content/history-panel.xul
@@ -58,20 +58,16 @@
<page id="history-panel" orient="vertical"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="HistorySidebarInit();">
<script type="application/x-javascript"
src="chrome://browser/content/bookmarks/sidebarUtils.js"/>
<script type="application/x-javascript"
src="chrome://browser/content/places/history-panel.js"/>
-#ifndef MOZ_PLACES_BOOKMARKS
- <script type="application/x-javascript"
- src="chrome://browser/content/bookmarks/bookmarks.js"/>
-#endif
<commandset id="editMenuCommands"/>
<commandset id="placesCommands"/>
<keyset id="editMenuKeys">
#ifdef XP_MACOSX
<key id="key_delete2" keycode="VK_BACK" command="cmd_delete"/>
#endif
--- a/browser/components/places/content/placesOverlay.xul
+++ b/browser/components/places/content/placesOverlay.xul
@@ -68,17 +68,16 @@
<command id="placesCmd_open"
oncommand="goDoCommand('placesCmd_open');"/>
<command id="placesCmd_open:window"
oncommand="goDoCommand('placesCmd_open:window');"/>
<command id="placesCmd_open:tab"
oncommand="goDoCommand('placesCmd_open:tab');"/>
<command id="placesCmd_open:tabs"
oncommand="goDoCommand('placesCmd_open:tabs');"/>
-#ifdef MOZ_PLACES_BOOKMARKS
<command id="placesCmd_new:bookmark"
oncommand="goDoCommand('placesCmd_new:bookmark');"/>
<command id="placesCmd_new:livemark"
oncommand="goDoCommand('placesCmd_new:livemark');"/>
<command id="placesCmd_new:folder"
oncommand="goDoCommand('placesCmd_new:folder');"/>
<command id="placesCmd_new:separator"
oncommand="goDoCommand('placesCmd_new:separator');"/>
@@ -92,17 +91,16 @@
<command id="placesCmd_reloadMicrosummary"
oncommand="goDoCommand('placesCmd_reloadMicrosummary');"/>
<command id="placesCmd_sortBy:name"
oncommand="goDoCommand('placesCmd_sortBy:name');"/>
<command id="placesCmd_moveBookmarks"
oncommand="goDoCommand('placesCmd_moveBookmarks');"/>
<command id="placesCmd_setAsBookmarksToolbarFolder"
oncommand="goDoCommand('placesCmd_setAsBookmarksToolbarFolder');"/>
-#endif
</commandset>
<popup id="placesContext"
onpopupshowing="this._view = PlacesUtils.getViewForNode(document.popupNode);
return this._view.buildContextMenu(this);"
onpopuphiding="this._view.destroyContextMenu();">
<menuitem id="placesContext_open"
command="placesCmd_open"
--- a/browser/components/places/tests/Makefile.in
+++ b/browser/components/places/tests/Makefile.in
@@ -40,13 +40,11 @@ DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = test_browser_places
-ifdef MOZ_PLACES_BOOKMARKS
XPCSHELL_TESTS = unit
-endif
include $(topsrcdir)/config/rules.mk
--- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js
@@ -108,21 +108,17 @@ var gMainPane = {
/**
* Displays a dialog in which the user can select a bookmark to use as home
* page. If the user selects a bookmark, that bookmark's name is displayed in
* UI and the bookmark's address is stored to the home page preference.
*/
setHomePageToBookmark: function ()
{
var rv = { urls: null, names: null };
-#ifdef MOZ_PLACES_BOOKMARKS
document.documentElement.openSubDialog("chrome://browser/content/preferences/selectBookmark.xul",
-#else
- document.documentElement.openSubDialog("chrome://browser/content/bookmarks/selectBookmark.xul",
-#endif
"resizable", rv);
if (rv.urls && rv.names) {
var homePage = document.getElementById("browser.startup.homepage");
// XXX still using dangerous "|" joiner!
homePage.value = rv.urls.join("|");
}
},
--- a/browser/components/search/content/engineManager.js
+++ b/browser/components/search/content/engineManager.js
@@ -170,27 +170,20 @@ var gEngineManagerDialog = {
var bduplicate = false;
var eduplicate = false;
if (engine) {
if (engine.name != selectedEngine.name)
eduplicate = true;
} else {
try {
-#ifdef MOZ_PLACES_BOOKMARKS
var bmserv = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
if (bmserv.getURIForKeyword(alias.value))
bduplicate = true;
-#else
- var bmserv = Cc["@mozilla.org/browser/bookmarks-service;1"].
- getService(Ci.nsIBookmarksService);
- if (bmserv.resolveKeyword(alias.value, {}))
- bduplicate = true;
-#endif
} catch(ex) {}
// Check for duplicates in changes we haven't committed yet
var engines = gEngineView._engineStore.engines;
for each (var engine in engines) {
if (engine.alias == alias.value &&
engine.name != selectedEngine.name) {
eduplicate = true;
--- a/browser/components/sidebar/src/nsSidebar.js
+++ b/browser/components/sidebar/src/nsSidebar.js
@@ -116,40 +116,25 @@ function (aTitle, aContentURL, aCustomiz
{
var WINMEDSVC = Components.classes['@mozilla.org/appshell/window-mediator;1']
.getService(Components.interfaces.nsIWindowMediator);
var win = WINMEDSVC.getMostRecentWindow( "navigator:browser" );
if (!sidebarURLSecurityCheck(aContentURL))
return;
-#ifdef MOZ_PLACES_BOOKMARKS
var uri = null;
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
try {
uri = ioService.newURI(aContentURL, null, null);
}
catch(ex) { return; }
win.PlacesUtils.showMinimalAddBookmarkUI(uri, aTitle, null, null, true, true);
-#else
- var dialogArgs = {
- name: aTitle,
- url: aContentURL,
- bWebPanel: true
- }
-#ifdef XP_MACOSX
- var features = "chrome,dialog,resizable,modal";
-#else
- var features = "centerscreen,chrome,dialog,resizable,dependent";
-#endif
- win.openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "",
- features, dialogArgs);
-#endif
}
nsSidebar.prototype.validateSearchEngine =
function (engineURL, iconURL)
{
try
{
// Make sure we're using HTTP, HTTPS, or FTP.
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -37,16 +37,15 @@
# ***** END LICENSE BLOCK *****
MOZ_APP_NAME=firefox
MOZ_UPDATER=1
MOZ_PHOENIX=1
MOZ_ENABLE_LIBXUL=1
MOZ_PLACES=1
-MOZ_PLACES_BOOKMARKS=1
# always enabled for form history
MOZ_MORKREADER=1
MOZ_SAFE_BROWSING=1
MOZ_APP_VERSION=$FIREFOX_VERSION
MOZ_NO_XPCOM_OBSOLETE=1
MOZ_EXTENSIONS_DEFAULT=" xml-rpc inspector gnomevfs reporter"
# MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -20,31 +20,22 @@
locale/browser/sanitize.dtd (%chrome/browser/sanitize.dtd)
locale/browser/search.properties (%chrome/browser/search.properties)
locale/browser/searchbar.dtd (%chrome/browser/searchbar.dtd)
locale/browser/engineManager.dtd (%chrome/browser/engineManager.dtd)
locale/browser/engineManager.properties (%chrome/browser/engineManager.properties)
locale/browser/setDesktopBackground.dtd (%chrome/browser/setDesktopBackground.dtd)
locale/browser/shellservice.properties (%chrome/browser/shellservice.properties)
locale/browser/sessionstore.properties (%chrome/browser/sessionstore.properties)
-#ifdef MOZ_PLACES
locale/browser/places/places.dtd (%chrome/browser/places/places.dtd)
locale/browser/places/places.properties (%chrome/browser/places/places.properties)
-#endif
-#ifdef MOZ_PLACES_BOOKMARKS
locale/browser/places/bookmarkProperties.dtd (%chrome/browser/places/bookmarkProperties.dtd)
locale/browser/places/bookmarkProperties.properties (%chrome/browser/places/bookmarkProperties.properties)
locale/browser/preferences/selectBookmark.dtd (%chrome/browser/preferences/selectBookmark.dtd)
locale/browser/places/moveBookmarks.dtd (%chrome/browser/places/moveBookmarks.dtd)
-#else
-* locale/browser/bookmarks/bookmarks.dtd (%chrome/browser/bookmarks/bookmarks.dtd)
-* locale/browser/bookmarks/addBookmark.dtd (%chrome/browser/bookmarks/addBookmark.dtd)
-* locale/browser/bookmarks/bookmarks.properties (%chrome/browser/bookmarks/bookmarks.properties)
-* locale/browser/bookmarks/bookmarksProperties.dtd (%chrome/browser/bookmarks/bookmarksProperties.dtd)
-#endif
#ifdef MOZ_SAFE_BROWSING
locale/browser/safebrowsing/phishing-afterload-warning-message.dtd (%chrome/browser/safebrowsing/phishing-afterload-warning-message.dtd)
locale/browser/safebrowsing/report-phishing.dtd (%chrome/browser/safebrowsing/report-phishing.dtd)
#endif
locale/browser/feeds/subscribe.dtd (%chrome/browser/feeds/subscribe.dtd)
locale/browser/feeds/subscribe.properties (%chrome/browser/feeds/subscribe.properties)
locale/browser/history/history.dtd (%chrome/browser/history/history.dtd)
locale/browser/migration/migration.dtd (%chrome/browser/migration/migration.dtd)
--- a/browser/themes/pinstripe/browser/browser.css
+++ b/browser/themes/pinstripe/browser/browser.css
@@ -150,44 +150,16 @@ toolbarbutton.bookmark-item .toolbarbutt
/* Prevent [mode="icons"] from hiding the label */
.bookmark-item > .toolbarbutton-text {
display: -moz-box !important;
height: 16px !important;
padding-top: 1px;
}
-%ifndef MOZ_PLACES_BOOKMARKS
-.bookmark-item > .toolbarbutton-menu-dropmarker {
- list-style-image: url("chrome://browser/skin/bookmarks/folderarrow.png");
- height: 16px !important;
- padding: 5px 5px 4px 3px;
-}
-
-.bookmark-item:hover > .toolbarbutton-menu-dropmarker, .bookmark-item[open] > .toolbarbutton-menu-dropmarker {
- list-style-image: url("chrome://browser/skin/bookmarks/folderarrow-hover.png");
-}
-
-.bookmark-item[livemark] > .toolbarbutton-menu-dropmarker {
- list-style-image: url("chrome://browser/skin/bookmarks/livemark-folder.png");
- padding: 4px 4px 3px 2px;
-}
-
-.bookmark-item[livemark]:hover > .toolbarbutton-menu-dropmarker, .bookmark-item[livemark][open] > .toolbarbutton-menu-dropmarker {
- list-style-image: url("chrome://browser/skin/bookmarks/livemark-folder-hover.png");
-}
-
-.bookmark-item[livemark] {
- list-style-image: url("chrome://browser/skin/page-livemarks.png");
-}
-
-.bookmark-item[livemark] .menuitem-iconic {
- list-style-image: url("chrome://browser/skin/bookmarks/livemark-item.png");
-}
-%else
.bookmark-item > .toolbarbutton-menu-dropmarker {
list-style-image: url("chrome://browser/skin/places/folderDropArrow.png");
height: 16px !important;
padding: 5px 5px 4px 3px;
}
.bookmark-item:hover > .toolbarbutton-menu-dropmarker, .bookmark-item[open] > .toolbarbutton-menu-dropmarker {
list-style-image: url("chrome://browser/skin/places/folderDropHoverArrow.png");
@@ -209,17 +181,16 @@ toolbarbutton.bookmark-item .toolbarbutt
.bookmark-item[livemark] .menuitem-iconic {
list-style-image: url("chrome://browser/skin/places/livemarkItem.png");
}
.bookmark-item menuitem[openInTabs],
.bookmark-item menuitem[siteURI] {
list-style-image: none;
}
-%endif
.toolbarpaletteitem-box[type="bookmarks-toolbar"][place="palette"] {
background: url("chrome://browser/skin/bookmarks/Toolbar-bookmarks.png") no-repeat;
}
.bookmarks-toolbar-customize {
display: none;
max-width: 15em !important;
@@ -232,21 +203,19 @@ toolbarpaletteitem[place="toolbar"] .boo
toolbarpaletteitem[place="toolbar"] .bookmarks-toolbar-overflow-items {
visibility: hidden;
}
toolbarpaletteitem[place="toolbar"] .bookmarks-toolbar-items {
visibility: hidden;
}
-%ifdef MOZ_PLACES_BOOKMARKS
toolbarpaletteitem[place="toolbar"] .places-toolbar-items {
display: none;
}
-%endif
/* ----- BOOKMARK MENUS ----- */
.bookmark-item > .menu-iconic-left > .menu-iconic-icon {
width: 16px;
height: 16px;
}
@@ -996,21 +965,17 @@ toolbar[iconsize="small"] #paste-button:
cursor: -moz-grab;
}
#page-proxy-favicon {
list-style-image: none;
}
#page-proxy-button {
-%ifdef MOZ_PLACES
list-style-image: url("chrome://mozapps/skin/places/defaultFavicon.png");
-%else
- list-style-image: url("chrome://browser/skin/bookmarks/bookmark-item.png");
-%endif
}
#page-proxy-button[pageproxystate="invalid"] {
cursor: default;
opacity: 0.5;
}
@@ -1230,21 +1195,17 @@ toolbarbutton.chevron > .toolbarbutton-m
}
#nav-bar {
background-image: none;
}
.bookmark-item {
-%ifdef MOZ_PLACES
list-style-image: url("chrome://mozapps/skin/places/defaultFavicon.png");
-%else
- list-style-image: url("chrome://browser/skin/bookmarks/bookmark-item.png");
-%endif
}
.openintabs-menuitem {
list-style-image: none;
}
.tabs-left {
display: none !important;
@@ -1270,17 +1231,16 @@ toolbarbutton.chevron > .toolbarbutton-m
.tabs-closebutton:hover:active {
list-style-image: url("chrome://global/skin/icons/closetab-active.png") !important;
}
tabpanels.plain {
background-color: #fff !important;
}
-%ifdef MOZ_PLACES_BOOKMARKS
/* Personal toolbar */
.toolbar-drop-indicator {
height: 16px;
width: 5px;
margin-bottom: -8px;
position: relative;
background: url('chrome://browser/skin/places/toolbarDropMarker.png') 50% 50% no-repeat;
}
@@ -1312,17 +1272,16 @@ toolbarbutton.bookmark-item[dragover="tr
.bookmark-item[dragover-top="true"] {
-moz-border-top-colors: #000000;
}
.bookmark-item[dragover-bottom="true"] {
-moz-border-bottom-colors: #000000;
}
-%endif
#CustomizeToolbarSheet > #main-box {
border-top: none !important;
border-left: 2px solid;
border-right: 2px solid;
border-bottom: 3px solid;
-moz-border-right-colors: -moz-mac-menushadow ThreeDLightShadow !important;
-moz-border-bottom-colors: -moz-mac-menushadow -moz-mac-menushadow ThreeDShadow !important;
--- a/browser/themes/pinstripe/browser/jar.mn
+++ b/browser/themes/pinstripe/browser/jar.mn
@@ -27,54 +27,33 @@ classic.jar:
skin/classic/browser/Secure-background.gif
skin/classic/browser/Toolbar-small.png
skin/classic/browser/Toolbar.png
skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css)
skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png)
skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png)
skin/classic/browser/setDesktopBackground.css
skin/classic/browser/monitor.png
-#ifdef MOZ_PLACES
skin/classic/browser/places/places.css (places/places.css)
skin/classic/browser/places/query.png (places/query.png)
skin/classic/browser/places/livemarkItem.png (places/livemarkItem.png)
-#else
- skin/classic/browser/bookmarks/bookmark-item.png (bookmarks/bookmark-item.png)
-#endif
-#ifdef MOZ_PLACES_BOOKMARKS
skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png)
skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png)
skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png)
skin/classic/browser/places/folderDragOver.png (places/folderDragOver.png)
skin/classic/browser/places/folderDropArrow.png (places/folderDropArrow.png)
skin/classic/browser/places/folderDropHoverArrow.png (places/folderDropHoverArrow.png)
skin/classic/browser/places/livemarkFolder.png (places/livemarkFolder.png)
skin/classic/browser/places/livemarkFolderHover.png (places/livemarkFolderHover.png)
skin/classic/browser/places/bookmarkProperties.css (places/bookmarkProperties.css)
skin/classic/browser/places/organizer-toolbar.png (bookmarks/Bookmarks-toolbar.png)
skin/classic/browser/places/expander-closed-active.png (bookmarks/expander-closed-active.png)
skin/classic/browser/places/expander-closed.png (bookmarks/expander-closed.png)
skin/classic/browser/places/expander-open-active.png (bookmarks/expander-open-active.png)
skin/classic/browser/places/expander-open.png (bookmarks/expander-open.png)
-#else
- skin/classic/browser/bookmarks/addBookmark.css (bookmarks/addBookmark.css)
- skin/classic/browser/bookmarks/bookmarksProperties.css (bookmarks/bookmarksProperties.css)
- skin/classic/browser/bookmarks/bookmark-folder.png (bookmarks/bookmark-folder.png)
- skin/classic/browser/bookmarks/Bookmarks-toolbar.png (bookmarks/Bookmarks-toolbar.png)
- skin/classic/browser/bookmarks/bookmarksManager.css (bookmarks/bookmarksManager.css)
- skin/classic/browser/bookmarks/expander-closed-active.png (bookmarks/expander-closed-active.png)
- skin/classic/browser/bookmarks/expander-closed.png (bookmarks/expander-closed.png)
- skin/classic/browser/bookmarks/expander-open-active.png (bookmarks/expander-open-active.png)
- skin/classic/browser/bookmarks/expander-open.png (bookmarks/expander-open.png)
- skin/classic/browser/bookmarks/livemark-folder-hover.png (bookmarks/livemark-folder-hover.png)
- skin/classic/browser/bookmarks/livemark-folder.png (bookmarks/livemark-folder.png)
- skin/classic/browser/bookmarks/livemark-item.png (bookmarks/livemark-item.png)
- skin/classic/browser/bookmarks/folderarrow-hover.png (bookmarks/folderarrow-hover.png)
- skin/classic/browser/bookmarks/folderarrow.png (bookmarks/folderarrow.png)
-#endif
#ifdef MOZ_SAFE_BROWSING
skin/classic/browser/safebrowsing/browser-protection.css (safebrowsing/browser-protection.css)
skin/classic/browser/safebrowsing/close16x16.png (safebrowsing/close16x16.png)
skin/classic/browser/safebrowsing/dim.png (safebrowsing/dim.png)
skin/classic/browser/safebrowsing/tail.png (safebrowsing/tail.png)
skin/classic/browser/safebrowsing/warning16x16.png (safebrowsing/warning16x16.png)
skin/classic/browser/safebrowsing/warning24x24.png (safebrowsing/warning24x24.png)
#endif
--- a/browser/themes/winstripe/browser/browser.css
+++ b/browser/themes/winstripe/browser/browser.css
@@ -150,21 +150,19 @@ toolbarpaletteitem[place="toolbar"] .boo
toolbarpaletteitem[place="toolbar"] .bookmarks-toolbar-overflow-items {
visibility: hidden;
}
toolbarpaletteitem[place="toolbar"] .bookmarks-toolbar-items {
visibility: hidden;
}
-%ifdef MOZ_PLACES_BOOKMARKS
toolbarpaletteitem[place="toolbar"] .places-toolbar-items {
display: none;
}
-%endif
/* ::::: bookmark menus ::::: */
menu.bookmark-item,
menuitem.bookmark-item {
min-width: 0;
max-width: 26em;
}
@@ -1409,17 +1407,16 @@ toolbar[mode="text"] > #window-controls
#pageReportFirstTime statusbarpanel.statusbar-resizerpanel {
visibility: collapse;
}
#checkForUpdates[loading="true"] {
list-style-image: url("chrome://global/skin/throbber/Throbber-small.gif");
}
-%ifdef MOZ_PLACES_BOOKMARKS
/* Personal toolbar */
.toolbar-drop-indicator {
height: 16px;
width: 5px;
margin-bottom: -8px;
position: relative;
background: url("chrome://browser/skin/places/toolbarDropMarker.png") 50% 50% no-repeat;
}
@@ -1451,9 +1448,8 @@ toolbarbutton.bookmark-item[dragover="tr
.bookmark-item[dragover-top="true"] {
-moz-border-top-colors: #000000;
}
.bookmark-item[dragover-bottom="true"] {
-moz-border-bottom-colors: #000000;
}
-%endif
--- a/browser/themes/winstripe/browser/jar.mn
+++ b/browser/themes/winstripe/browser/jar.mn
@@ -38,35 +38,25 @@ classic.jar:
skin/classic/browser/Search-provider-bkgnd.png
skin/classic/browser/Search-provider-mid-top.png
skin/classic/browser/Search-provider-mid-bottom.png
skin/classic/browser/setDesktopBackground.css
skin/classic/browser/monitor.png
skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png)
skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png)
skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css)
-#ifdef MOZ_PLACES
skin/classic/browser/places/places.css (places/places.css)
skin/classic/browser/places/query.png (places/query.png)
skin/classic/browser/places/livemarkItem.png (places/livemarkItem.png)
-#endif
-#ifdef MOZ_PLACES_BOOKMARKS
skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png)
skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png)
skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png)
skin/classic/browser/places/folderDragOver.png (places/folderDragOver.png)
skin/classic/browser/places/bookmarkProperties.css (places/bookmarkProperties.css)
skin/classic/browser/places/organizer-toolbar.png (bookmarks/Bookmarks-toolbar.png)
-#else
- skin/classic/browser/Bookmarks-folder.png
- skin/classic/browser/bookmarks/addBookmark.css (bookmarks/addBookmark.css)
- skin/classic/browser/bookmarks/bookmarksProperties.css (bookmarks/bookmarksProperties.css)
- skin/classic/browser/bookmarks/bookmarksManager.css (bookmarks/bookmarksManager.css)
- skin/classic/browser/bookmarks/Bookmarks-toolbar.png (bookmarks/Bookmarks-toolbar.png)
-#endif
#ifdef MOZ_SAFE_BROWSING
skin/classic/browser/safebrowsing/browser-protection.css (safebrowsing/browser-protection.css)
skin/classic/browser/safebrowsing/close16x16.png (safebrowsing/close16x16.png)
skin/classic/browser/safebrowsing/dim.png (safebrowsing/dim.png)
skin/classic/browser/safebrowsing/tail.png (safebrowsing/tail.png)
skin/classic/browser/safebrowsing/warning16x16.png (safebrowsing/warning16x16.png)
skin/classic/browser/safebrowsing/warning24x24.png (safebrowsing/warning24x24.png)
#endif
--- a/configure.in
+++ b/configure.in
@@ -5811,27 +5811,20 @@ dnl ====================================
MOZ_ARG_ENABLE_BOOL(places,
[ --enable-places Enable 'places' bookmark/history implementation],
MOZ_PLACES=1,
MOZ_PLACES= )
if test -n "$MOZ_PLACES"; then
AC_DEFINE(MOZ_PLACES)
MOZ_MORK=
MOZ_MORKREADER=1
-fi
-
-dnl ========================================================
-dnl = Enable places bookmarks (use places for bookmarks)
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(places-bookmarks,
-[ --enable-places-bookmarks Enable 'places' for bookmarks backend],
- MOZ_PLACES_BOOKMARKS=1,
- MOZ_PLACES_BOOKMARKS= )
-if test -n "$MOZ_PLACES_BOOKMARKS"; then
- AC_DEFINE(MOZ_PLACES_BOOKMARKS)
+else
+ if test "$MOZ_BUILD_APP" = "browser"; then
+ AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
+ fi
fi
dnl ========================================================
dnl = Disable feed handling components
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(feeds,
[ --disable-feeds Disable feed handling and processing components],
MOZ_FEEDS=,
--- a/toolkit/components/places/src/Makefile.in
+++ b/toolkit/components/places/src/Makefile.in
@@ -96,15 +96,13 @@ CPPSRCS = \
EXTRA_DSO_LDOPTS += \
$(DEPTH)/db/morkreader/$(LIB_PREFIX)morkreader_s.$(LIB_SUFFIX) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
LOCAL_INCLUDES += -I$(srcdir)/../../build
-ifdef MOZ_PLACES_BOOKMARKS
EXTRA_PP_COMPONENTS = nsLivemarkService.js \
nsTaggingService.js \
$(NULL)
-endif
include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/places/src/nsNavBookmarks.cpp
+++ b/toolkit/components/places/src/nsNavBookmarks.cpp
@@ -372,24 +372,22 @@ nsNavBookmarks::InitRoots()
getRootStatement->Reset();
rv = CreateRoot(getRootStatement, NS_LITERAL_CSTRING("menu"), &mBookmarksRoot, mRoot, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
getRootStatement->Reset();
rv = CreateRoot(getRootStatement, NS_LITERAL_CSTRING("tags"), &mTagRoot, mRoot, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
-#ifdef MOZ_PLACES_BOOKMARKS
if (importDefaults) {
// when there is no places root, we should define the hierarchy by
// importing the default one.
rv = InitDefaults();
NS_ENSURE_SUCCESS(rv, rv);
}
-#endif
// migration for bug 382094 - remove for A6
PRInt64 parent;
rv = GetFolderIdForItem(mBookmarksRoot, &parent);
if (NS_FAILED(rv) || parent == 0) {
nsCOMPtr<mozIStorageStatement> statement;
rv = DBConn()->CreateStatement(NS_LITERAL_CSTRING("UPDATE moz_bookmarks SET parent = ?1 WHERE id = ?2 or id = ?3"),
getter_AddRefs(statement));
--- a/toolkit/components/places/tests/Makefile.in
+++ b/toolkit/components/places/tests/Makefile.in
@@ -40,19 +40,17 @@ DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = test_places
-XPCSHELL_TESTS = unit
-
-ifdef MOZ_PLACES_BOOKMARKS
-XPCSHELL_TESTS += bookmarks
-endif
+XPCSHELL_TESTS = unit \
+ bookmarks \
+ $(NULL)
ifdef MOZ_MOCHITEST
DIRS = chrome
endif
include $(topsrcdir)/config/rules.mk