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

Side by Side Diff: chrome/browser/android/download/download_controller_base.cc

Issue 2014803002: Move DownloadControllerAndroid from content/ to chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed deprecated cookie apis Created 4 years, 6 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
OLDNEW
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/android/download/download_controller_base.h"
6 #include "chrome/common/chrome_content_client.h"
7 #include "content/public/browser/resource_request_info.h"
8 #include "net/url_request/url_request.h"
9
10 // static
11 DownloadControllerBase* DownloadControllerBase::download_controller_ = nullptr;
12
13 using content::ResourceRequestInfo;
14
15 DownloadInfo::DownloadInfo(const net::URLRequest* request)
16 : has_user_gesture(false) {
qinmin 2016/06/13 18:31:44 nit: fix indent
Jinsuk Kim 2016/06/14 00:55:58 Done.
17 request->GetResponseHeaderByName("content-disposition", &content_disposition);
18
19 if (request->response_headers())
20 request->response_headers()->GetMimeType(&original_mime_type);
qinmin 2016/06/13 18:31:44 ditto
Jinsuk Kim 2016/06/14 00:55:58 Done.
21
22 request->extra_request_headers().GetHeader(
23 net::HttpRequestHeaders::kUserAgent, &user_agent);
24 if (user_agent.empty())
25 user_agent = GetUserAgent();
qinmin 2016/06/13 18:31:44 ditto here and below
Jinsuk Kim 2016/06/14 00:55:58 Done.
26 GURL referer_url(request->referrer());
27 if (referer_url.is_valid())
28 referer = referer_url.spec();
29 if (!request->url_chain().empty()) {
30 original_url = request->url_chain().front();
31 url = request->url_chain().back();
32 }
33
34 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
35 if (info)
36 has_user_gesture = info->HasUserGesture();
37 }
38
39 DownloadInfo::DownloadInfo(const DownloadInfo& other) = default;
40
41 DownloadInfo::~DownloadInfo() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698