Bug 651622 - Remove WinCE code from browser/*; r=dolske

This commit is contained in:
Ed Morley 2011-04-22 10:38:41 +02:00
parent f1dbe7df75
commit 7136395d5d
16 changed files with 8 additions and 344 deletions

View File

@ -84,7 +84,7 @@ include $(topsrcdir)/config/rules.mk
else
# Build a binary bootstrapping with XRE_main
ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
else
PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
@ -161,16 +161,8 @@ include $(topsrcdir)/config/config.mk
ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
ifdef WINCE
WIN32_EXE_LDFLAGS += -ENTRY:mainWCRTStartup
else
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
endif
ifdef WINCE
EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME,corelibc)
endif
ifdef BUILD_STATIC_LIBS
include $(topsrcdir)/config/static-config.mk
@ -189,7 +181,7 @@ OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 v
OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
endif
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
ifeq ($(OS_ARCH),WINNT)
RCINCLUDE = splash.rc
ifndef GNU_CC
RCFLAGS += -DMOZ_PHOENIX -I$(srcdir)
@ -248,7 +240,7 @@ endif
endif
endif
ifneq (,$(filter-out OS2 WINNT WINCE,$(OS_ARCH)))
ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
$(MOZ_APP_NAME):: $(topsrcdir)/build/unix/mozilla.in $(GLOBAL_DEPS)
cat $< | sed -e "s|%MOZAPPDIR%|$(installdir)|" \
@ -290,13 +282,6 @@ libs::
endif
endif
ifdef WINCE
ifdef MOZ_FASTSTART
libs::
cp -f $(DIST)/bin/faststartstub.exe $(DIST)/bin/$(MOZ_APP_NAME)faststart.exe
endif
endif
libs:: $(srcdir)/profile/prefs.js
$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile

View File

@ -308,12 +308,7 @@ pref("browser.download.saveLinkAsFilenameTimeout", 1000);
pref("browser.download.useDownloadDir", true);
#ifdef WINCE
pref("browser.download.folderList", 2);
pref("browser.download.dir", "\\Storage Card");
#else
pref("browser.download.folderList", 1);
#endif
pref("browser.download.manager.showAlertOnComplete", true);
pref("browser.download.manager.showAlertInterval", 2000);
pref("browser.download.manager.retention", 2);
@ -371,11 +366,7 @@ pref("browser.link.open_newwindow", 3);
pref("browser.link.open_newwindow.restriction", 2);
// Tabbed browser
#ifndef WINCE
pref("browser.tabs.autoHide", false);
#else
pref("browser.tabs.autoHide", true);
#endif
pref("browser.tabs.closeWindowWithLastTab", true);
pref("browser.tabs.insertRelatedAfterCurrent", true);
pref("browser.tabs.warnOnClose", true);
@ -425,11 +416,6 @@ pref("javascript.options.showInConsole", true);
pref("general.warnOnAboutConfig", false);
#endif
#ifdef WINCE
// Set the threshold higher to avoid some slow script warnings
pref("dom.max_script_run_time", 20);
#endif
// This is the pref to control the location bar, change this to true to
// force this - this makes the origin of popup windows more obvious to avoid
// spoofing. We would rather not do it by default because it affects UE for web
@ -775,11 +761,7 @@ pref("browser.rights.3.shown", false);
pref("browser.rights.override", true);
#endif
#ifdef WINCE
pref("browser.sessionstore.resume_from_crash", false);
#else
pref("browser.sessionstore.resume_from_crash", true);
#endif
pref("browser.sessionstore.resume_session_once", false);
// minimal interval between two save operations in milliseconds
@ -899,39 +881,6 @@ pref("browser.bookmarks.editDialog.firstEditField", "namePicker");
pref("geo.wifi.uri", "https://www.google.com/loc/json");
pref("geo.wifi.protocol", 0);
#ifdef WINCE
// tweak awesomebar -- increase the delay until a search happens.
pref("browser.urlbar.delay", 250);
// disable safe browsing, due to perf hit
pref("browser.safebrowsing.enabled", false);
pref("browser.safebrowsing.malware.enabled", false);
// don't check for default browser
pref("browser.shell.checkDefaultBrowser", false);
// disable bfcache for memory
pref("browser.sessionhistory.max_total_viewers", 0);
pref("browser.sessionhistory.optimize_eviction", false);
// tweak default content sink prefs
pref("content.sink.interactive_deflect_count", 10); /* default 0 */
pref("content.sink.perf_deflect_count", 50); /* default 200 */
pref("content.sink.interactive_parse_time", 5000); /* default 3000 */
pref("content.sink.perf_parse_time", 150000); /* default 360000 */
pref("content.sink.pending_event_mode", 0); /* default 1 */
pref("content.sink.event_probe_rate", 1); /* default 1 */
pref("content.sink.interactive_time", 750000); /* default 750000 */
pref("content.sink.initial_perf_time", 500000); /* default 2000000 */
pref("content.sink.enable_perf_mode", 0); /* default 0; 0 == switch, 1 == stay interactive, 2 == stay perf */
// Write sessionstore.js less often
pref("browser.sessionstore.interval", 60000);
#endif /* WINCE */
// Whether to use a panel that looks like an OS X sheet for customization
#ifdef XP_MACOSX
pref("toolbar.customization.usesheet", true);
@ -954,7 +903,6 @@ pref("dom.ipc.plugins.enabled", true);
#endif
#ifdef XP_WIN
#ifndef WINCE
pref("browser.taskbar.previews.enable", false);
pref("browser.taskbar.previews.max", 20);
pref("browser.taskbar.previews.cachetime", 5);
@ -965,7 +913,6 @@ pref("browser.taskbar.lists.maxListItemCount", 7);
pref("browser.taskbar.lists.tasks.enabled", true);
pref("browser.taskbar.lists.refreshInSeconds", 120);
#endif
#endif
#ifdef MOZ_SERVICES_SYNC
// The sync engines to use.

