Chromium Code Reviews| 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/renderer_host/aw_resource_dispatcher_host_dele gate.h" | 5 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/aw_login_delegate.h" | 7 #include "android_webview/browser/aw_login_delegate.h" |
| 8 #include "android_webview/browser/aw_intercept_navigation_resource_throttle.h" | |
|
benm (inactive)
2012/09/19 11:04:04
alpha ordering
mkosiba (inactive)
2012/09/25 18:01:47
Done.
| |
| 8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 10 #include "content/public/browser/resource_dispatcher_host.h" | 11 #include "content/public/browser/resource_dispatcher_host.h" |
| 11 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" | 12 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" |
| 12 #include "content/public/browser/resource_throttle.h" | 13 #include "content/public/browser/resource_throttle.h" |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 base::LazyInstance<android_webview::AwResourceDispatcherHostDelegate> | 17 base::LazyInstance<android_webview::AwResourceDispatcherHostDelegate> |
| 17 g_webview_resource_dispatcher_host_delegate = LAZY_INSTANCE_INITIALIZER; | 18 g_webview_resource_dispatcher_host_delegate = LAZY_INSTANCE_INITIALIZER; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 34 } | 35 } |
| 35 | 36 |
| 36 void AwResourceDispatcherHostDelegate::RequestBeginning( | 37 void AwResourceDispatcherHostDelegate::RequestBeginning( |
| 37 net::URLRequest* request, | 38 net::URLRequest* request, |
| 38 content::ResourceContext* resource_context, | 39 content::ResourceContext* resource_context, |
| 39 ResourceType::Type resource_type, | 40 ResourceType::Type resource_type, |
| 40 int child_id, | 41 int child_id, |
| 41 int route_id, | 42 int route_id, |
| 42 bool is_continuation_of_transferred_request, | 43 bool is_continuation_of_transferred_request, |
| 43 ScopedVector<content::ResourceThrottle>* throttles) { | 44 ScopedVector<content::ResourceThrottle>* throttles) { |
| 45 | |
| 46 if (resource_type == ResourceType::MAIN_FRAME) { | |
| 47 throttles->push_back( | |
| 48 AwInterceptNavigationResourceThrottle::Create(request)); | |
| 49 } | |
| 44 } | 50 } |
| 45 | 51 |
| 46 bool AwResourceDispatcherHostDelegate::AcceptAuthRequest( | 52 bool AwResourceDispatcherHostDelegate::AcceptAuthRequest( |
| 47 net::URLRequest* request, | 53 net::URLRequest* request, |
| 48 net::AuthChallengeInfo* auth_info) { | 54 net::AuthChallengeInfo* auth_info) { |
| 49 return true; | 55 return true; |
| 50 } | 56 } |
| 51 | 57 |
| 52 content::ResourceDispatcherHostLoginDelegate* | 58 content::ResourceDispatcherHostLoginDelegate* |
| 53 AwResourceDispatcherHostDelegate::CreateLoginDelegate( | 59 AwResourceDispatcherHostDelegate::CreateLoginDelegate( |
| 54 net::AuthChallengeInfo* auth_info, | 60 net::AuthChallengeInfo* auth_info, |
| 55 net::URLRequest* request) { | 61 net::URLRequest* request) { |
| 56 return new AwLoginDelegate(auth_info, request); | 62 return new AwLoginDelegate(auth_info, request); |
| 57 } | 63 } |
| 58 | 64 |
| 59 } | 65 } |
| OLD | NEW |