[Win][MiniBrowser] Remove gMainWindow global variable
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2018 06:25:41 +0000 (06:25 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2018 06:25:41 +0000 (06:25 +0000)
commit3ada85577a91de2fb83805fb0808f5e24154b530
treec11069fcd0e3967868e3b0fbb59253bea824730e
parent995fec4e0ed0483624ce41da86325b0f897ca774
[Win][MiniBrowser] Remove gMainWindow global variable
https://bugs.webkit.org/show_bug.cgi?id=186378

Reviewed by Ryosuke Niwa.

I'm going to support multiple MainWindow in Bug 186263. It should
not be assumed that MainWindow has only one instance. gMainWindow
is used only in DisplayAuthDialog.

* MiniBrowser/win/Common.cpp:
(authDialogProc): Use DWLP_USER to store the dialog data.
(displayAuthDialog): Moved and renamed from
MainWindow::displayAuthDialog. Use DialogBoxParam instead of
DialogBox to pass a data pointer. Do not return S_OK if
DialogBoxParam returns -1. Take a HWND argument as the parent
window.
(DisplayAuthDialog): Deleted.
* MiniBrowser/win/Common.h:
* MiniBrowser/win/MainWindow.cpp:
(authDialogProc): Moved to Common.cpp.
(MainWindow::displayAuthDialog): Ditto.
* MiniBrowser/win/MainWindow.h:
* MiniBrowser/win/ResourceLoadDelegate.cpp:
(ResourceLoadDelegate::didReceiveAuthenticationChallenge):
* MiniBrowser/win/WinMain.cpp:
(wWinMain): Added a local variable mainWindow instead of using
gMainWindow.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232574 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/MiniBrowser/win/Common.cpp
Tools/MiniBrowser/win/Common.h
Tools/MiniBrowser/win/MainWindow.cpp
Tools/MiniBrowser/win/MainWindow.h
Tools/MiniBrowser/win/ResourceLoadDelegate.cpp
Tools/MiniBrowser/win/WinMain.cpp