View File

@ -75,10 +75,8 @@ DEFINES += -DHAVE_SHELL_SERVICE=1
endif
ifneq (,$(filter windows cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
ifneq ($(OS_ARCH),WINCE)
DEFINES += -DCONTEXT_COPY_IMAGE_CONTENTS=1
endif
endif
ifneq (,$(filter windows, $(MOZ_WIDGET_TOOLKIT)))
DEFINES += -DCAN_DRAW_IN_TITLEBAR=1

View File

@ -91,7 +91,6 @@
accesskey="&sendPageCmd.accesskey;"
command="Browser:SendLink"/>
<menuseparator/>
#ifndef WINCE
<menuitem id="menu_printSetup"
label="&printSetupCmd.label;"
accesskey="&printSetupCmd.accesskey;"
@ -114,7 +113,6 @@
oncommand="BrowserImport();"/>
#ifndef XP_MACOSX
<menuseparator/>
#endif
#endif
<menuitem id="goOfflineMenuitem"
label="&goOfflineCmd.label;"

View File

@ -188,7 +188,6 @@ let gInitialPages = [
XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
#ifdef XP_WIN
#ifndef WINCE
const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
if (WINTASKBAR_CONTRACTID in Cc &&
Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
@ -204,7 +203,6 @@ XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
}
};
}
#endif
#endif
return null;
});

View File

