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 "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" | 5 #include "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 #include <google/protobuf/repeated_field.h> | 101 #include <google/protobuf/repeated_field.h> |
102 #else | 102 #else |
103 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 103 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
104 #endif | 104 #endif |
105 | 105 |
106 #if defined(OS_ANDROID) | 106 #if defined(OS_ANDROID) |
107 #include "chrome/browser/loader/data_reduction_proxy_resource_throttle_android.h
" | 107 #include "chrome/browser/loader/data_reduction_proxy_resource_throttle_android.h
" |
108 #include "components/navigation_interception/intercept_navigation_delegate.h" | 108 #include "components/navigation_interception/intercept_navigation_delegate.h" |
109 #endif | 109 #endif |
110 | 110 |
| 111 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 112 #include "chrome/browser/android/offline_pages/downloads/resource_throttle.h" |
| 113 #endif |
| 114 |
111 #if defined(OS_CHROMEOS) | 115 #if defined(OS_CHROMEOS) |
112 #include "chrome/browser/chromeos/login/signin/merge_session_resource_throttle.h
" | 116 #include "chrome/browser/chromeos/login/signin/merge_session_resource_throttle.h
" |
113 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" | 117 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" |
114 #endif | 118 #endif |
115 | 119 |
116 using content::BrowserThread; | 120 using content::BrowserThread; |
117 using content::RenderViewHost; | 121 using content::RenderViewHost; |
118 using content::ResourceDispatcherHostLoginDelegate; | 122 using content::ResourceDispatcherHostLoginDelegate; |
119 using content::ResourceRequestInfo; | 123 using content::ResourceRequestInfo; |
120 using content::ResourceType; | 124 using content::ResourceType; |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 request->url(), request->method())); | 542 request->url(), request->method())); |
539 } | 543 } |
540 | 544 |
541 // If this isn't a new request, the standard resource throttles have already | 545 // If this isn't a new request, the standard resource throttles have already |
542 // been added, so no need to add them again. | 546 // been added, so no need to add them again. |
543 if (is_new_request) { | 547 if (is_new_request) { |
544 AppendStandardResourceThrottles(request, | 548 AppendStandardResourceThrottles(request, |
545 resource_context, | 549 resource_context, |
546 content::RESOURCE_TYPE_MAIN_FRAME, | 550 content::RESOURCE_TYPE_MAIN_FRAME, |
547 throttles); | 551 throttles); |
| 552 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 553 // On Android, forward text/html downloads to OfflinePages backend. |
| 554 throttles->push_back( |
| 555 new offline_pages::downloads::ResourceThrottle(request)); |
| 556 #endif |
548 } | 557 } |
549 } | 558 } |
550 | 559 |
551 ResourceDispatcherHostLoginDelegate* | 560 ResourceDispatcherHostLoginDelegate* |
552 ChromeResourceDispatcherHostDelegate::CreateLoginDelegate( | 561 ChromeResourceDispatcherHostDelegate::CreateLoginDelegate( |
553 net::AuthChallengeInfo* auth_info, net::URLRequest* request) { | 562 net::AuthChallengeInfo* auth_info, net::URLRequest* request) { |
554 return CreateLoginPrompt(auth_info, request); | 563 return CreateLoginPrompt(auth_info, request); |
555 } | 564 } |
556 | 565 |
557 bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol( | 566 bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol( |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, | 897 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, |
889 base::Unretained(this), url, request_loading_time)); | 898 base::Unretained(this), url, request_loading_time)); |
890 return; | 899 return; |
891 } | 900 } |
892 | 901 |
893 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? | 902 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? |
894 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); | 903 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); |
895 rappor::SampleDomainAndRegistryFromGURL( | 904 rappor::SampleDomainAndRegistryFromGURL( |
896 g_browser_process->rappor_service(), metric_name, url); | 905 g_browser_process->rappor_service(), metric_name, url); |
897 } | 906 } |
OLD | NEW |