| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 78 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 79 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 79 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 80 base::Bind(&AwLoginDelegate::CancelOnIOThread, this)); | 80 base::Bind(&AwLoginDelegate::CancelOnIOThread, this)); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void AwLoginDelegate::HandleHttpAuthRequestOnUIThread( | 83 void AwLoginDelegate::HandleHttpAuthRequestOnUIThread( |
| 84 bool first_auth_attempt) { | 84 bool first_auth_attempt) { |
| 85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 86 | 86 |
| 87 aw_http_auth_handler_.reset(AwHttpAuthHandlerBase::Create( | 87 aw_http_auth_handler_.reset(AwHttpAuthHandlerBase::Create( |
| 88 this, auth_info_, first_auth_attempt)); | 88 this, auth_info_.get(), first_auth_attempt)); |
| 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); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void AwLoginDelegate::DeleteAuthHandlerSoon() { | 132 void AwLoginDelegate::DeleteAuthHandlerSoon() { |
| 133 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 133 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| 134 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 134 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 135 base::Bind(&AwLoginDelegate::DeleteAuthHandlerSoon, this)); | 135 base::Bind(&AwLoginDelegate::DeleteAuthHandlerSoon, this)); |
| 136 return; | 136 return; |
| 137 } | 137 } |
| 138 aw_http_auth_handler_.reset(); | 138 aw_http_auth_handler_.reset(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace android_webview | 141 } // namespace android_webview |
| OLD | NEW |