Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib/src/sugar-content-handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/sugar-content-handler.cpp')
-rw-r--r--lib/src/sugar-content-handler.cpp38
1 files changed, 3 insertions, 35 deletions
diff --git a/lib/src/sugar-content-handler.cpp b/lib/src/sugar-content-handler.cpp
index 0597c48..44aae59 100644
--- a/lib/src/sugar-content-handler.cpp
+++ b/lib/src/sugar-content-handler.cpp
@@ -7,6 +7,7 @@
#include <nsIFile.h>
#include "sugar-browser-chandler.h"
+#include "SugarDownload.h"
#include "sugar-content-handler.h"
@@ -27,42 +28,10 @@ GSugarContentHandler::Show (nsIHelperAppLauncher *aLauncher,
nsISupports *aContext,
PRUint32 aReason)
{
- SugarBrowserChandler *browser_chandler;
- nsresult rv;
- nsCString url;
- nsCString mimeType;
- nsString suggested_file_name_utf16;
- nsCString suggested_file_name;
- nsCString tmp_file_name;
-
- NS_ENSURE_TRUE (aLauncher, NS_ERROR_FAILURE);
-
- nsCOMPtr<nsIMIMEInfo> MIMEInfo;
- aLauncher->GetMIMEInfo (getter_AddRefs(MIMEInfo));
- NS_ENSURE_TRUE (MIMEInfo, NS_ERROR_FAILURE);
-
- rv = MIMEInfo->GetMIMEType (mimeType);
-
- nsCOMPtr<nsIURI> uri;
- aLauncher->GetSource (getter_AddRefs(uri));
- NS_ENSURE_TRUE (uri, NS_ERROR_FAILURE);
-
- uri->GetSpec (url);
-
- aLauncher->GetSuggestedFileName (suggested_file_name_utf16);
- NS_UTF16ToCString (suggested_file_name_utf16,
- NS_CSTRING_ENCODING_UTF8, suggested_file_name);
-
nsCOMPtr<nsIFile> tmp_file;
aLauncher->GetTargetFile(getter_AddRefs(tmp_file));
- tmp_file->GetNativeLeafName (tmp_file_name);
-
- browser_chandler = sugar_get_browser_chandler();
- sugar_browser_chandler_handle_content(browser_chandler,
- url.get(),
- suggested_file_name.get(),
- mimeType.get(),
- tmp_file_name.get());
+
+ aLauncher->SaveToDisk (tmp_file, PR_FALSE);
return NS_OK;
}
@@ -74,7 +43,6 @@ NS_IMETHODIMP GSugarContentHandler::PromptForSaveToFile(
const PRUnichar *aSuggestedFileExtension,
nsILocalFile **_retval)
{
-
return NS_OK;
}