@ -467,11 +467,7 @@
<toolbox id="navigator-toolbox"
defaultmode="icons" mode="icons"
#ifdef WINCE
defaulticonsize="small" iconsize="small"
#else
iconsize="large"
#endif
tabsontop="true"
persist="tabsontop">
<!-- Menu -->
@ -499,13 +495,8 @@
<toolbar id="nav-bar" class="toolbar-primary chromeclass-toolbar"
toolbarname="&navbarCmd.label;" accesskey="&navbarCmd.accesskey;"
fullscreentoolbar="true" mode="icons" customizable="true"
#ifdef WINCE
iconsize="small" defaulticonsize="small"
defaultset="unified-back-forward-button,urlbar-container,reload-button,stop-button,search-container,home-button,bookmarks-menu-button-container,navigator-throbber,fullscreenflex,window-controls"
#else
iconsize="large"
defaultset="unified-back-forward-button,urlbar-container,reload-button,stop-button,search-container,home-button,bookmarks-menu-button-container,fullscreenflex,window-controls"
#endif
context="toolbar-context-menu">
<toolbaritem id="unified-back-forward-button" class="chromeclass-toolbar-additional"

View File

@ -70,17 +70,12 @@ PARALLEL_DIRS = \
sessionstore \
shell \
sidebar \
migration \
$(NULL)
ifndef WINCE
PARALLEL_DIRS += migration
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
ifndef WINCE
PARALLEL_DIRS += wintaskbar
endif
endif
ifdef MOZ_SAFE_BROWSING
PARALLEL_DIRS += safebrowsing

View File

@ -54,13 +54,10 @@ endif
EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib)
# migration requires mozreg, which doesn't build on WINCE; only include
# it on non-CE
ifndef WINCE
# migration requires mozreg
LOCAL_INCLUDES += -I$(srcdir)/../migration/src
SHARED_LIBRARY_LIBS += ../migration/src/$(LIB_PREFIX)migration_s.$(LIB_SUFFIX)
EXTRA_DSO_LDOPTS += $(LIBXUL_DIST)/lib/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX)
endif
# This has to come after the above chunk, because mozreg_s has dependencies on
# stuff in MOZ_COMPONENT_LIBS.

View File

@ -49,8 +49,6 @@
#include "nsGNOMEShellService.h"
#endif
#ifndef WINCE
#include "nsProfileMigrator.h"
#include "nsDogbertProfileMigrator.h"
#if !defined(XP_OS2)
@ -68,8 +66,6 @@
#include "nsICabProfileMigrator.h"
#endif
#endif // WINCE
#include "rdf.h"
#include "nsFeedSniffer.h"
#include "AboutRedirector.h"
@ -91,8 +87,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
#endif
#ifndef WINCE
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDogbertProfileMigrator)
#if !defined(XP_OS2)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsOperaProfileMigrator)
@ -110,8 +104,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsCaminoProfileMigrator)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsICabProfileMigrator)
#endif
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrivateBrowsingServiceWrapper, Init)
@ -124,7 +116,6 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID);
#ifndef WINCE
NS_DEFINE_NAMED_CID(NS_FIREFOX_PROFILEMIGRATOR_CID);
#if defined(XP_WIN) && !defined(__MINGW32__)
NS_DEFINE_NAMED_CID(NS_WINIEPROFILEMIGRATOR_CID);
@ -142,7 +133,6 @@ NS_DEFINE_NAMED_CID(NS_OPERAPROFILEMIGRATOR_CID);
NS_DEFINE_NAMED_CID(NS_DOGBERTPROFILEMIGRATOR_CID);
NS_DEFINE_NAMED_CID(NS_PHOENIXPROFILEMIGRATOR_CID);
NS_DEFINE_NAMED_CID(NS_SEAMONKEYPROFILEMIGRATOR_CID);
#endif /* WINCE */
NS_DEFINE_NAMED_CID(NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID);
static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
@ -154,7 +144,6 @@ static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
#endif
{ &kNS_FEEDSNIFFER_CID, false, NULL, nsFeedSnifferConstructor },
{ &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, NULL, AboutRedirector::Create },
#ifndef WINCE
{ &kNS_FIREFOX_PROFILEMIGRATOR_CID, false, NULL, nsProfileMigratorConstructor },
#if defined(XP_WIN) && !defined(__MINGW32__)
{ &kNS_WINIEPROFILEMIGRATOR_CID, false, NULL, nsIEProfileMigratorConstructor },
@ -172,7 +161,6 @@ static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
{ &kNS_DOGBERTPROFILEMIGRATOR_CID, false, NULL, nsDogbertProfileMigratorConstructor },
{ &kNS_PHOENIXPROFILEMIGRATOR_CID, false, NULL, nsPhoenixProfileMigratorConstructor },
{ &kNS_SEAMONKEYPROFILEMIGRATOR_CID, false, NULL, nsSeamonkeyProfileMigratorConstructor },
#endif /* WINCE */
{ &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID, false, NULL, nsPrivateBrowsingServiceWrapperConstructor },
{ NULL }
};
@ -198,7 +186,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-tabs", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
#endif
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "home", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
#ifndef WINCE
{ NS_PROFILEMIGRATOR_CONTRACTID, &kNS_FIREFOX_PROFILEMIGRATOR_CID },
#if defined(XP_WIN) && !defined(__MINGW32__)
{ NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "ie", &kNS_WINIEPROFILEMIGRATOR_CID },
@ -216,7 +203,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
{ NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "dogbert", &kNS_DOGBERTPROFILEMIGRATOR_CID },
{ NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "phoenix", &kNS_PHOENIXPROFILEMIGRATOR_CID },
{ NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "seamonkey", &kNS_SEAMONKEYPROFILEMIGRATOR_CID },
#endif /* WINCE */
{ NS_PRIVATE_BROWSING_SERVICE_CONTRACTID, &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID },
{ NULL }
};

