Commit 4605c4cc authored by Tatiana Meshkova's avatar Tatiana Meshkova

Fixed compilation for desktop target

parent 2d63c5f6
......@@ -24,13 +24,14 @@ class EmbedChromeListener : public nsIDOMEventListener
{
public:
EmbedChromeListener(nsIDOMWindow* aWin);
virtual ~EmbedChromeListener();
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
nsCOMPtr<nsIDOMWindow> DOMWindow;
private:
virtual ~EmbedChromeListener();
nsCOMPtr<nsIEmbedAppService> mService;
int mWindowCounter;
};
......
......@@ -19,13 +19,14 @@ class EmbedChromeManager : public nsIObserver,
{
public:
EmbedChromeManager();
virtual ~EmbedChromeManager();
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
nsresult Init();
private:
virtual ~EmbedChromeManager();
void WindowCreated(nsIDOMWindow* aWin);
void WindowDestroyed(nsIDOMWindow* aWin);
nsCOMPtr<nsIEmbedAppService> mService;
......
......@@ -42,6 +42,7 @@ public:
EmbedHistoryListener();
private:
virtual ~EmbedHistoryListener() {}
nsIEmbedAppService* GetService();
static EmbedHistoryListener* sHistory;
......
......@@ -11,8 +11,8 @@
#include "EmbedPromptService.h"
#include "nsIComponentRegistrar.h"
#include "nsIComponentManager.h"
#include "GenericFactory.h"
#include "mozilla/ModuleUtils.h"
#include "../widgetfactory/EmbedliteGenericFactory.h"
#include "nsComponentManagerUtils.h"
#include "nsILoginManager.h"
......@@ -46,7 +46,7 @@ EmbedPromptRegister::Init()
rv = NS_GetComponentManager (getter_AddRefs (cm));
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
nsCOMPtr<nsIFactory> f = new mozilla::embedlite::GenericFactory(EmbedPromptFactoryConstructor);
nsCOMPtr<nsIFactory> f = new mozilla::embedlite::EmbedliteGenericFactory(EmbedPromptFactoryConstructor);
if (!f) {
NS_WARNING("Unable to create factory for component");
return NS_ERROR_FAILURE;
......@@ -69,7 +69,7 @@ EmbedPromptRegister::Init()
rv = cr->RegisterFactory(promptCID, "EmbedLite Prompt",
"@mozilla.org/prompter;1", f);
f = new mozilla::embedlite::GenericFactory(nsEmbedAlertsServiceConstructor);
f = new mozilla::embedlite::EmbedliteGenericFactory(nsEmbedAlertsServiceConstructor);
if (!f) {
NS_WARNING("Unable to create factory for component");
return NS_ERROR_FAILURE;
......
......@@ -15,12 +15,14 @@ class EmbedPromptRegister : public nsIObserver,
{
public:
EmbedPromptRegister();
virtual ~EmbedPromptRegister();
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
nsresult Init();
private:
virtual ~EmbedPromptRegister();
};
#define NS_EMBED_PROMPT_CONTRACTID "@mozilla.org/embed-prompt-component;1"
......
......@@ -559,10 +559,6 @@ public:
NS_ASSERTION(mCallback, "null callback");
}
~nsAuthCancelableConsumer()
{
}
NS_IMETHOD Cancel(nsresult reason)
{
NS_ENSURE_ARG(NS_FAILED(reason));
......@@ -578,6 +574,8 @@ public:
nsCOMPtr<nsIAuthPromptCallback> mCallback;
nsCOMPtr<nsISupports> mContext;
private:
virtual ~nsAuthCancelableConsumer() {}
};
NS_IMPL_ISUPPORTS(nsAuthCancelableConsumer, nsICancelable);
......@@ -643,11 +641,10 @@ public:
: mPrompt(aPrompt)
{
}
virtual ~EmbedAuthRunnable()
{
}
NS_IMETHOD Run();
EmbedAsyncAuthPrompt* mPrompt;
private:
virtual ~EmbedAuthRunnable() {}
};
NS_IMPL_ISUPPORTS(EmbedAuthRunnable, nsIRunnable)
......
......@@ -56,12 +56,12 @@ class EmbedPromptOuterObserver : public nsIObserver, public nsSupportsWeakRefere
{
public:
EmbedPromptOuterObserver(IDestroyNotification* aNotifier, nsIDOMWindow* aWin);
virtual ~EmbedPromptOuterObserver();
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
void OnDestroy();
private:
virtual ~EmbedPromptOuterObserver();
IDestroyNotification* mNotifier;
nsCOMPtr<nsIDOMWindow> mWin;
nsCOMPtr<nsIObserverService> mService;
......@@ -71,7 +71,6 @@ class EmbedPromptService : public nsIPrompt, public nsIEmbedMessageListener, pub
{
public:
EmbedPromptService(nsIDOMWindow* aWin);
virtual ~EmbedPromptService();
NS_DECL_ISUPPORTS
NS_DECL_NSIPROMPT
......@@ -80,6 +79,7 @@ public:
virtual void OnDestroyNotification();
private:
virtual ~EmbedPromptService();
void CancelResponse();
uint32_t CheckWinID();
......@@ -106,7 +106,6 @@ public:
consumers.AppendElement(aCancelable);
}
virtual ~EmbedAsyncAuthPrompt() {}
nsTArray<nsRefPtr<nsICancelable>> consumers;
nsIDOMWindow* mWin;
nsCOMPtr<nsIChannel> mChannel;
......@@ -115,13 +114,13 @@ public:
bool mInProgress;
nsCString mHashKey;
RefPtr<EmbedAuthPromptService> mService;
virtual ~EmbedAsyncAuthPrompt() {}
};
class EmbedAuthPromptService : public nsIAuthPrompt2, public nsIEmbedMessageListener, public IDestroyNotification
{
public:
EmbedAuthPromptService(nsIDOMWindow* aWin);
virtual ~EmbedAuthPromptService();
NS_DECL_ISUPPORTS
NS_DECL_NSIAUTHPROMPT2
......@@ -136,6 +135,7 @@ public:
virtual void OnDestroyNotification();
private:
virtual ~EmbedAuthPromptService();
void DoAsyncPrompt();
void CancelResponse();
uint32_t CheckWinID();
......@@ -153,10 +153,11 @@ class EmbedPromptFactory : public nsIPromptFactory
{
public:
EmbedPromptFactory();
virtual ~EmbedPromptFactory();
NS_DECL_ISUPPORTS
NS_DECL_NSIPROMPTFACTORY
private:
virtual ~EmbedPromptFactory();
};
}}
......
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GenericFactory.h"
namespace mozilla {
namespace embedlite {
NS_IMPL_ISUPPORTS(GenericFactory, nsIFactory)
NS_IMETHODIMP
GenericFactory::CreateInstance(nsISupports* aOuter, REFNSIID aIID,
void** aResult)
{
return mCtor(aOuter, aIID, aResult);
}
NS_IMETHODIMP
GenericFactory::LockFactory(bool aLock)
{
NS_ERROR("Vestigial method, never called!");
return NS_ERROR_FAILURE;
}
} // namespace mozilla
} // namespace mozilla
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_GenericFactory_h
#define mozilla_GenericFactory_h
#include "mozilla/Attributes.h"
#include "mozilla/Module.h"
namespace mozilla {
namespace embedlite {
/**
* A generic factory which uses a constructor function to create instances.
* This class is intended for use by the component manager and the generic
* module.
*/
class GenericFactory MOZ_FINAL : public nsIFactory
{
public:
typedef Module::ConstructorProcPtr ConstructorProcPtr;
NS_DECL_ISUPPORTS
NS_DECL_NSIFACTORY
GenericFactory(ConstructorProcPtr ctor)
: mCtor(ctor)
{
NS_ASSERTION(mCtor, "GenericFactory with no constructor");
}
private:
ConstructorProcPtr mCtor;
};
} // namespace mozilla
} // namespace mozilla
#endif // mozilla_GenericFactory_h
......@@ -4,8 +4,8 @@ libbz_LTLIBRARIES = libprompt.la
libprompt_la_SOURCES = \
EmbedPromptRegister.cpp \
EmbedPromptService.cpp \
GenericFactory.cpp \
nsEmbedChildModule.cpp \
../widgetfactory/EmbedliteGenericFactory.cpp \
nsAlertsService.cpp \
$(NULL)
......
......@@ -18,9 +18,9 @@ public:
NS_DECL_ISUPPORTS
nsEmbedAlertsService();
virtual ~nsEmbedAlertsService();
protected:
virtual ~nsEmbedAlertsService();
bool ShouldShowAlert();
};
......
......@@ -27,8 +27,6 @@ class EmbedTouchListener : public nsIDOMEventListener,
{
public:
EmbedTouchListener(nsIDOMWindow* aWin);
virtual ~EmbedTouchListener();
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
......@@ -44,6 +42,8 @@ public:
nsCOMPtr<nsIDOMWindow> DOMWindow;
private:
virtual ~EmbedTouchListener();
void AnyElementFromPoint(nsIDOMWindow* aWindow, double aX, double aY, nsIDOMElement* *aElem);
bool ShouldZoomToElement(nsIDOMElement* aElement);
void ZoomToElement(nsIDOMElement* aElement,
......
......@@ -19,13 +19,13 @@ class EmbedTouchManager : public nsIObserver,
{
public:
EmbedTouchManager();
virtual ~EmbedTouchManager();
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
nsresult Init();
private:
virtual ~EmbedTouchManager();
void WindowCreated(nsIDOMWindow* aWin);
void WindowDestroyed(nsIDOMWindow* aWin);
nsCOMPtr<nsIEmbedAppService> mService;
......
......@@ -10,7 +10,7 @@
#include "nsIObserverService.h"
#include "nsIComponentRegistrar.h"
#include "nsIComponentManager.h"
#include "GenericFactory.h"
#include "EmbedliteGenericFactory.h"
#include "mozilla/ModuleUtils.h"
#include "nsComponentManagerUtils.h"
......@@ -49,7 +49,7 @@ EmbedWidgetFactoryRegister::Init()
rv = NS_GetComponentManager (getter_AddRefs (cm));
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
nsCOMPtr<nsIFactory> fp = new mozilla::embedlite::GenericFactory(nsEmbedFilePickerConstructor);
nsCOMPtr<nsIFactory> fp = new mozilla::embedlite::EmbedliteGenericFactory(nsEmbedFilePickerConstructor);
if (!fp) {
NS_WARNING("Unable to create factory for component");
return NS_ERROR_FAILURE;
......@@ -71,7 +71,7 @@ EmbedWidgetFactoryRegister::Init()
rv = cr->RegisterFactory(fpickerCID, "EmbedLite FilePicker",
filepickerCONTRACTID, fp);
fp = new mozilla::embedlite::GenericFactory(nsEmbedClipboardConstructor);
fp = new mozilla::embedlite::EmbedliteGenericFactory(nsEmbedClipboardConstructor);
if (!fp) {
NS_WARNING("Unable to create factory for component");
return NS_ERROR_FAILURE;
......
......@@ -13,11 +13,11 @@ class EmbedWidgetFactoryRegister : public nsSupportsWeakReference
{
public:
EmbedWidgetFactoryRegister();
virtual ~EmbedWidgetFactoryRegister();
NS_DECL_ISUPPORTS
nsresult Init();
private:
virtual ~EmbedWidgetFactoryRegister();
};
#define NS_EMBED_WIDGETFACTORY_CONTRACTID "@mozilla.org/embed-widget-factory-component;1"
......
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GenericFactory.h"
namespace mozilla {
namespace embedlite {
NS_IMPL_ISUPPORTS(GenericFactory, nsIFactory)
NS_IMETHODIMP
GenericFactory::CreateInstance(nsISupports* aOuter, REFNSIID aIID,
void** aResult)
{
return mCtor(aOuter, aIID, aResult);
}
NS_IMETHODIMP
GenericFactory::LockFactory(bool aLock)
{
NS_ERROR("Vestigial method, never called!");
return NS_ERROR_FAILURE;
}
} // namespace mozilla
} // namespace mozilla
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_GenericFactory_h
#define mozilla_GenericFactory_h
#include "mozilla/Attributes.h"
#include "mozilla/Module.h"
namespace mozilla {
namespace embedlite {
/**
* A generic factory which uses a constructor function to create instances.
* This class is intended for use by the component manager and the generic
* module.
*/
class GenericFactory MOZ_FINAL : public nsIFactory
{
public:
typedef Module::ConstructorProcPtr ConstructorProcPtr;
NS_DECL_ISUPPORTS
NS_DECL_NSIFACTORY
GenericFactory(ConstructorProcPtr ctor)
: mCtor(ctor)
{
NS_ASSERTION(mCtor, "GenericFactory with no constructor");
}
private:
ConstructorProcPtr mCtor;
};
} // namespace mozilla
} // namespace mozilla
#endif // mozilla_GenericFactory_h
......@@ -4,7 +4,7 @@ libbz_LTLIBRARIES = libwidgetfactory.la
libwidgetfactory_la_SOURCES = \
EmbedWidgetFactoryRegister.cpp \
nsFilePicker.cpp \
GenericFactory.cpp \
EmbedliteGenericFactory.cpp \
nsEmbedChildModule.cpp \
nsClipboard.cpp \
$(NULL)
......
......@@ -19,8 +19,6 @@ class nsEmbedClipboard : public nsIClipboard, public nsIObserver
{
public:
nsEmbedClipboard();
virtual ~nsEmbedClipboard();
//nsISupports
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
......@@ -29,6 +27,8 @@ public:
NS_DECL_NSICLIPBOARD
private:
virtual ~nsEmbedClipboard();
nsCOMPtr<nsIEmbedAppService> mService;
nsCOMPtr<nsIObserverService> mObserverService;
nsString mBuffer;
......
......@@ -358,8 +358,6 @@ public:
utils = do_GetInterface(aWin);
}
virtual ~nsBaseFilePickerEnumerator()
{}
NS_IMETHOD
GetNext(nsISupports** aResult)
......@@ -390,6 +388,8 @@ public:
}
private:
virtual ~nsBaseFilePickerEnumerator() {}
nsCOMPtr<nsISimpleEnumerator> mIterator;
nsCOMPtr<nsIDOMWindowUtils> utils;
};
......
......@@ -32,13 +32,13 @@ class nsEmbedFilePicker : public nsIFilePicker, public nsIEmbedMessageListener
{
public:
nsEmbedFilePicker();
virtual ~nsEmbedFilePicker();
NS_DECL_ISUPPORTS
NS_DECL_NSIFILEPICKER
NS_DECL_NSIEMBEDMESSAGELISTENER
private:
virtual ~nsEmbedFilePicker();
nsresult DoSendPrompt();
EmbedFilePickerResponse GetResponse();
int mModalDepth;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment