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

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 1423663012: Removing x-x509-user-cert mime handler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing certificate mime types. Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/chrome_download_manager_delegate.cc
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 3d609fb2e733224ca63ce2239f094415f6a16373..4e4a18cb7d7c7d9c59d205280b01663341f0336a 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -465,6 +465,13 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
NEW_FOREGROUND_TAB,
ui::PAGE_TRANSITION_LINK,
false);
+
+ if (download->GetOriginalMimeType() == "application/x-x509-user-cert") {
+ params = content::OpenURLParams(GURL("chrome://settings/certificates"),
Ryan Sleevi 2015/12/08 02:38:37 There's no way to smuggle the file name or pre-war
svaldez 2015/12/08 15:43:39 We could pipe this through, though we'll end up ha
svaldez 2015/12/08 16:34:35 So attempting to pipe this through, there isn't re
Ryan Sleevi 2015/12/09 01:27:24 Fair point. Short of reworking this UI, which we c
+ content::Referrer(), NEW_FOREGROUND_TAB,
+ ui::PAGE_TRANSITION_LINK, false);
+ }
+
browser->OpenURL(params);
RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_BROWSER);
#else
@@ -720,6 +727,11 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDetermined(
target_info->is_filetype_handled_safely)
DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
+#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+ if (item->GetOriginalMimeType() == "application/x-x509-user-cert")
+ DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
+#endif
+
if (target_info->is_dangerous_file)
DownloadItemModel(item).SetIsDangerousFileBasedOnType(true);
}
« no previous file with comments | « no previous file | components/mime_util/mime_util.h » ('j') | content/browser/loader/mime_type_resource_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698