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

Side by Side Diff: chrome/browser/renderer_host/download_resource_handler.cc

Issue 7538007: Record type of content being downloaded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More mime types Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/download/download_util.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer_host/download_resource_handler.h" 5 #include "chrome/browser/renderer_host/download_resource_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 info->total_bytes = content_length_; 88 info->total_bytes = content_length_;
89 info->state = DownloadItem::IN_PROGRESS; 89 info->state = DownloadItem::IN_PROGRESS;
90 info->download_id = download_id_; 90 info->download_id = download_id_;
91 info->has_user_gesture = request_info->has_user_gesture(); 91 info->has_user_gesture = request_info->has_user_gesture();
92 info->request_handle = DownloadRequestHandle(rdh_, 92 info->request_handle = DownloadRequestHandle(rdh_,
93 global_id_.child_id, 93 global_id_.child_id,
94 render_view_id_, 94 render_view_id_,
95 global_id_.request_id); 95 global_id_.request_id);
96 info->content_disposition = content_disposition_; 96 info->content_disposition = content_disposition_;
97 info->mime_type = response->response_head.mime_type; 97 info->mime_type = response->response_head.mime_type;
98 download_util::RecordDownloadMimeType(info->mime_type);
98 // TODO(ahendrickson) -- Get the last modified time and etag, so we can 99 // TODO(ahendrickson) -- Get the last modified time and etag, so we can
99 // resume downloading. 100 // resume downloading.
100 101
101 std::string content_type_header; 102 std::string content_type_header;
102 if (!response->response_head.headers || 103 if (!response->response_head.headers ||
103 !response->response_head.headers->GetMimeType(&content_type_header)) 104 !response->response_head.headers->GetMimeType(&content_type_header))
104 content_type_header = ""; 105 content_type_header = "";
105 info->original_mime_type = content_type_header; 106 info->original_mime_type = content_type_header;
106 107
107 info->prompt_user_for_save_location = 108 info->prompt_user_for_save_location =
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 " render_view_id_ = " "%d" 256 " render_view_id_ = " "%d"
256 " save_info_.file_path = \"%" PRFilePath "\"" 257 " save_info_.file_path = \"%" PRFilePath "\""
257 " }", 258 " }",
258 request_->url().spec().c_str(), 259 request_->url().spec().c_str(),
259 download_id_, 260 download_id_,
260 global_id_.child_id, 261 global_id_.child_id,
261 global_id_.request_id, 262 global_id_.request_id,
262 render_view_id_, 263 render_view_id_,
263 save_info_.file_path.value().c_str()); 264 save_info_.file_path.value().c_str());
264 } 265 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698