View File

@ -370,7 +370,6 @@ BrowserGlue.prototype = {
// the first browser window has finished initializing
_onFirstWindowLoaded: function BG__onFirstWindowLoaded() {
#ifdef XP_WIN
#ifndef WINCE
// For windows seven, initialize the jump list module.
const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
if (WINTASKBAR_CONTRACTID in Cc &&
@ -379,26 +378,11 @@ BrowserGlue.prototype = {
Cu.import("resource://gre/modules/WindowsJumpLists.jsm", temp);
temp.WinTaskbarJumpList.startup();
}
#endif
#endif
},
// profile shutdown handler (contains profile cleanup routines)
_onProfileShutdown: function BG__onProfileShutdown() {
#ifdef MOZ_UPDATER
#ifdef WINCE
// If there's a pending update, clear cache to free up disk space.
try {
let um = Cc["@mozilla.org/updates/update-manager;1"].
getService(Ci.nsIUpdateManager);
if (um.activeUpdate && um.activeUpdate.state == "pending") {
let cacheService = Cc["@mozilla.org/network/cache-service;1"].
getService(Ci.nsICacheService);
cacheService.evictEntries(Ci.nsICache.STORE_ANYWHERE);
}
} catch (e) { }
#endif
#endif
this._shutdownPlaces();
this._sanitizer.onShutdown();
},

View File

@ -77,9 +77,7 @@
<menupopup>
<menuitem label="&center.label;" value="CENTER"/>
<menuitem label="&tile.label;" value="TILE"/>
#ifndef WINCE
<menuitem label="&stretch.label;" value="STRETCH"/>
#endif
</menupopup>
</menulist>
<spacer flex="1"/>

View File

@ -47,7 +47,7 @@ XPIDL_MODULE = shellservice
XPIDLSRCS = nsIShellService.idl
ifneq (,$(filter WINCE WINNT,$(OS_ARCH)))
ifeq ($(OS_ARCH),WINNT)
XPIDLSRCS += nsIWindowsShellService.idl
endif

View File

@ -50,7 +50,7 @@ USE_STATIC_LIBS = 1
endif
ifneq (,$(filter WINCE WINNT,$(OS_ARCH)))
ifeq ($(OS_ARCH),WINNT)
CPPSRCS = nsWindowsShellService.cpp
else
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))

View File

