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 "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 80 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
81 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 81 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
82 base::Bind(&AwLoginDelegate::CancelOnIOThread, this)); | 82 base::Bind(&AwLoginDelegate::CancelOnIOThread, this)); |
83 } | 83 } |
84 | 84 |
85 void AwLoginDelegate::HandleHttpAuthRequestOnUIThread( | 85 void AwLoginDelegate::HandleHttpAuthRequestOnUIThread( |
86 bool first_auth_attempt) { | 86 bool first_auth_attempt) { |
87 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 87 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
88 | 88 |
89 aw_http_auth_handler_.reset( | 89 aw_http_auth_handler_.reset( |
90 AwHttpAuthHandler::Create(this, auth_info_.get(), first_auth_attempt)); | 90 new AwHttpAuthHandler(this, auth_info_.get(), first_auth_attempt)); |
91 | 91 |
92 RenderFrameHost* render_frame_host = RenderFrameHost::FromID( | 92 RenderFrameHost* render_frame_host = RenderFrameHost::FromID( |
93 render_process_id_, render_frame_id_); | 93 render_process_id_, render_frame_id_); |
94 WebContents* web_contents = WebContents::FromRenderFrameHost( | 94 WebContents* web_contents = WebContents::FromRenderFrameHost( |
95 render_frame_host); | 95 render_frame_host); |
96 if (!aw_http_auth_handler_->HandleOnUIThread(web_contents)) { | 96 if (!aw_http_auth_handler_->HandleOnUIThread(web_contents)) { |
97 Cancel(); | 97 Cancel(); |
98 return; | 98 return; |
99 } | 99 } |
100 } | 100 } |
(...skipping 28 matching lines...) Expand all Loading... |
129 void AwLoginDelegate::DeleteAuthHandlerSoon() { | 129 void AwLoginDelegate::DeleteAuthHandlerSoon() { |
130 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 130 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
131 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 131 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
132 base::Bind(&AwLoginDelegate::DeleteAuthHandlerSoon, this)); | 132 base::Bind(&AwLoginDelegate::DeleteAuthHandlerSoon, this)); |
133 return; | 133 return; |
134 } | 134 } |
135 aw_http_auth_handler_.reset(); | 135 aw_http_auth_handler_.reset(); |
136 } | 136 } |
137 | 137 |
138 } // namespace android_webview | 138 } // namespace android_webview |
OLD | NEW |