Bug 799609 - Disable Places in B2G - Part 3 - Allow widget to be built without Places

r=jimm
This commit is contained in:
Marco Bonardo
2012-11-09 10:55:56 +01:00
parent 374fed0d12
commit cb97511a03
4 changed files with 14 additions and 4 deletions

View File

@@ -20,7 +20,6 @@
#include "nsIJumpListItem.h" #include "nsIJumpListItem.h"
#include "JumpListItem.h" #include "JumpListItem.h"
#include "nsIObserver.h" #include "nsIObserver.h"
#include "nsIFaviconService.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"

View File

@@ -15,7 +15,6 @@
#include "nsNetCID.h" #include "nsNetCID.h"
#include "nsCExternalHandlerService.h" #include "nsCExternalHandlerService.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "mozIAsyncFavicons.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "JumpListBuilder.h" #include "JumpListBuilder.h"
#include "WinUtils.h" #include "WinUtils.h"

View File

@@ -17,8 +17,9 @@
#include "imgITools.h" #include "imgITools.h"
#include "nsStringStream.h" #include "nsStringStream.h"
#include "nsNetUtil.h" #include "nsNetUtil.h"
#ifdef MOZ_PLACES
#include "mozIAsyncFavicons.h" #include "mozIAsyncFavicons.h"
#endif
#include "nsIIconURI.h" #include "nsIIconURI.h"
#include "nsIDownloader.h" #include "nsIDownloader.h"
#include "nsINetUtil.h" #include "nsINetUtil.h"
@@ -30,7 +31,9 @@ namespace mozilla {
namespace widget { namespace widget {
NS_IMPL_ISUPPORTS1(myDownloadObserver, nsIDownloadObserver) NS_IMPL_ISUPPORTS1(myDownloadObserver, nsIDownloadObserver)
#ifdef MOZ_PLACES
NS_IMPL_ISUPPORTS1(AsyncFaviconDataReady, nsIFaviconDataCallback) NS_IMPL_ISUPPORTS1(AsyncFaviconDataReady, nsIFaviconDataCallback)
#endif
NS_IMPL_THREADSAFE_ISUPPORTS1(AsyncWriteIconToDisk, nsIRunnable) NS_IMPL_THREADSAFE_ISUPPORTS1(AsyncWriteIconToDisk, nsIRunnable)
NS_IMPL_THREADSAFE_ISUPPORTS1(AsyncDeleteIconFromDisk, nsIRunnable) NS_IMPL_THREADSAFE_ISUPPORTS1(AsyncDeleteIconFromDisk, nsIRunnable)
NS_IMPL_THREADSAFE_ISUPPORTS1(AsyncDeleteAllFaviconsFromDisk, nsIRunnable) NS_IMPL_THREADSAFE_ISUPPORTS1(AsyncDeleteAllFaviconsFromDisk, nsIRunnable)
@@ -392,6 +395,7 @@ WinUtils::SHCreateItemFromParsingName(PCWSTR pszPath, IBindCtx *pbc,
return sCreateItemFromParsingName(pszPath, pbc, riid, ppv); return sCreateItemFromParsingName(pszPath, pbc, riid, ppv);
} }
#ifdef MOZ_PLACES
/************************************************************************/ /************************************************************************/
/* Constructs as AsyncFaviconDataReady Object /* Constructs as AsyncFaviconDataReady Object
/* @param aIOThread : the thread which performs the action /* @param aIOThread : the thread which performs the action
@@ -489,6 +493,7 @@ AsyncFaviconDataReady::OnComplete(nsIURI *aFaviconURI,
return NS_OK; return NS_OK;
} }
#endif
// Warning: AsyncWriteIconToDisk assumes ownership of the aData buffer passed in // Warning: AsyncWriteIconToDisk assumes ownership of the aData buffer passed in
AsyncWriteIconToDisk::AsyncWriteIconToDisk(const nsAString &aIconPath, AsyncWriteIconToDisk::AsyncWriteIconToDisk(const nsAString &aIconPath,
@@ -846,6 +851,7 @@ nsresult
nsCOMPtr<nsIThread> &aIOThread, nsCOMPtr<nsIThread> &aIOThread,
bool aURLShortcut) bool aURLShortcut)
{ {
#ifdef MOZ_PLACES
// Obtain the favicon service and get the favicon for the specified page // Obtain the favicon service and get the favicon for the specified page
nsCOMPtr<mozIAsyncFavicons> favIconSvc( nsCOMPtr<mozIAsyncFavicons> favIconSvc(
do_GetService("@mozilla.org/browser/favicon-service;1")); do_GetService("@mozilla.org/browser/favicon-service;1"));
@@ -857,6 +863,7 @@ nsresult
aURLShortcut); aURLShortcut);
favIconSvc->GetFaviconDataForPage(aFaviconPageURI, callback); favIconSvc->GetFaviconDataForPage(aFaviconPageURI, callback);
#endif
return NS_OK; return NS_OK;
} }

View File

@@ -16,8 +16,11 @@
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "nsICryptoHash.h" #include "nsICryptoHash.h"
#include "nsIFaviconService.h" #ifdef MOZ_PLACES
#include "nsIFaviconService.h"
#endif
#include "nsIDownloader.h" #include "nsIDownloader.h"
#include "nsIURI.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
@@ -235,6 +238,7 @@ private:
static bool VistaCreateItemFromParsingNameInit(); static bool VistaCreateItemFromParsingNameInit();
}; };
#ifdef MOZ_PLACES
class AsyncFaviconDataReady MOZ_FINAL : public nsIFaviconDataCallback class AsyncFaviconDataReady MOZ_FINAL : public nsIFaviconDataCallback
{ {
public: public:
@@ -250,6 +254,7 @@ private:
nsCOMPtr<nsIThread> mIOThread; nsCOMPtr<nsIThread> mIOThread;
const bool mURLShortcut; const bool mURLShortcut;
}; };
#endif
/** /**
* Asynchronously tries add the list to the build * Asynchronously tries add the list to the build