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:
@@ -654,8 +654,14 @@ void LauncherWindow::UpdateGlobalHistory(const BString& url)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool LauncherWindow::AuthenticationChallenge(BString message, BString& inOutUser,
|
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());
|
AuthenticationPanel* panel = new AuthenticationPanel(Frame());
|
||||||
// Panel auto-destructs.
|
// Panel auto-destructs.
|
||||||
return panel->getAuthentication(message, inOutUser, inOutPassword,
|
return panel->getAuthentication(message, inOutUser, inOutPassword,
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ private:
|
|||||||
virtual void UpdateGlobalHistory(const BString& url);
|
virtual void UpdateGlobalHistory(const BString& url);
|
||||||
virtual bool AuthenticationChallenge(BString message, BString& inOutUser,
|
virtual bool AuthenticationChallenge(BString message, BString& inOutUser,
|
||||||
BString& inOutPassword, bool& inOutRememberCredentials,
|
BString& inOutPassword, bool& inOutRememberCredentials,
|
||||||
uint32 failureCount);
|
uint32 failureCount, BWebView* view);
|
||||||
|
|
||||||
void updateTitle(const BString &title);
|
void updateTitle(const BString &title);
|
||||||
void updateTabGroupVisibility();
|
void updateTabGroupVisibility();
|
||||||
|
|||||||
@@ -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
|
int32
|
||||||
TabManager::SelectedTabIndex() const
|
TabManager::SelectedTabIndex() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public:
|
|||||||
BView* ViewForTab(int32 tabIndex) const;
|
BView* ViewForTab(int32 tabIndex) const;
|
||||||
|
|
||||||
void SelectTab(int32 tabIndex);
|
void SelectTab(int32 tabIndex);
|
||||||
|
void SelectTab(BView* containedView);
|
||||||
int32 SelectedTabIndex() const;
|
int32 SelectedTabIndex() const;
|
||||||
void CloseTab(int32 tabIndex);
|
void CloseTab(int32 tabIndex);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user