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

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

Issue 23064011: Consolidate scheme checks into an easy GURL method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/dial/dial_device_data.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 24 matching lines...) Expand all
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 request_->response_info().did_use_http_auth)
39 return; 39 return;
40 40
41 if (request_->url_chain().empty()) 41 if (request_->url_chain().empty())
42 return; 42 return;
43 43
44 GURL url = request_->url_chain().back(); 44 GURL url = request_->url_chain().back();
45 if (!url.SchemeIs("http") && !url.SchemeIs("https")) 45 if (!url.SchemeIsHTTPOrHTTPS())
46 return; 46 return;
47 47
48 content::DownloadControllerAndroid::Get()->CreateGETDownload( 48 content::DownloadControllerAndroid::Get()->CreateGETDownload(
49 render_process_id_, render_view_id_, request_id_); 49 render_process_id_, render_view_id_, request_id_);
50 controller()->Cancel(); 50 controller()->Cancel();
51 } 51 }
52 52
53 } // namespace 53 } // namespace
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/dial/dial_device_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698