blob: 44aae591ad7992fc051c3699012757b264c0b6e7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#include <stdio.h>
#include <nsStringAPI.h>
#include <nsCExternalHandlerService.h>
#include <nsIMIMEInfo.h>
#include <nsIURL.h>
#include <nsIFile.h>
#include "sugar-browser-chandler.h"
#include "SugarDownload.h"
#include "sugar-content-handler.h"
GSugarContentHandler::GSugarContentHandler()
{
}
GSugarContentHandler::~GSugarContentHandler()
{
}
NS_IMPL_ISUPPORTS1(GSugarContentHandler, nsIHelperAppLauncherDialog)
NS_IMETHODIMP
GSugarContentHandler::Show (nsIHelperAppLauncher *aLauncher,
nsISupports *aContext,
PRUint32 aReason)
{
nsCOMPtr<nsIFile> tmp_file;
aLauncher->GetTargetFile(getter_AddRefs(tmp_file));
aLauncher->SaveToDisk (tmp_file, PR_FALSE);
return NS_OK;
}
NS_IMETHODIMP GSugarContentHandler::PromptForSaveToFile(
nsIHelperAppLauncher *aLauncher,
nsISupports *aWindowContext,
const PRUnichar *aDefaultFile,
const PRUnichar *aSuggestedFileExtension,
nsILocalFile **_retval)
{
return NS_OK;
}
|