| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "android_webview/browser/aw_login_delegate.h" | 5 #include "android_webview/browser/aw_login_delegate.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 RenderViewHost* render_view_host = RenderViewHost::FromID( | 90 RenderViewHost* render_view_host = RenderViewHost::FromID( |
| 91 render_process_id_, render_view_id_); | 91 render_process_id_, render_view_id_); |
| 92 if (!render_view_host) { | 92 if (!render_view_host) { |
| 93 Cancel(); | 93 Cancel(); |
| 94 return; | 94 return; |
| 95 } | 95 } |
| 96 | 96 |
| 97 WebContents* web_contents = WebContents::FromRenderViewHost( | 97 WebContents* web_contents = WebContents::FromRenderViewHost( |
| 98 render_view_host); | 98 render_view_host); |
| 99 aw_http_auth_handler_->HandleOnUIThread(web_contents); | 99 if (!aw_http_auth_handler_->HandleOnUIThread(web_contents)) { |
| 100 Cancel(); |
| 101 return; |
| 102 } |
| 100 } | 103 } |
| 101 | 104 |
| 102 void AwLoginDelegate::CancelOnIOThread() { | 105 void AwLoginDelegate::CancelOnIOThread() { |
| 103 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 104 if (request_) { | 107 if (request_) { |
| 105 request_->CancelAuth(); | 108 request_->CancelAuth(); |
| 106 ResourceDispatcherHost::Get()->ClearLoginDelegateForRequest(request_); | 109 ResourceDispatcherHost::Get()->ClearLoginDelegateForRequest(request_); |
| 107 request_ = NULL; | 110 request_ = NULL; |
| 108 } | 111 } |
| 109 DeleteAuthHandlerSoon(); | 112 DeleteAuthHandlerSoon(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 129 void AwLoginDelegate::DeleteAuthHandlerSoon() { | 132 void AwLoginDelegate::DeleteAuthHandlerSoon() { |
| 130 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 133 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| 131 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 134 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 132 base::Bind(&AwLoginDelegate::DeleteAuthHandlerSoon, this)); | 135 base::Bind(&AwLoginDelegate::DeleteAuthHandlerSoon, this)); |
| 133 return; | 136 return; |
| 134 } | 137 } |
| 135 aw_http_auth_handler_.reset(); | 138 aw_http_auth_handler_.reset(); |
| 136 } | 139 } |
| 137 | 140 |
| 138 } // namespace android_webview | 141 } // namespace android_webview |
| OLD | NEW |