Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: chrome/browser/android/intercept_download_resource_throttle.cc

Issue 13609002: fix a problem that android cannot download files with basic authentication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/http/http_network_transaction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/android/intercept_download_resource_throttle.h" 5 #include "chrome/browser/android/intercept_download_resource_throttle.h"
6 6
7 #include "content/public/browser/android/download_controller_android.h" 7 #include "content/public/browser/android/download_controller_android.h"
8 #include "content/public/browser/resource_controller.h" 8 #include "content/public/browser/resource_controller.h"
9 #include "net/http/http_request_headers.h" 9 #include "net/http/http_request_headers.h"
10 #include "net/url_request/url_request.h" 10 #include "net/url_request/url_request.h"
(...skipping 16 matching lines...) Expand all
27 27
28 void InterceptDownloadResourceThrottle::WillStartRequest(bool* defer) { 28 void InterceptDownloadResourceThrottle::WillStartRequest(bool* defer) {
29 ProcessDownloadRequest(); 29 ProcessDownloadRequest();
30 } 30 }
31 31
32 void InterceptDownloadResourceThrottle::WillProcessResponse(bool* defer) { 32 void InterceptDownloadResourceThrottle::WillProcessResponse(bool* defer) {
33 ProcessDownloadRequest(); 33 ProcessDownloadRequest();
34 } 34 }
35 35
36 void InterceptDownloadResourceThrottle::ProcessDownloadRequest() { 36 void InterceptDownloadResourceThrottle::ProcessDownloadRequest() {
37 if (request_->method() != net::HttpRequestHeaders::kGetMethod) 37 if (request_->method() != net::HttpRequestHeaders::kGetMethod ||
38 request_->response_info().did_use_http_auth)
38 return; 39 return;
39 40
40 content::DownloadControllerAndroid::Get()->CreateGETDownload( 41 content::DownloadControllerAndroid::Get()->CreateGETDownload(
41 render_process_id_, render_view_id_, request_id_); 42 render_process_id_, render_view_id_, request_id_);
42 controller()->Cancel(); 43 controller()->Cancel();
43 } 44 }
44 45
45 } // namespace 46 } // namespace
OLDNEW
« no previous file with comments | « no previous file | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698