@ -91,11 +91,7 @@
#define NS_TASKBAR_CONTRACTID "@mozilla.org/windows-taskbar;1"
#ifndef WINCE
NS_IMPL_ISUPPORTS2(nsWindowsShellService, nsIWindowsShellService, nsIShellService)
#else
NS_IMPL_ISUPPORTS1(nsWindowsShellService, nsIShellService)
#endif
static nsresult
OpenKeyForReading(HKEY aKeyRoot, const nsAString& aKeyName, HKEY* aKey)
@ -115,33 +111,6 @@ OpenKeyForReading(HKEY aKeyRoot, const nsAString& aKeyName, HKEY* aKey)
return NS_OK;
}
#ifdef WINCE
static nsresult
OpenKeyForWriting(HKEY aStartKey, const nsAString& aKeyName, HKEY* aKey)
{
const nsString &flatName = PromiseFlatString(aKeyName);
DWORD dwDisp = 0;
DWORD res = ::RegCreateKeyExW(aStartKey, flatName.get(), 0, NULL,
0, KEY_READ | KEY_WRITE, NULL, aKey,
&dwDisp);
switch (res) {
case ERROR_SUCCESS:
break;
case ERROR_ACCESS_DENIED:
return NS_ERROR_FILE_ACCESS_DENIED;
case ERROR_FILE_NOT_FOUND:
res = ::RegCreateKeyExW(aStartKey, flatName.get(), 0, NULL,
0, KEY_READ | KEY_WRITE, NULL, aKey,
NULL);
if (res != ERROR_SUCCESS)
return NS_ERROR_FILE_ACCESS_DENIED;
}
return NS_OK;
}
#endif
///////////////////////////////////////////////////////////////////////////////
// Default Browser Registry Settings
//
@ -217,23 +186,15 @@ typedef struct {
char* valueData;
} SETTING;
#ifndef WINCE
#define APP_REG_NAME L"Firefox"
#define CLS_HTML "FirefoxHTML"
#define CLS_URL "FirefoxURL"
#define CPL_DESKTOP L"Control Panel\\Desktop"
#define VAL_OPEN "\"%APPPATH%\" -requestPending -osint -url \"%1\""
#define VAL_FILE_ICON "%APPPATH%,1"
#else
#define CPL_DESKTOP L"ControlPanel\\Desktop"
#define VAL_OPEN "\"%APPPATH%\" -osint -url \"%1\""
#define VAL_FILE_ICON "%APPPATH%,-2"
#endif
#define DI "\\DefaultIcon"
#define SOP "\\shell\\open\\command"
#define MAKE_KEY_NAME1(PREFIX, MID) \
PREFIX MID
@ -243,28 +204,11 @@ typedef struct {
// Handlers. see http://msdn2.microsoft.com/en-us/library/aa969357.aspx for
// more info.
static SETTING gSettings[] = {
#ifndef WINCE
// File Handler Class
{ MAKE_KEY_NAME1(CLS_HTML, SOP), "", VAL_OPEN },
// Protocol Handler Class - for Vista and above
{ MAKE_KEY_NAME1(CLS_URL, SOP), "", VAL_OPEN },
#else
{ MAKE_KEY_NAME1("FTP", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("FTP", SOP), "", VAL_OPEN },
// File handlers for Windows CE
{ MAKE_KEY_NAME1("bmpfile", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("bmpfile", SOP), "", VAL_OPEN },
{ MAKE_KEY_NAME1("giffile", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("giffile", SOP), "", VAL_OPEN },
{ MAKE_KEY_NAME1("jpegfile", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("jpegfile", SOP), "", VAL_OPEN },
{ MAKE_KEY_NAME1("pngfile", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("pngfile", SOP), "", VAL_OPEN },
{ MAKE_KEY_NAME1("htmlfile", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("htmlfile", SOP), "", VAL_OPEN },
#endif
// Protocol Handlers
{ MAKE_KEY_NAME1("HTTP", DI), "", VAL_FILE_ICON },
@ -273,7 +217,6 @@ static SETTING gSettings[] = {
{ MAKE_KEY_NAME1("HTTPS", SOP), "", VAL_OPEN }
};
#if !defined(WINCE)
nsresult
GetHelperPath(nsAutoString& aPath)
{
@ -313,12 +256,10 @@ LaunchHelper(nsAutoString& aPath)
CloseHandle(pi.hThread);
return NS_OK;
}
#endif // !defined(WINCE)
NS_IMETHODIMP
nsWindowsShellService::ShortcutMaintenance()
{
#if !defined(WINCE)
nsresult rv;
// Launch helper.exe so it can update the application user model ids on
@ -388,13 +329,8 @@ nsWindowsShellService::ShortcutMaintenance()
appHelperPath.AppendLiteral(" /UpdateShortcutAppUserModelIds");
return LaunchHelper(appHelperPath);
#else
NS_NOTREACHED("ShortcutMaintenance not implemented on wince!");
return NS_OK;
#endif // !defined(WINCE)
}
#ifndef WINCE
PRBool
nsWindowsShellService::IsDefaultBrowserVista(PRBool* aIsDefaultBrowser)
{
@ -418,7 +354,6 @@ nsWindowsShellService::IsDefaultBrowserVista(PRBool* aIsDefaultBrowser)
#endif
return PR_FALSE;
}
#endif
NS_IMETHODIMP
nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck,
@ -439,12 +374,10 @@ nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck,
if (!::GetModuleFileNameW(0, exePath, MAX_BUF))
return NS_ERROR_FAILURE;
#ifndef WINCE
// Convert the path to a long path since GetModuleFileNameW returns the path
// that was used to launch Firefox which is not necessarily a long path.
if (!::GetLongPathNameW(exePath, exePath, MAX_BUF))
return NS_ERROR_FAILURE;
#endif
nsAutoString appLongPath(exePath);
@ -478,12 +411,10 @@ nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck,
}
}
#ifndef WINCE
// Only check if Firefox is the default browser on Vista if the previous
// checks show that Firefox is the default browser.
if (*aIsDefaultBrowser)
IsDefaultBrowserVista(aIsDefaultBrowser);
#endif
return NS_OK;
}
@ -491,7 +422,6 @@ nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck,
NS_IMETHODIMP
nsWindowsShellService::SetDefaultBrowser(PRBool aClaimAllTypes, PRBool aForAllUsers)
{
#ifndef WINCE
nsAutoString appHelperPath;
if (NS_FAILED(GetHelperPath(appHelperPath)))
return NS_ERROR_FAILURE;
@ -503,91 +433,8 @@ nsWindowsShellService::SetDefaultBrowser(PRBool aClaimAllTypes, PRBool aForAllUs
}
return LaunchHelper(appHelperPath);
#else
SETTING* settings;
SETTING* end = gSettings + sizeof(gSettings)/sizeof(SETTING);
PRUnichar exePath[MAX_BUF];
if (!::GetModuleFileNameW(0, exePath, MAX_BUF))
return NS_ERROR_FAILURE;
nsAutoString appLongPath(exePath);
// The .png registry key isn't present by default so also add Content Type.
SetRegKey(NS_LITERAL_STRING(".png"), EmptyString(),
NS_LITERAL_STRING("pngfile"));
SetRegKey(NS_LITERAL_STRING(".png"), NS_LITERAL_STRING("Content Type"),
NS_LITERAL_STRING("image/png"));
// Set these keys to their default value for a clean install in case another
// app has changed these keys.
SetRegKey(NS_LITERAL_STRING(".htm"), EmptyString(),
NS_LITERAL_STRING("htmlfile"));
SetRegKey(NS_LITERAL_STRING(".html"), EmptyString(),
NS_LITERAL_STRING("htmlfile"));
SetRegKey(NS_LITERAL_STRING(".bmp"), EmptyString(),
NS_LITERAL_STRING("bmpfile"));
SetRegKey(NS_LITERAL_STRING(".gif"), EmptyString(),
NS_LITERAL_STRING("giffile"));
SetRegKey(NS_LITERAL_STRING(".jpe"), EmptyString(),
NS_LITERAL_STRING("jpegfile"));
SetRegKey(NS_LITERAL_STRING(".jpg"), EmptyString(),
NS_LITERAL_STRING("jpegfile"));
SetRegKey(NS_LITERAL_STRING(".jpeg"), EmptyString(),
NS_LITERAL_STRING("jpegfile"));
for (settings = gSettings; settings < end; ++settings) {
NS_ConvertUTF8toUTF16 dataLongPath(settings->valueData);
NS_ConvertUTF8toUTF16 key(settings->keyName);
NS_ConvertUTF8toUTF16 value(settings->valueName);
PRInt32 offset = dataLongPath.Find("%APPPATH%");
dataLongPath.Replace(offset, 9, appLongPath);
SetRegKey(key, value, dataLongPath);
}
// On Windows CE RegFlushKey can negatively impact performance if there are a
// lot of pending writes to the HKEY_CLASSES_ROOT registry hive but it is
// necessary to save the values in the case where the user performs a hard
// power off of the device.
::RegFlushKey(HKEY_CLASSES_ROOT);
#endif
return NS_OK;
}
#ifdef WINCE
void
nsWindowsShellService::SetRegKey(const nsString& aKeyName,
const nsString& aValueName,
const nsString& aValue)
{
PRUnichar buf[MAX_BUF];
DWORD len = sizeof buf;
HKEY theKey;
nsresult rv = OpenKeyForWriting(HKEY_CLASSES_ROOT, aKeyName, &theKey);
if (NS_FAILED(rv))
return;
// Get the current value.
DWORD res = ::RegQueryValueExW(theKey, PromiseFlatString(aValueName).get(),
NULL, NULL, (LPBYTE)buf, &len);
// Set the new value if it doesn't exist or it is different than the current
// value.
nsAutoString current(buf);
if (REG_FAILED(res) || !current.Equals(aValue)) {
const nsString &flatValue = PromiseFlatString(aValue);
::RegSetValueExW(theKey, PromiseFlatString(aValueName).get(),
0, REG_SZ, (const BYTE *)flatValue.get(),
(flatValue.Length() + 1) * sizeof(PRUnichar));
}
// Close the key we opened.
::RegCloseKey(theKey);
}
#endif
NS_IMETHODIMP
nsWindowsShellService::GetShouldCheckDefaultBrowser(PRBool* aResult)
{
@ -768,7 +615,6 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
0, NULL, REG_OPTION_NON_VOLATILE,
KEY_WRITE, NULL, &key, &dwDisp);
if (REG_SUCCEEDED(res)) {
#ifndef WINCE
PRUnichar tile[2], style[2];
switch (aPosition) {
case BACKGROUND_TILE:
@ -795,25 +641,9 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
0, REG_SZ, (const BYTE *)style, size);
::SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, (PVOID)path.get(),
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
#else
DWORD tile = (aPosition == BACKGROUND_TILE);
::RegSetValueExW(key, L"Tile",
0, REG_DWORD, (const BYTE *)&tile, sizeof(DWORD));
// On WinCE SPI_SETDESKWALLPAPER isn't available, so set the registry
// entry ourselves and then broadcast UI change
PRInt32 size = (path.Length() + 1) * sizeof(PRUnichar);
::RegSetValueExW(key, L"Wallpaper",
0, REG_SZ, (const BYTE *)path.get(), size);
::SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, NULL, 0);
#endif
// Close the key we opened.
::RegCloseKey(key);
#ifdef WINCE
// Ensure that the writes are flushed in case of hard reboot
::RegFlushKey(HKEY_CURRENT_USER);
#endif
}
}
return rv;
@ -939,9 +769,6 @@ nsWindowsShellService::SetDesktopBackgroundColor(PRUint32 aColor)
::SetSysColors(sizeof(aParameters) / sizeof(int), aParameters, colors);
// SetSysColors is persisting across sessions on Windows CE, so no need to
// write to registry
#ifndef WINCE
PRBool result = PR_FALSE;
DWORD dwDisp = 0;
HKEY key;
@ -963,11 +790,9 @@ nsWindowsShellService::SetDesktopBackgroundColor(PRUint32 aColor)
// Close the key we opened.
::RegCloseKey(key);
#endif
return NS_OK;
}
#ifndef WINCE
NS_IMETHODIMP
nsWindowsShellService::GetUnreadMailCount(PRUint32* aCount)
{
@ -1027,7 +852,6 @@ nsWindowsShellService::GetMailAccountKey(HKEY* aResult)
::RegCloseKey(mailKey);
return PR_FALSE;
}
#endif
NS_IMETHODIMP
nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication,

View File

@ -46,11 +46,7 @@
#include <windows.h>
#include <ole2.h>
#ifndef WINCE
class nsWindowsShellService : public nsIWindowsShellService
#else
class nsWindowsShellService : public nsIShellService
#endif
{
public:
nsWindowsShellService() : mCheckedThisSession(PR_FALSE) {};
@ -58,20 +54,12 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSISHELLSERVICE
#ifndef WINCE
NS_DECL_NSIWINDOWSSHELLSERVICE
#endif
protected:
#ifndef WINCE
PRBool IsDefaultBrowserVista(PRBool* aIsDefaultBrowser);
PRBool GetMailAccountKey(HKEY* aResult);
#else
void SetRegKey(const nsString& aKeyName,
const nsString& aValueName,
const nsString& aValue);
#endif
private:
PRBool mCheckedThisSession;

View File

@ -37,10 +37,8 @@
@BINPATH@/updater.ini
@BINPATH@/dictionaries/*
#ifdef XP_WIN32
#ifndef WINCE
@BINPATH@/uninstall/helper.exe
#endif
#endif
[xpcom]
@BINPATH@/dependentlibs.list
@ -62,9 +60,7 @@
#else
@BINPATH@/@MOZ_CHILD_PROCESS_NAME@
#endif
#ifdef WINCE
@BINPATH@/mozce_shunt.dll
#elifdef XP_WIN32
#ifdef XP_WIN32
#ifndef MOZ_MEMORY
#if _MSC_VER == 1400
@BINPATH@/Microsoft.VC80.CRT.manifest
@ -200,9 +196,7 @@
@BINPATH@/components/layout_xul.xpt
@BINPATH@/components/locale.xpt
@BINPATH@/components/lwbrk.xpt
#ifndef WINCE
@BINPATH@/components/migration.xpt
#endif
@BINPATH@/components/mimetype.xpt
@BINPATH@/components/mozfind.xpt
@BINPATH@/components/necko_about.xpt
@ -563,25 +557,6 @@ bin/libfreebl_32int64_3.so
bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
#endif
; [ActiveX]
#ifdef WINCE
#ifndef MOZ_NO_ACTIVEX_SUPPORT
@BINPATH@/components/nsAxSecurityPolicy.js
@BINPATH@/@PREF_DIR@/activex.js
@BINPATH@/plugins/npmozax.dll
@BINPATH@/plugins/nsIMozAxPlugin.xpt
#endif
#endif
; [FastStart]
#ifdef WINCE
#ifdef MOZ_FASTSTART
@BINPATH@/firefoxfaststart.exe
@BINPATH@/components/FastStartup.manifest
@BINPATH@/components/FastStartup.js
#endif
#endif
; [OS/2]
#ifdef XP_OS2
@BINPATH@/MozSounds.cmd