mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-22 10:27:03 +00:00
Back out changeset 1defe29fdf3c, ffe31dc2d27f, 54bacc404a6f, 16772cb4a781, c169c3b8dfb2, 94f06945b818, 6a2724d755f3 for test failure.
This commit is contained in:
parent
d2feafa0a4
commit
38885cf314
@ -40,12 +40,8 @@
|
||||
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
|
||||
PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
|
||||
else
|
||||
ifeq ($(MOZ_BUILD_APP),mobile)
|
||||
PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
|
||||
else
|
||||
PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
|
||||
endif
|
||||
endif
|
||||
|
||||
TARGET_DIST = $(TARGET_DEPTH)/dist
|
||||
|
||||
|
@ -362,7 +362,6 @@ var Browser = {
|
||||
}
|
||||
|
||||
messageManager.addMessageListener("Browser:ViewportMetadata", this);
|
||||
messageManager.addMessageListener("Browser:CanCaptureMouse:Return", this);
|
||||
messageManager.addMessageListener("Browser:FormSubmit", this);
|
||||
messageManager.addMessageListener("Browser:KeyPress", this);
|
||||
messageManager.addMessageListener("Browser:ZoomToPoint:Return", this);
|
||||
@ -1134,19 +1133,14 @@ var Browser = {
|
||||
let browser = aMessage.target;
|
||||
|
||||
switch (aMessage.name) {
|
||||
case "Browser:ViewportMetadata": {
|
||||
case "Browser:ViewportMetadata":
|
||||
let tab = this.getTabForBrowser(browser);
|
||||
// Some browser such as iframes loaded dynamically into the chrome UI
|
||||
// does not have any assigned tab
|
||||
if (tab)
|
||||
tab.updateViewportMetadata(json);
|
||||
break;
|
||||
}
|
||||
case "Browser:CanCaptureMouse:Return": {
|
||||
let tab = this.getTabForBrowser(browser);
|
||||
tab.contentMightCaptureMouse = json.contentMightCaptureMouse;
|
||||
break;
|
||||
}
|
||||
|
||||
case "Browser:FormSubmit":
|
||||
browser.lastLocation = null;
|
||||
break;
|
||||
@ -1547,7 +1541,7 @@ Browser.WebProgress.prototype = {
|
||||
aTab.updateThumbnail();
|
||||
|
||||
browser.messageManager.addMessageListener("MozScrolledAreaChanged", aTab.scrolledAreaChanged);
|
||||
aTab.updateContentCapture();
|
||||
ContentTouchHandler.updateContentCapture();
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -1646,7 +1640,6 @@ const ContentTouchHandler = {
|
||||
document.addEventListener("TapLong", this, false);
|
||||
document.addEventListener("TapMove", this, false);
|
||||
|
||||
document.addEventListener("PanBegin", this, false);
|
||||
document.addEventListener("PopupChanged", this, false);
|
||||
document.addEventListener("CancelTouchSequence", this, false);
|
||||
|
||||
@ -1663,6 +1656,7 @@ const ContentTouchHandler = {
|
||||
messageManager.addMessageListener("Browser:ContextMenu", this);
|
||||
messageManager.addMessageListener("Browser:Highlight", this);
|
||||
messageManager.addMessageListener("Browser:CaptureEvents", this);
|
||||
messageManager.addMessageListener("Browser:CanCaptureMouse:Return", this);
|
||||
},
|
||||
|
||||
handleEvent: function handleEvent(aEvent) {
|
||||
@ -1671,9 +1665,6 @@ const ContentTouchHandler = {
|
||||
return;
|
||||
|
||||
switch (aEvent.type) {
|
||||
case "PanBegin":
|
||||
getBrowser().messageManager.sendAsyncMessage("Browser:MouseCancel", {});
|
||||
break;
|
||||
case "PopupChanged":
|
||||
case "CancelTouchSequence":
|
||||
this._clearPendingMessages();
|
||||
@ -1726,6 +1717,11 @@ const ContentTouchHandler = {
|
||||
}
|
||||
},
|
||||
|
||||
updateContentCapture: function() {
|
||||
this._messageId++;
|
||||
messageManager.sendAsyncMessage("Browser:CanCaptureMouse", { messageId: this._messageId });
|
||||
},
|
||||
|
||||
receiveMessage: function receiveMessage(aMessage) {
|
||||
let json = aMessage.json;
|
||||
if (json.messageId != this._messageId)
|
||||
@ -1760,6 +1756,11 @@ const ContentTouchHandler = {
|
||||
Elements.browsers.customDragger.contentMouseCapture = this.panningPrevented;
|
||||
break;
|
||||
}
|
||||
case "Browser:CanCaptureMouse:Return": {
|
||||
let tab = Browser.getTabForBrowser(aMessage.target);
|
||||
tab.contentMightCaptureMouse = json.contentMightCaptureMouse;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -2956,10 +2957,6 @@ Tab.prototype = {
|
||||
return this._browser.getAttribute("type") == "content-primary";
|
||||
},
|
||||
|
||||
updateContentCapture: function() {
|
||||
this._browser.messageManager.sendAsyncMessage("Browser:CanCaptureMouse", {});
|
||||
},
|
||||
|
||||
toString: function() {
|
||||
return "[Tab " + (this._browser ? this._browser.currentURI.spec : "(no browser)") + "]";
|
||||
}
|
||||
|
@ -597,7 +597,8 @@ let Content = {
|
||||
|
||||
case "Browser:CanCaptureMouse": {
|
||||
sendAsyncMessage("Browser:CanCaptureMouse:Return", {
|
||||
contentMightCaptureMouse: content.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).mayHaveTouchEventListeners
|
||||
contentMightCaptureMouse: content.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).mayHaveTouchEventListeners,
|
||||
messageId: json.messageId
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
relativesrcdir = mobile/chrome/tests
|
||||
relativesrcdir = mobile/chrome
|
||||
TESTXPI = $(CURDIR)/$(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)/addons
|
||||
ADDONSRC = $(srcdir)/addons
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>addon1@tests.mozilla.org</em:id>
|
||||
<em:version>1.0</em:version>
|
||||
<em:updateURL>http://example.com/browser/mobile/chrome/tests/browser_upgrade.rdf</em:updateURL>
|
||||
<em:updateURL>http://example.com/browser/mobile/chrome/browser_upgrade.rdf</em:updateURL>
|
||||
<em:bootstrap>true</em:bootstrap>
|
||||
|
||||
<em:targetApplication>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>addon1@tests.mozilla.org</em:id>
|
||||
<em:version>3.0</em:version>
|
||||
<em:updateURL>http://example.com/browser/mobile/chrome/tests/browser_upgrade.rdf</em:updateURL>
|
||||
<em:updateURL>http://example.com/browser/mobile/chrome/browser_upgrade.rdf</em:updateURL>
|
||||
|
||||
<em:targetApplication>
|
||||
<Description>
|
||||
|
@ -7,7 +7,7 @@ Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
const RELATIVE_DIR = "browser/mobile/chrome/tests/";
|
||||
const RELATIVE_DIR = "browser/mobile/chrome/";
|
||||
const TESTROOT = "http://example.com/" + RELATIVE_DIR;
|
||||
const TESTROOT2 = "http://example.org/" + RELATIVE_DIR;
|
||||
const PREF_LOGGING_ENABLED = "extensions.logging.enabled";
|
||||
|
@ -1,4 +1,6 @@
|
||||
let testURL_01 = chromeRoot + "browser_formsZoom.html";
|
||||
|
||||
let baseURI = "http://mochi.test:8888/browser/mobile/chrome/";
|
||||
let testURL_02 = baseURI + "browser_formsZoom.html";
|
||||
messageManager.loadFrameScript(baseURI + "remote_formsZoom.js", true);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Make sure history is being recorded when we visit websites.
|
||||
*/
|
||||
|
||||
var testURL_01 = baseURI + "browser_blank_01.html";
|
||||
var testURL_01 = "http://mochi.test:8888/browser/mobile/chrome/browser_blank_01.html";
|
||||
|
||||
// A queue to order the tests and a handle for each test
|
||||
var gTests = [];
|
||||
|
@ -25,7 +25,7 @@
|
||||
</application>
|
||||
</compatible_applications>
|
||||
<compatible_os>ALL</compatible_os>
|
||||
<install size="2">http://example.com/browser/mobile/chrome/tests/addons/browser_install1_1.xpi</install>
|
||||
<install size="2">http://example.com/browser/mobile/chrome/addons/browser_install1_1.xpi</install>
|
||||
</addon>
|
||||
|
||||
<addon>
|
||||
@ -53,6 +53,6 @@
|
||||
</application>
|
||||
</compatible_applications>
|
||||
<compatible_os>ALL</compatible_os>
|
||||
<install size="2">http://example.com/browser/mobile/chrome/tests/addons/browser_install1_2.xpi</install>
|
||||
<install size="2">http://example.com/browser/mobile/chrome/addons/browser_install1_2.xpi</install>
|
||||
</addon>
|
||||
</searchresults>
|
||||
|
@ -1,6 +1,7 @@
|
||||
var testURL_01 = chromeRoot + "browser_blank_01.html";
|
||||
var testURL_02 = chromeRoot + "browser_blank_02.html";
|
||||
|
||||
let baseURI = "http://mochi.test:8888/browser/mobile/chrome/";
|
||||
var titleURL = baseURI + "browser_title.sjs?";
|
||||
var pngURL = "data:image/gif;base64,R0lGODlhCwALAIAAAAAA3pn/ZiH5BAEAAAEALAAAAAALAAsAAAIUhA+hkcuO4lmNVindo7qyrIXiGBYAOw==";
|
||||
|
||||
|
@ -4,7 +4,8 @@
|
||||
var gTab;
|
||||
registerCleanupFunction(function() Browser.closeTab(gTab));
|
||||
|
||||
const TEST_URL = baseURI + "browser_scroll.html";
|
||||
const BASE_URL = "http://mochi.test:8888/browser/mobile/chrome/";
|
||||
const TEST_URL = BASE_URL + "browser_scroll.html";
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
@ -1,3 +1,4 @@
|
||||
let baseURI = "http://mochi.test:8888/browser/mobile/chrome/";
|
||||
let testURL_01 = baseURI + "browser_scrollbar.sjs?";
|
||||
|
||||
let gCurrentTest = null;
|
||||
|
@ -37,6 +37,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
let baseURI = "http://mochi.test:8888/browser/mobile/chrome/";
|
||||
let testURL_blank = baseURI + "browser_blank_01.html";
|
||||
|
||||
const DEFAULT_WIDTH = 800;
|
||||
|
@ -55,10 +55,10 @@ function handleRequest(request, response) {
|
||||
response.write("<script>window.addEventListener('load', function() { window.removeEventListener('load', arguments.callee, false); document.title = 'This is not a french title'; }, false);</script>");
|
||||
break;
|
||||
case "redirect":
|
||||
response.write("<meta http-equiv='refresh' content='1;url=http://mochi.test:8888/browser/mobile/chrome/tests/browser_title.sjs?no_title'></meta>");
|
||||
response.write("<meta http-equiv='refresh' content='1;url=http://mochi.test:8888/browser/mobile/chrome/browser_title.sjs?no_title'></meta>");
|
||||
break;
|
||||
case "location":
|
||||
response.write("<script>window.addEventListener('load', function() { window.removeEventListener('load', arguments.callee, false); document.location = 'http://mochi.test:8888/browser/mobile/chrome/tests/browser_title.sjs?no_title' ; }, false);</script>");
|
||||
response.write("<script>window.addEventListener('load', function() { window.removeEventListener('load', arguments.callee, false); document.location = 'http://mochi.test:8888/browser/mobile/chrome/browser_title.sjs?no_title' ; }, false);</script>");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -14,7 +14,7 @@
|
||||
<em:id>toolkit@mozilla.org</em:id>
|
||||
<em:minVersion>0</em:minVersion>
|
||||
<em:maxVersion>*</em:maxVersion>
|
||||
<em:updateLink>http://example.com/browser/mobile/chrome/tests/addons/browser_install1_3.xpi</em:updateLink>
|
||||
<em:updateLink>http://example.com/browser/mobile/chrome/addons/browser_install1_3.xpi</em:updateLink>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
</Description>
|
||||
|
@ -38,6 +38,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
let baseURI = "http://mochi.test:8888/browser/mobile/chrome/";
|
||||
let testURL_blank = baseURI + "browser_blank_01.html";
|
||||
|
||||
const DEFAULT_WIDTH = 800;
|
||||
|
@ -83,6 +83,6 @@ let AsyncTests = {
|
||||
let chromeRoot = getRootDirectory(gTestPath);
|
||||
// For some security reasons (which?), loading remote_head using chromeRoot
|
||||
// instead of baseURI make the browser_formsZoom.js test fails.
|
||||
let baseURI = "http://mochi.test:8888/browser/mobile/chrome/tests/";
|
||||
let baseURI = "http://mochi.test:8888/browser/mobile/chrome/";
|
||||
messageManager.loadFrameScript(baseURI + "remote_head.js", true);
|
||||
messageManager.loadFrameScript("chrome://mochikit/content/tests/SimpleTest/EventUtils.js", true);
|
||||
|
@ -68,7 +68,7 @@ NSSDBM3_CHK =
|
||||
endif
|
||||
|
||||
ifndef MOZ_NATIVE_NSS
|
||||
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
|
||||
ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
|
||||
SDK_LIBS = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)smime3.$(LIB_SUFFIX) \
|
||||
@ -162,8 +162,11 @@ ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_MEMORY))
|
||||
export DLLFLAGS
|
||||
endif
|
||||
|
||||
ifndef WINCE
|
||||
# why is this disabled on WINCE? See bug 514295.
|
||||
# To get debug symbols from NSS
|
||||
export MOZ_DEBUG_SYMBOLS
|
||||
endif
|
||||
|
||||
ifdef .PYMAKE
|
||||
NSSMAKE = $(GMAKE)
|
||||
@ -243,6 +246,24 @@ DEFAULT_GMAKE_FLAGS += PROGRAMS=
|
||||
|
||||
ifdef CROSS_COMPILE
|
||||
|
||||
ifdef WINCE
|
||||
DEFAULT_GMAKE_FLAGS += \
|
||||
NATIVE_CC="$(HOST_CC)" \
|
||||
CC="$(CC)" \
|
||||
CCC="$(CC)" \
|
||||
LINK="$(LD)" \
|
||||
LD="$(LD) -DLL" \
|
||||
AS="$(AS) -Cp -Sn -Zi -coff $(INCLUDES)" \
|
||||
AR='$(AR) -NOLOG0 -OUT:$$@' \
|
||||
RANLIB="echo" \
|
||||
RC="$(RC) $(RCFLAGS)" \
|
||||
OS_ARCH="$(OS_ARCH)" \
|
||||
OS_TEST="$(OS_TEST)" \
|
||||
CPU_ARCH="ARM" \
|
||||
USE_MSYS=1 \
|
||||
WINCE=1 \
|
||||
$(NULL)
|
||||
else
|
||||
DEFAULT_GMAKE_FLAGS += \
|
||||
NATIVE_CC="$(HOST_CC)" \
|
||||
CC="$(CC)" \
|
||||
@ -256,6 +277,7 @@ DEFAULT_GMAKE_FLAGS += \
|
||||
OS_TEST="$(OS_TEST)" \
|
||||
CPU_ARCH="$(TARGET_CPU)" \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
# Android has pthreads integrated into -lc, so OS_LIBS is set to nothing
|
||||
ifeq ($(OS_TARGET), Android)
|
||||
|
@ -56,7 +56,7 @@ DIRS += installer/windows
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
|
||||
PARALLEL_DIRS += tools/redit
|
||||
endif
|
||||
|
||||
|
@ -54,7 +54,7 @@ GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/,xulrunner.js)
|
||||
|
||||
DEFINES += -DAB_CD=$(AB_CD)
|
||||
|
||||
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
|
||||
ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
|
||||
PROGRAM = xulrunner$(BIN_SUFFIX)
|
||||
else
|
||||
PROGRAM = xulrunner-bin$(BIN_SUFFIX)
|
||||
@ -116,8 +116,12 @@ 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
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
|
||||
@ -171,7 +175,7 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
|
||||
ifneq (,$(filter-out OS2 WINCE WINNT,$(OS_ARCH)))
|
||||
ifeq (unix, $(MOZ_FS_LAYOUT))
|
||||
|
||||
xulrunner:: $(topsrcdir)/build/unix/mozilla.in $(GLOBAL_DEPS)
|
||||
|
@ -74,7 +74,7 @@ static void Output(PRBool isError, const char *fmt, ... )
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
|
||||
#if (defined(XP_WIN) && !MOZ_WINCONSOLE)
|
||||
#if (defined(XP_WIN) && !MOZ_WINCONSOLE) || defined(WINCE)
|
||||
char *msg = PR_vsmprintf(fmt, ap);
|
||||
if (msg)
|
||||
{
|
||||
@ -174,6 +174,14 @@ static void Usage(const char *argv0)
|
||||
" -h, --help show this message\n"
|
||||
" -v, --version show version\n"
|
||||
" --gre-version print the GRE version string on stdout\n"
|
||||
" --register-global register this GRE in the machine registry\n"
|
||||
" --register-user register this GRE in the user registry\n"
|
||||
" --unregister-global unregister this GRE formerly registered with\n"
|
||||
" --register-global\n"
|
||||
" --unregister-user unregister this GRE formely registered with\n"
|
||||
" --register-user\n"
|
||||
" --find-gre <version> Find a GRE with version <version> and print\n"
|
||||
" the path on stdout\n"
|
||||
" --install-app <application> [<destination> [<directoryname>]]\n"
|
||||
" Install a XUL application.\n"
|
||||
"\n"
|
||||
|
@ -73,7 +73,7 @@ LIBS += \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
|
||||
RCINCLUDE = xulrunner-stub.rc
|
||||
ifndef GNU_CC
|
||||
RCFLAGS += -DMOZ_XULRUNNER -I$(srcdir)
|
||||
@ -94,8 +94,12 @@ endif
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
ifdef _MSC_VER
|
||||
ifdef WINCE
|
||||
WIN32_EXE_LDFLAGS += -ENTRY:mainWCRTStartup
|
||||
else
|
||||
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
|
||||
endif
|
||||
endif
|
||||
|
||||
LIBS += $(JEMALLOC_LIBS)
|
||||
|
||||
|
@ -86,7 +86,7 @@ static void Output(PRBool isError, const char *fmt, ... )
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
|
||||
#if (defined(XP_WIN) && !MOZ_WINCONSOLE)
|
||||
#if (defined(XP_WIN) && !MOZ_WINCONSOLE) || defined(WINCE)
|
||||
char msg[2048];
|
||||
|
||||
vsnprintf(msg, sizeof(msg), fmt, ap);
|
||||
@ -191,6 +191,43 @@ XRE_CreateAppDataType XRE_CreateAppData;
|
||||
XRE_FreeAppDataType XRE_FreeAppData;
|
||||
XRE_mainType XRE_main;
|
||||
|
||||
|
||||
#ifdef WINCE
|
||||
void
|
||||
ForwardToWindow(HWND wnd) {
|
||||
// For WinCE, we're stuck with providing our own argv[0] for the remote
|
||||
// command-line.
|
||||
WCHAR wPath[MAX_PATH] = L"dummy ";
|
||||
WCHAR *wCmd = ::GetCommandLineW();
|
||||
WCHAR wCwd[MAX_PATH];
|
||||
_wgetcwd(wCwd, MAX_PATH);
|
||||
|
||||
// Construct a narrow UTF8 buffer <path> <commandline>\0<workingdir>\0
|
||||
size_t len = wcslen(wPath) + wcslen(wCmd) + wcslen(wCwd) + 2;
|
||||
WCHAR *wMsg = (WCHAR *)malloc(len * sizeof(*wMsg));
|
||||
wcscpy(wMsg, wPath);
|
||||
wcscpy(wMsg + wcslen(wPath), wCmd); // The command line
|
||||
wcscpy(wMsg + wcslen(wPath) + wcslen(wCmd) + 1, wCwd); // Working dir
|
||||
|
||||
// Then convert to UTF-8, assuming worst-case explosion of characters
|
||||
char *msg = (char *)malloc(len * 4);
|
||||
WideCharToMultiByte(CP_UTF8, 0, wMsg, len, msg, len * 4, NULL, NULL);
|
||||
|
||||
// We used to set dwData to zero, when we didn't send the working dir.
|
||||
// Now we're using it as a version number.
|
||||
COPYDATASTRUCT cds = { 1, len, (void *)msg };
|
||||
|
||||
// Bring the already running Mozilla process to the foreground.
|
||||
// nsWindow will restore the window (if minimized) and raise it.
|
||||
// for activating the existing window on wince we need "| 0x01"
|
||||
// see http://msdn.microsoft.com/en-us/library/ms940024.aspx for details
|
||||
::SetForegroundWindow((HWND)(((ULONG) wnd) | 0x01));
|
||||
::SendMessage(wnd, WM_COPYDATA, 0, (LPARAM)&cds);
|
||||
free(wMsg);
|
||||
free(msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
@ -362,6 +399,41 @@ main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef WINCE
|
||||
// On Windows Mobile and WinCE, we can save a lot of time by not
|
||||
// waiting for XUL and XPCOM to load up. Let's see if we can find
|
||||
// an existing app window to forward our command-line to now.
|
||||
|
||||
// Shouldn't attempt this if the -no-remote parameter has been provided.
|
||||
bool noRemote = false;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (IsArg(argv[i], "no-remote")) {
|
||||
noRemote = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!noRemote) {
|
||||
char windowName[512]; // Is there a const for appname like VERSION_MAXLEN?
|
||||
rv = parser.GetString("App", "Name", windowName, sizeof(windowName));
|
||||
if (NS_FAILED(rv)) {
|
||||
fprintf(stderr, "Couldn't figure out the application name\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Lookup the hidden message window created by nsNativeAppSupport
|
||||
strncat(windowName, "MessageWindow", sizeof(windowName) - strlen(windowName));
|
||||
WCHAR wWindowName[512];
|
||||
MultiByteToWideChar(CP_UTF8, 0, windowName, -1, wWindowName, sizeof(wWindowName));
|
||||
HWND wnd = ::FindWindowW(wWindowName, NULL);
|
||||
if (wnd) {
|
||||
// Forward the command-line and bail out
|
||||
ForwardToWindow(wnd);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!greFound) {
|
||||
Output(PR_FALSE,
|
||||
"Could not find the Mozilla runtime.\n");
|
||||
@ -411,7 +483,8 @@ main(int argc, char **argv)
|
||||
{ // Scope COMPtr and AutoAppData
|
||||
nsCOMPtr<nsILocalFile> iniFile;
|
||||
#ifdef XP_WIN
|
||||
// On Windows iniPath is UTF-8 encoded so we need to convert it.
|
||||
// On Windows and Windows CE, iniPath is UTF-8 encoded,
|
||||
// so we need to convert it.
|
||||
rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(iniPath), PR_FALSE,
|
||||
getter_AddRefs(iniFile));
|
||||
#else
|
||||
|
@ -52,4 +52,12 @@ SDK_BINARY = \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINCE)
|
||||
HOST_CPPSRCS = redit.cpp
|
||||
HOST_PROGRAM = redit$(BIN_SUFFIX)
|
||||
SDK_BINARY = \
|
||||
$(HOST_PROGRAM) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
Loading…
x
Reference in New Issue
Block a user