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 #ifndef ANDROID_WEBVIEW_BROWSER_AW_LOGIN_DELEGATE_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_LOGIN_DELEGATE_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_AW_LOGIN_DELEGATE_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_LOGIN_DELEGATE_H_ |
7 | 7 |
8 #include "android_webview/browser/aw_http_auth_handler_base.h" | 8 #include "android_webview/browser/aw_http_auth_handler_base.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_requ
est_handler.h" | |
13 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" | 12 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" |
14 | 13 |
15 namespace net { | 14 namespace net { |
16 class AuthChallengeInfo; | 15 class AuthChallengeInfo; |
17 class URLRequest; | 16 class URLRequest; |
18 } | 17 } |
19 | 18 |
20 using data_reduction_proxy::DataReductionProxyAuthRequestHandler; | |
21 | |
22 namespace android_webview { | 19 namespace android_webview { |
23 | 20 |
24 class AwLoginDelegate : | 21 class AwLoginDelegate : |
25 public content::ResourceDispatcherHostLoginDelegate { | 22 public content::ResourceDispatcherHostLoginDelegate { |
26 public: | 23 public: |
27 AwLoginDelegate(net::AuthChallengeInfo* auth_info, | 24 AwLoginDelegate(net::AuthChallengeInfo* auth_info, |
28 net::URLRequest* request); | 25 net::URLRequest* request); |
29 | 26 |
30 virtual void Proceed(const base::string16& user, | 27 virtual void Proceed(const base::string16& user, |
31 const base::string16& password); | 28 const base::string16& password); |
32 virtual void Cancel(); | 29 virtual void Cancel(); |
33 | 30 |
34 // from ResourceDispatcherHostLoginDelegate | 31 // from ResourceDispatcherHostLoginDelegate |
35 virtual void OnRequestCancelled() OVERRIDE; | 32 virtual void OnRequestCancelled() OVERRIDE; |
36 | 33 |
37 private: | 34 private: |
38 virtual ~AwLoginDelegate(); | 35 virtual ~AwLoginDelegate(); |
39 void HandleHttpAuthRequestOnUIThread(bool first_auth_attempt); | 36 void HandleHttpAuthRequestOnUIThread(bool first_auth_attempt); |
40 void CancelOnIOThread(); | 37 void CancelOnIOThread(); |
41 void ProceedOnIOThread(const base::string16& user, | 38 void ProceedOnIOThread(const base::string16& user, |
42 const base::string16& password); | 39 const base::string16& password); |
43 void DeleteAuthHandlerSoon(); | 40 void DeleteAuthHandlerSoon(); |
44 | 41 |
45 scoped_ptr<AwHttpAuthHandlerBase> aw_http_auth_handler_; | 42 scoped_ptr<AwHttpAuthHandlerBase> aw_http_auth_handler_; |
46 scoped_refptr<net::AuthChallengeInfo> auth_info_; | 43 scoped_refptr<net::AuthChallengeInfo> auth_info_; |
47 net::URLRequest* request_; | 44 net::URLRequest* request_; |
48 int render_process_id_; | 45 int render_process_id_; |
49 int render_frame_id_; | 46 int render_frame_id_; |
50 scoped_ptr<DataReductionProxyAuthRequestHandler> drp_auth_handler_; | |
51 }; | 47 }; |
52 | 48 |
53 } // namespace android_webview | 49 } // namespace android_webview |
54 | 50 |
55 #endif // ANDROID_WEBVIEW_BROWSER_AW_LOGIN_DELEGATE_H_ | 51 #endif // ANDROID_WEBVIEW_BROWSER_AW_LOGIN_DELEGATE_H_ |
OLD | NEW |