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

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: Fix windows strings. Created 5 years, 2 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
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 a21f7b706596c5133d8b63d46564285e2e8517f6..5a0921546ca2b5e0786912e229471268029d52dc 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -458,12 +458,21 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
profile_, chrome::GetActiveDesktop()));
browser = browser_displayer->browser();
}
+
content::OpenURLParams params(
net::FilePathToFileURL(download->GetTargetFilePath()),
content::Referrer(),
NEW_FOREGROUND_TAB,
ui::PAGE_TRANSITION_LINK,
false);
+
+ if (download->GetTargetFilePath().MatchesExtension(
+ FILE_PATH_LITERAL(".crt"))) {
+ params = content::OpenURLParams(GURL("chrome://settings/certificates"),
+ content::Referrer(), NEW_FOREGROUND_TAB,
+ ui::PAGE_TRANSITION_LINK, false);
Ryan Sleevi 2015/10/30 23:33:45 I don't think this is right - this would imply it
svaldez 2015/11/02 16:27:37 This would only apply to OS_LINUX and OS_CHROMEOS
+ }
+
browser->OpenURL(params);
RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_BROWSER);
#else
@@ -729,6 +738,12 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDetermined(
bool ChromeDownloadManagerDelegate::IsOpenInBrowserPreferreredForFile(
const base::FilePath& path) {
+#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+ if (path.MatchesExtension(FILE_PATH_LITERAL(".crt"))) {
Ryan Sleevi 2015/10/30 23:33:46 This doesn't handle the general mimetype, right?
svaldez 2015/11/02 16:27:37 This is explicitly for dealing with downloaded fil
+ return true;
+ }
+#endif
+
#if defined(OS_WIN) || defined(OS_LINUX) || \
(defined(OS_MACOSX) && !defined(OS_IOS))
if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf"))) {

Powered by Google App Engine
This is Rietveld 408576698