Actually, the authentication challenge needs to know for which page it is,

otherwise we may display the login panel above an unrelated page. Tested by
clicking Login on dev.haiku-os.org and Cmd-T to open a new tab before the
login panel shows. Works.


git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@237 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
stippi 2010-02-27 13:31:29 +00:00
parent 3d6558b6ca
commit 50c04c441d
4 changed files with 23 additions and 2 deletions

View File

@ -654,8 +654,14 @@ void LauncherWindow::UpdateGlobalHistory(const BString& url)
}
bool LauncherWindow::AuthenticationChallenge(BString message, BString& inOutUser,
BString& inOutPassword, bool& inOutRememberCredentials, uint32 failureCount)
BString& inOutPassword, bool& inOutRememberCredentials, uint32 failureCount,
BWebView* view)
{
// Switch to the page for which this authentication is required.
if (view != CurrentWebView()) {
m_tabManager->SelectTab(view);
UpdateIfNeeded();
}
AuthenticationPanel* panel = new AuthenticationPanel(Frame());
// Panel auto-destructs.
return panel->getAuthentication(message, inOutUser, inOutPassword,

View File

@ -93,7 +93,7 @@ private:
virtual void UpdateGlobalHistory(const BString& url);
virtual bool AuthenticationChallenge(BString message, BString& inOutUser,
BString& inOutPassword, bool& inOutRememberCredentials,
uint32 failureCount);
uint32 failureCount, BWebView* view);
void updateTitle(const BString &title);
void updateTabGroupVisibility();

View File

@ -1137,6 +1137,20 @@ TabManager::SelectTab(int32 tabIndex)
}
void
TabManager::SelectTab(BView* containedView)
{
int32 count = fCardLayout->CountItems();
for (int32 i = 0; i < count; i++) {
BLayoutItem* item = fCardLayout->ItemAt(i);
if (item->View() == containedView) {
SelectTab(i);
break;
}
}
}
int32
TabManager::SelectedTabIndex() const
{

View File

@ -56,6 +56,7 @@ public:
BView* ViewForTab(int32 tabIndex) const;
void SelectTab(int32 tabIndex);
void SelectTab(BView* containedView);
int32 SelectedTabIndex() const;
void CloseTab(int32 tabIndex);