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

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: Adding tests. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/download/download_target_determiner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e6a9c5c901ac0d6e64bbac27d59607a9755dc115..c21769621c4fa2446ff271e52afc0171590b2c80 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -39,6 +39,7 @@
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/features.h"
@@ -467,7 +468,12 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
NEW_FOREGROUND_TAB,
ui::PAGE_TRANSITION_LINK,
false);
- browser->OpenURL(params);
+
+ if (download->GetMimeType() == "application/x-x509-user-cert")
+ chrome::ShowSettingsSubPage(browser, "certificates");
+ else
+ browser->OpenURL(params);
+
RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_BROWSER);
#else
// ShouldPreferOpeningInBrowser() should never be true on Android.
@@ -722,6 +728,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 | chrome/browser/download/download_target_determiner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698