Bug 891316 part.2 Use widget::MSGResult in widget::WindowHook r=jimm

This commit is contained in:
Masayuki Nakano 2013-07-18 17:12:31 +09:00
Родитель f50359d44b
Коммит 1320d65578
3 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -6,6 +6,7 @@
#include "WindowHook.h"
#include "nsWindow.h"
#include "nsWindowDefs.h"
namespace mozilla {
namespace widget {
@ -99,17 +100,20 @@ WindowHook::DeleteIfEmpty(MessageData *data) {
bool
WindowHook::Notify(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam,
LRESULT *aResult) {
MSGResult& aResult)
{
MessageData *data = Lookup(nMsg);
if (!data)
return false;
uint32_t length = data->monitors.Length();
for (uint32_t midx = 0; midx < length; midx++) {
data->monitors[midx].Invoke(hWnd, nMsg, wParam, lParam, aResult);
data->monitors[midx].Invoke(hWnd, nMsg, wParam, lParam, &aResult.mResult);
}
return data->hook.Invoke(hWnd, nMsg, wParam, lParam, aResult);
aResult.mConsumed =
data->hook.Invoke(hWnd, nMsg, wParam, lParam, &aResult.mResult);
return aResult.mConsumed;
}
bool

Просмотреть файл

@ -20,6 +20,8 @@ class nsWindow;
namespace mozilla {
namespace widget {
struct MSGResult;
class WindowHook {
public:
@ -60,7 +62,7 @@ private:
};
bool Notify(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam,
LRESULT *aResult);
MSGResult& aResult);
MessageData *Lookup(UINT nMsg);
MessageData *LookupOrCreate(UINT nMsg);

Просмотреть файл

@ -651,8 +651,8 @@ NS_METHOD nsWindow::Destroy()
// Our windows can be subclassed which may prevent us receiving WM_DESTROY. If OnDestroy()
// didn't get called, call it now.
if (false == mOnDestroyCalled) {
LRESULT result;
mWindowHook.Notify(mWnd, WM_DESTROY, 0, 0, &result);
MSGResult msgResult;
mWindowHook.Notify(mWnd, WM_DESTROY, 0, 0, msgResult);
OnDestroy();
}
@ -4428,7 +4428,7 @@ nsWindow::ExternalHandlerProcessMessage(UINT aMessage,
LPARAM& aLParam,
MSGResult& aResult)
{
if (mWindowHook.Notify(mWnd, aMessage, aWParam, aLParam, &aResult.mResult)) {
if (mWindowHook.Notify(mWnd, aMessage, aWParam, aLParam, aResult)) {
return true;
}