Chromium Code Reviews| Index: chrome/browser/chromeos/gdata/gdata_protocol_handler.cc |
| diff --git a/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc |
| index 271f8bc6d82f20301ef07eb294b8cdfb5ceb2c9a..8ded7b4fc5374dd7f8e28b022ebe77f3c22952de 100644 |
| --- a/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc |
| +++ b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc |
| @@ -323,9 +323,24 @@ void GDataURLRequestJob::Kill() { |
| weak_ptr_factory_->InvalidateWeakPtrs(); |
| } |
| +const struct MimeTypeReplacement { |
|
Greg Spencer (Chromium)
2012/06/20 16:44:56
Can you move this to the top of the file, under kI
tudalex(Chromium)
2012/06/20 18:20:30
Done.
|
| + const char* original_type; |
| + const char* new_type; |
|
Greg Spencer (Chromium)
2012/06/20 16:44:56
Can you please split this into a struct definition
tudalex(Chromium)
2012/06/20 18:20:30
Done.
|
| +} kMimeTypeReplacements[] = { |
| + {"message/rfc822","multipart/related"} |
| +}; |
| + |
| +std::string FixupMimeType(const std::string& type) { |
|
Greg Spencer (Chromium)
2012/06/20 16:44:56
Since this isn't a member of the class here, can y
tudalex(Chromium)
2012/06/20 18:20:30
Done.
|
| + for (size_t i = 0; i < arraysize(kMimeTypeReplacements); i++) { |
| + if (type == kMimeTypeReplacements[i].original_type) |
| + return kMimeTypeReplacements[i].new_type; |
| + } |
| + return type; |
| +} |
| + |
| bool GDataURLRequestJob::GetMimeType(std::string* mime_type) const { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| - mime_type->assign(mime_type_); |
| + mime_type->assign(FixupMimeType(mime_type_)); |
| return !mime_type->empty(); |
| } |