mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 02:31:59 +00:00
Adding more functionality to the genereic remote control. Not very well tested yet but not hooked up to anything. r=syd
This commit is contained in:
parent
9950515fd0
commit
0d2a435172
@ -20,6 +20,7 @@
|
|||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Seth Spitzer <sspitzer@netscape.com>
|
* Seth Spitzer <sspitzer@netscape.com>
|
||||||
|
* Shane Culpepper <pepper@netscape.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var remoteControlProgID = "component://netscape/browser/remote-browser-control";
|
var remoteControlProgID = "component://netscape/browser/remote-browser-control";
|
||||||
@ -48,19 +49,63 @@ var browserRemoteControl = {
|
|||||||
saveAs: function(aURL)
|
saveAs: function(aURL)
|
||||||
{
|
{
|
||||||
dump("saveAs(" + aURL + ")\n");
|
dump("saveAs(" + aURL + ")\n");
|
||||||
return;
|
var saveAsDialog = Components.classes["component://xfer"].getService();
|
||||||
|
saveAsDialog = saveAsDialog.QueryInterface(Components.interfaces.nsIMsgComposeService);
|
||||||
|
if ( !saveAsDialog ) return(false);
|
||||||
|
|
||||||
|
saveAsDialog.SelectFileAndTransferLocation(aURL, null);
|
||||||
|
return(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
mailto: function(mailToList)
|
mailTo: function(mailToList)
|
||||||
{
|
{
|
||||||
dump("mailto(" + mailToList + ")\n");
|
dump("mailto(" + mailToList + ")\n");
|
||||||
return;
|
var msgComposeService = Components.classes["component://netscape/messengercompose"].getService();
|
||||||
|
msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMsgComposeService);
|
||||||
|
if ( !msgComposeService ) return(false);
|
||||||
|
|
||||||
|
if ( mailToList )
|
||||||
|
{
|
||||||
|
msgComposeService.OpenComposeWindowWithValues(null,
|
||||||
|
Components.interfaces.nsIMsgCompType.New,
|
||||||
|
Components.interfaces.nsIMsgCompFormat.Default,
|
||||||
|
mailToList,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msgComposeService.OpenComposeWindow(null,
|
||||||
|
null,
|
||||||
|
Components.interfaces.nsIMsgCompType.New,
|
||||||
|
Components.interfaces.nsIMsgCompFormat.Default,
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
return(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
addBookmark: function(aURL, aTitle)
|
addBookmark: function(aURL, aTitle)
|
||||||
{
|
{
|
||||||
dump("addBookmark(" + aURL + "," + aTitle + ")\n");
|
dump("addBookmark(" + aURL + "," + aTitle + ")\n");
|
||||||
return;
|
var bookmarkService = Components.classes["component://netscape/browser/bookmarks-service"].getService();
|
||||||
|
bookmarkService = bookmarkService.QueryInterface(Components.interfaces.nsIBookmarksService);
|
||||||
|
if ( !bookmarkService ) return(false);
|
||||||
|
|
||||||
|
if ( !aURL ) return(false);
|
||||||
|
if ( aTitle )
|
||||||
|
{
|
||||||
|
bookmarkService.AddBookmark(aURL, aTitle);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bookmarkService.AddBookmark(aURL, null);
|
||||||
|
}
|
||||||
|
return(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user