Selecting the tab for which authentication was requested didn't work anymore.

git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@401 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
stippi
2012-07-03 15:39:56 +02:00
committed by Alexandre Deckner
parent 1cad765a3b
commit 406b936322
+10 -4
View File
@@ -1168,7 +1168,13 @@ BrowserWindow::AuthenticationChallenge(BString message, BString& inOutUser,
{ {
// Switch to the page for which this authentication is required. // Switch to the page for which this authentication is required.
if (view != CurrentWebView()) { if (view != CurrentWebView()) {
fTabManager->SelectTab(view); int32 tabIndex = fTabManager->TabForView(view);
if (tabIndex < 0) {
// page seems to be gone already?
return false;
}
fTabManager->SelectTab(tabIndex);
_TabChanged(tabIndex);
UpdateIfNeeded(); UpdateIfNeeded();
} }
AuthenticationPanel* panel = new AuthenticationPanel(Frame()); AuthenticationPanel* panel = new AuthenticationPanel(Frame());
@@ -1210,7 +1216,7 @@ BrowserWindow::_ShutdownTab(int32 index)
{ {
BView* view = fTabManager->RemoveTab(index); BView* view = fTabManager->RemoveTab(index);
BWebView* webView = dynamic_cast<BWebView*>(view); BWebView* webView = dynamic_cast<BWebView*>(view);
if (webView) if (webView != NULL)
webView->Shutdown(); webView->Shutdown();
else else
delete view; delete view;
@@ -1229,12 +1235,12 @@ BrowserWindow::_TabChanged(int32 index)
SetCurrentWebView(webView); SetCurrentWebView(webView);
if (webView) { if (webView != NULL) {
_UpdateTitle(webView->MainFrameTitle()); _UpdateTitle(webView->MainFrameTitle());
PageUserData* userData = static_cast<PageUserData*>( PageUserData* userData = static_cast<PageUserData*>(
webView->GetUserData()); webView->GetUserData());
if (userData && userData->FocusedView() != NULL) if (userData != NULL && userData->FocusedView() != NULL)
userData->FocusedView()->MakeFocus(true); userData->FocusedView()->MakeFocus(true);
else else
webView->MakeFocus(true); webView->MakeFocus(true);