Bug 696745, remove nsIMenuRollup and xul-popup-manager component, r=mats,sr=roc
This commit is contained in:
@@ -98,7 +98,6 @@ using namespace QtMobility;
|
||||
#include "nsIdleService.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "nsIRollupListener.h"
|
||||
#include "nsIMenuRollup.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsQtKeyUtils.h"
|
||||
#include "mozilla/Services.h"
|
||||
@@ -183,7 +182,6 @@ static const int WHEEL_DELTA = 120;
|
||||
static bool gGlobalsInitialized = false;
|
||||
|
||||
static nsIRollupListener* gRollupListener;
|
||||
static nsIMenuRollup* gMenuRollup;
|
||||
static nsWeakPtr gRollupWindow;
|
||||
static bool gConsumeRollupEvent;
|
||||
|
||||
@@ -423,10 +421,9 @@ nsWindow::Destroy(void)
|
||||
nsCOMPtr<nsIWidget> rollupWidget = do_QueryReferent(gRollupWindow);
|
||||
if (static_cast<nsIWidget *>(this) == rollupWidget.get()) {
|
||||
if (gRollupListener)
|
||||
gRollupListener->Rollup(nsnull, nsnull);
|
||||
gRollupListener->Rollup(0);
|
||||
gRollupWindow = nsnull;
|
||||
gRollupListener = nsnull;
|
||||
NS_IF_RELEASE(gMenuRollup);
|
||||
}
|
||||
|
||||
if (mLayerManager) {
|
||||
@@ -939,7 +936,6 @@ nsWindow::CaptureMouse(bool aCapture)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::CaptureRollupEvents(nsIRollupListener *aListener,
|
||||
nsIMenuRollup *aMenuRollup,
|
||||
bool aDoCapture,
|
||||
bool aConsumeRollupEvent)
|
||||
{
|
||||
@@ -951,14 +947,10 @@ nsWindow::CaptureRollupEvents(nsIRollupListener *aListener,
|
||||
if (aDoCapture) {
|
||||
gConsumeRollupEvent = aConsumeRollupEvent;
|
||||
gRollupListener = aListener;
|
||||
NS_IF_RELEASE(gMenuRollup);
|
||||
gMenuRollup = aMenuRollup;
|
||||
NS_IF_ADDREF(aMenuRollup);
|
||||
gRollupWindow = do_GetWeakReference(static_cast<nsIWidget*>(this));
|
||||
}
|
||||
else {
|
||||
gRollupListener = nsnull;
|
||||
NS_IF_RELEASE(gMenuRollup);
|
||||
gRollupWindow = nsnull;
|
||||
}
|
||||
|
||||
@@ -979,16 +971,16 @@ check_for_rollup(double aMouseX, double aMouseY,
|
||||
if (!is_mouse_in_window(currentPopup, aMouseX, aMouseY)) {
|
||||
bool rollup = true;
|
||||
if (aIsWheel) {
|
||||
gRollupListener->ShouldRollupOnMouseWheelEvent(&rollup);
|
||||
rollup = gRollupListener->ShouldRollupOnMouseWheelEvent();
|
||||
retVal = true;
|
||||
}
|
||||
// if we're dealing with menus, we probably have submenus and
|
||||
// we don't want to rollup if the clickis in a parent menu of
|
||||
// the current submenu
|
||||
PRUint32 popupsToRollup = PR_UINT32_MAX;
|
||||
if (gMenuRollup) {
|
||||
if (gRollupListener) {
|
||||
nsAutoTArray<nsIWidget*, 5> widgetChain;
|
||||
PRUint32 sameTypeCount = gMenuRollup->GetSubmenuWidgetChain(&widgetChain);
|
||||
PRUint32 sameTypeCount = gRollupListener->GetSubmenuWidgetChain(&widgetChain);
|
||||
for (PRUint32 i=0; i<widgetChain.Length(); ++i) {
|
||||
nsIWidget* widget = widgetChain[i];
|
||||
MozQWidget* currWindow =
|
||||
@@ -1007,14 +999,13 @@ check_for_rollup(double aMouseX, double aMouseY,
|
||||
|
||||
// if we've determined that we should still rollup, do it.
|
||||
if (rollup) {
|
||||
gRollupListener->Rollup(popupsToRollup, nsnull);
|
||||
gRollupListener->Rollup(popupsToRollup);
|
||||
retVal = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gRollupWindow = nsnull;
|
||||
gRollupListener = nsnull;
|
||||
NS_IF_RELEASE(gMenuRollup);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
|
||||
Reference in New Issue
Block a user