| 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // could attach that to the URLRequests SupportsUserData::Data and bubble | 35 // could attach that to the URLRequests SupportsUserData::Data and bubble |
| 36 // that up to Java for the purpose of the API. | 36 // that up to Java for the purpose of the API. |
| 37 ResourceRequestInfo::GetRenderViewForRequest( | 37 ResourceRequestInfo::GetRenderViewForRequest( |
| 38 request, &render_process_id_, &render_view_id_); | 38 request, &render_process_id_, &render_view_id_); |
| 39 | 39 |
| 40 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 40 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 41 base::Bind(&AwLoginDelegate::HandleHttpAuthRequestOnUIThread, | 41 base::Bind(&AwLoginDelegate::HandleHttpAuthRequestOnUIThread, |
| 42 make_scoped_refptr(this))); | 42 make_scoped_refptr(this))); |
| 43 } | 43 } |
| 44 | 44 |
| 45 AwLoginDelegate::~AwLoginDelegate() { |
| 46 } |
| 47 |
| 45 void AwLoginDelegate::Proceed(const string16& user, | 48 void AwLoginDelegate::Proceed(const string16& user, |
| 46 const string16& password) { | 49 const string16& password) { |
| 47 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 50 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 48 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 51 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 49 base::Bind(&AwLoginDelegate::ProceedOnIOThread, | 52 base::Bind(&AwLoginDelegate::ProceedOnIOThread, |
| 50 make_scoped_refptr(this), user, password)); | 53 make_scoped_refptr(this), user, password)); |
| 51 } | 54 } |
| 52 | 55 |
| 53 void AwLoginDelegate::Cancel() { | 56 void AwLoginDelegate::Cancel() { |
| 54 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 57 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 94 } |
| 92 } | 95 } |
| 93 | 96 |
| 94 void AwLoginDelegate::OnRequestCancelled() { | 97 void AwLoginDelegate::OnRequestCancelled() { |
| 95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 98 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 96 request_ = NULL; | 99 request_ = NULL; |
| 97 aw_http_auth_handler_.reset(); | 100 aw_http_auth_handler_.reset(); |
| 98 } | 101 } |
| 99 | 102 |
| 100 } // namespace android_webview | 103 } // namespace android_webview |
| OLD | NEW |