Implement Privacy menu on Mac

This commit is contained in:
sdagley%netscape.com 1998-10-07 01:34:35 +00:00
parent ac3f82b2fd
commit 0dfd1d18a9
6 changed files with 83 additions and 0 deletions

View File

@ -183,6 +183,8 @@ PREventQueue *mozilla_event_queue = NULL;
#endif
#include <Balloons.h>
#include "privacy.h"
// HERE ONLY UNTIL NAV SERVICES CODE MERGED INTO TIP
Boolean SimpleOpenDlog ( short numTypes, const OSType typeList[], FSSpec* outFSSpec ) ;
@ -2521,9 +2523,18 @@ void CFrontApp::FindCommandStatus( CommandT command, Boolean& enabled,
case cmd_BookmarksWindow:
case cmd_HistoryWindow:
case cmd_PrivDisplayCookies:
case cmd_PrivDisplaySignons:
case cmd_PrivAboutPrivacy:
enabled = !Memory_MemoryIsLow();
break;
case cmd_PrivAnonMode:
usesMark = true;
mark = PRVCY_IsAnonymous() ? 0x12 : 0;
enabled = TRUE;
break;
case cmd_LaunchImportModule:
enabled = mImportModuleExists;
break;
@ -2651,6 +2662,31 @@ Boolean CFrontApp::ObeyCommand(CommandT inCommand, void* ioParam)
}
break;
case cmd_PrivAnonMode:
{
PRVCY_ToggleAnonymous();
SetUpdateCommandStatus(true);
break;
}
case cmd_PrivDisplayCookies:
{
NET_DisplayCookieInfoAsHTML(nil);
break;
}
case cmd_PrivDisplaySignons:
{
SI_DisplaySignonInfoAsHTML(nil);
break;
}
case cmd_PrivAboutPrivacy:
{
DoGetURL(PRVCY_TutorialURL());
break;
}
case cmd_NCOpenNewWindow:
{
HT_Resource node = reinterpret_cast<HT_Resource>(ioParam);

View File

@ -45,6 +45,7 @@ extern "C" {
#include "resgui.h"
#include "CMochaHacks.h"
#include "privacy.h"
class CBrowserViewDoDragReceiveMochaCallback;
@ -202,6 +203,18 @@ void CBrowserView::FindCommandStatus(CommandT inCommand,
outEnabled = HasFTPUpload( GetContext() ) && !isHTMLHelp;
break;
case cmd_PrivDisplayPolicy:
mwcontext = *GetContext();
if (mwcontext && !XP_IsContextBusy(mwcontext))
outEnabled = PRVCY_CurrentHasPrivacyPolicy(mwcontext);
else
outEnabled = false;
break;
case cmd_PrivDisplaySiteInfo:
outEnabled = true;
break;
default:
Inherited::FindCommandStatus(inCommand, outEnabled, outUsesMark, outMark, outName);
break;
@ -211,6 +224,7 @@ void CBrowserView::FindCommandStatus(CommandT inCommand,
Boolean CBrowserView::ObeyCommand(CommandT inCommand, void* ioParam)
{
Boolean cmdHandled = false;
MWContext* mwcontext;
switch (inCommand)
{
@ -264,6 +278,8 @@ Boolean CBrowserView::ObeyCommand(CommandT inCommand, void* ioParam)
request->files_to_post = newFileList;
GetContext()->SwitchLoadURL( request, FO_CACHE_AND_PRESENT );
}
cmdHandled = true;
}
break;
@ -273,6 +289,21 @@ Boolean CBrowserView::ObeyCommand(CommandT inCommand, void* ioParam)
// CURLDispatcher::GetURLDispatcher()->DispatchToView(mContext, aboutURL, FO_CACHE_AND_PRESENT, false, 1010, false);
// break;
case cmd_PrivDisplayPolicy:
mwcontext = *GetContext();
char * url = PRVCY_GetCurrentPrivacyPolicyURL(mwcontext);
URL_Struct* theURL = NET_CreateURLStruct(url, NET_DONT_RELOAD);
if (theURL)
FE_MakeNewWindow(NULL, theURL, NULL, NULL);
cmdHandled = true;
break;
case cmd_PrivDisplaySiteInfo:
mwcontext = *GetContext();
PRVCY_SiteInfo(mwcontext);
cmdHandled = true;
break;
default:
cmdHandled = Inherited::ObeyCommand(inCommand, ioParam);
break;

View File

@ -426,6 +426,8 @@ void CBrowserWindow::FindCommandStatus(
case cmd_Reload:
case cmd_FontLarger:
case cmd_FontSmaller:
case cmd_PrivDisplayPolicy:
case cmd_PrivDisplaySiteInfo:
{
// Need to be very careful what gets delegated here, in order to aviod infinite
// recursion a la bug #313498. Handling the command status in CBrowserView is not
@ -601,6 +603,8 @@ Boolean CBrowserWindow::ObeyCommand(
case cmd_FTPUpload:
case cmd_FontLarger:
case cmd_FontSmaller:
case cmd_PrivDisplayPolicy:
case cmd_PrivDisplaySiteInfo:
{
// Delegate this to the view.
GetHTMLView()->ObeyCommand(inCommand, ioParam);

View File

@ -2325,6 +2325,8 @@ void CHTMLView::FindCommandStatus(CommandT inCommand,
}
break;
case cmd_FTPUpload: // fix for #313498
case cmd_PrivDisplayPolicy:
case cmd_PrivDisplaySiteInfo:
outEnabled = false;
break;
default:
@ -2663,6 +2665,8 @@ Boolean CHTMLView::ObeyCommand(CommandT inCommand, void* ioParam)
case cmd_FTPUpload:
case msg_TabSelect:
case cmd_PrivDisplayPolicy:
case cmd_PrivDisplaySiteInfo:
cmdHandled = true;
break;

View File

@ -90,6 +90,14 @@
#define cmd_ShowLocationBar 1500
#define cmd_HideLocationBar 1501
// Privacy commands
#define cmd_PrivAnonMode 1550
#define cmd_PrivDisplayPolicy 1551
#define cmd_PrivDisplayCookies 1552
#define cmd_PrivDisplaySignons 1553
#define cmd_PrivDisplaySiteInfo 1554
#define cmd_PrivAboutPrivacy 1555
/* nav center toggle in Netscape_Constants.h */
#define cmd_FancyFTP 1020
#define cmd_SaveDefaultCharset 1021