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 "content/shell/shell_resource_dispatcher_host_delegate.h" | 5 #include "content/shell/shell_resource_dispatcher_host_delegate.h" |
6 | 6 |
7 #include "content/shell/shell_login_dialog.h" | 7 #include "content/shell/shell_login_dialog.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
11 ShellResourceDispatcherHostDelegate::ShellResourceDispatcherHostDelegate() { | 11 ShellResourceDispatcherHostDelegate::ShellResourceDispatcherHostDelegate() { |
12 } | 12 } |
13 | 13 |
14 ShellResourceDispatcherHostDelegate::~ShellResourceDispatcherHostDelegate() { | 14 ShellResourceDispatcherHostDelegate::~ShellResourceDispatcherHostDelegate() { |
15 } | 15 } |
16 | 16 |
17 bool ShellResourceDispatcherHostDelegate::AcceptAuthRequest( | 17 bool ShellResourceDispatcherHostDelegate::AcceptAuthRequest( |
18 net::URLRequest* request, | 18 net::URLRequest* request, |
19 net::AuthChallengeInfo* auth_info) { | 19 net::AuthChallengeInfo* auth_info) { |
20 // Why not give it a try? | 20 // Why not give it a try? |
21 return true; | 21 return true; |
22 } | 22 } |
23 | 23 |
24 ResourceDispatcherHostLoginDelegate* | 24 ResourceDispatcherHostLoginDelegate* |
25 ShellResourceDispatcherHostDelegate::CreateLoginDelegate( | 25 ShellResourceDispatcherHostDelegate::CreateLoginDelegate( |
26 net::AuthChallengeInfo* auth_info, net::URLRequest* request) { | 26 net::AuthChallengeInfo* auth_info, net::URLRequest* request) { |
| 27 if (!login_request_callback_.is_null()) { |
| 28 login_request_callback_.Run(); |
| 29 login_request_callback_.Reset(); |
| 30 return NULL; |
| 31 } |
| 32 |
27 #if !defined(OS_MACOSX) | 33 #if !defined(OS_MACOSX) |
28 // TODO: implement ShellLoginDialog for other platforms, drop this #if | 34 // TODO: implement ShellLoginDialog for other platforms, drop this #if |
29 return NULL; | 35 return NULL; |
30 #else | 36 #else |
31 return new ShellLoginDialog(auth_info, request); | 37 return new ShellLoginDialog(auth_info, request); |
32 #endif | 38 #endif |
33 } | 39 } |
34 | 40 |
35 } // namespace content | 41 } // namespace content |
OLD | NEW |