diff options
Diffstat (limited to 'src/com/android/browser/Tab.java')
| -rw-r--r-- | src/com/android/browser/Tab.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java index bab34581f..863fc9513 100644 --- a/src/com/android/browser/Tab.java +++ b/src/com/android/browser/Tab.java @@ -132,6 +132,8 @@ class Tab { // Listener used to know when we move forward or back in the history list. private final WebBackForwardListClient mWebBackForwardListClient; private DataController mDataController; + // State of the auto-login request. + private DeviceAccountLogin mDeviceAccountLogin; // AsyncTask for downloading touch icons DownloadTouchIcon mTouchIconLoader; @@ -530,6 +532,13 @@ class Tab { } } + // Cancel the auto-login process. + if (mDeviceAccountLogin != null) { + mDeviceAccountLogin.cancel(); + mDeviceAccountLogin = null; + mWebViewController.hideAutoLogin(Tab.this); + } + // finally update the UI in the activity if it is in the foreground mWebViewController.onPageStarted(Tab.this, view, favicon); @@ -812,8 +821,27 @@ class Tab { } mWebViewController.onUnhandledKeyEvent(event); } + + @Override + public void onReceivedLoginRequest(WebView view, String realm, + String account, String args) { + new DeviceAccountLogin(mActivity, view, Tab.this, mWebViewController) + .handleLogin(realm, account, args); + } + }; + // Called by DeviceAccountLogin when the Tab needs to have the auto-login UI + // displayed. + void setDeviceAccountLogin(DeviceAccountLogin login) { + mDeviceAccountLogin = login; + } + + // Returns non-null if the title bar should display the auto-login UI. + DeviceAccountLogin getDeviceAccountLogin() { + return mDeviceAccountLogin; + } + // ------------------------------------------------------------------------- // WebChromeClient implementation for the main WebView // ------------------------------------------------------------------------- |
