From 23e91b40fa63f80ed4bb5e3c2eb44d485974dd67 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 14 Mar 2008 16:28:03 +0000 Subject: Remove the unnecessary setting of the preffered action in the casees that action was going to be the default one anyway. Don't open twice, just let gecko handle opening in the preferred application. Browse-to doesn't seem to work yet. svn path=/trunk/; revision=8106 --- embed/mozilla/ContentHandler.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'embed/mozilla/ContentHandler.cpp') diff --git a/embed/mozilla/ContentHandler.cpp b/embed/mozilla/ContentHandler.cpp index b7ba3b43f..3535d362c 100644 --- a/embed/mozilla/ContentHandler.cpp +++ b/embed/mozilla/ContentHandler.cpp @@ -416,14 +416,7 @@ NS_METHOD GContentHandler::MIMEDoAction (void) mLauncher->GetMIMEInfo(getter_AddRefs(mimeInfo)); NS_ENSURE_TRUE (mimeInfo, NS_ERROR_FAILURE); -#ifdef HAVE_GECKO_1_9 - nsHandlerInfoAction action; - if (mAction == CONTENT_ACTION_DOWNLOAD) { - action = EPHY_ACTION_BROWSE_TO_FILE; - } else { - action = nsIMIMEInfo::useSystemDefault; - } -#else +#ifndef HAVE_GECKO_1_9 char *info = NULL; if (mAction == CONTENT_ACTION_OPEN) @@ -478,5 +471,20 @@ NS_METHOD GContentHandler::MIMEDoAction (void) mLauncher->SaveToDisk (nsnull, PR_FALSE); } +#ifdef HAVE_GECKO_1_9 + /* We have to do this work down here because the external helper app modifies the + * value after calling SaveToDisk. + */ + nsHandlerInfoAction action; + if (mAction == CONTENT_ACTION_DOWNLOAD) { + action = EPHY_ACTION_BROWSE_TO_FILE; + + /* This won't be able to transport the activation time so we cannot + * do startup notification, but it's the best that was available + */ + mimeInfo->SetPreferredAction (action); + } +#endif + return NS_OK; } -- cgit v1.2.3