From d2a00531beaa532de3fb41d180d34db3c73d61d0 Mon Sep 17 00:00:00 2001 From: "racham%netscape.com" Date: Sat, 4 Mar 2000 05:56:56 +0000 Subject: [PATCH] Fixing bug 19621. State of activation window is controlled based on the activation server's response in a timeout period of 30 sec. r=matt,ben,tao. a=chofmann --- profile/resources/content/MANIFEST | 2 + profile/resources/content/Makefile.in | 2 + profile/resources/content/activation.xul | 67 +++++++++++++++++++ profile/resources/content/activationFrame.xul | 57 ++++++++++++++++ profile/resources/content/makefile.win | 2 + profile/resources/locale/en-US/MANIFEST | 1 + profile/resources/locale/en-US/Makefile.in | 1 + profile/resources/locale/en-US/activation.dtd | 28 ++++++++ profile/resources/locale/en-US/makefile.win | 1 + profile/src/nsProfile.cpp | 13 ++-- 10 files changed, 168 insertions(+), 6 deletions(-) create mode 100644 profile/resources/content/activation.xul create mode 100644 profile/resources/content/activationFrame.xul create mode 100644 profile/resources/locale/en-US/activation.dtd diff --git a/profile/resources/content/MANIFEST b/profile/resources/content/MANIFEST index 36619e056c7c..e8b35956b960 100644 --- a/profile/resources/content/MANIFEST +++ b/profile/resources/content/MANIFEST @@ -12,3 +12,5 @@ profileSelection.js profileSelection.xul confirmMigration.xul confirmMigration.js +activation.xul +activationFrame.xul diff --git a/profile/resources/content/Makefile.in b/profile/resources/content/Makefile.in index de5c9115313f..f840baf3ced0 100644 --- a/profile/resources/content/Makefile.in +++ b/profile/resources/content/Makefile.in @@ -42,6 +42,8 @@ FILES = \ profileSelection.js \ confirmMigration.xul \ confirmMigration.js \ + activation.xul \ + activationFrame.xul \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/profile/resources/content/activation.xul b/profile/resources/content/activation.xul new file mode 100644 index 000000000000..4bfe9dca21a7 --- /dev/null +++ b/profile/resources/content/activation.xul @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + diff --git a/profile/resources/content/activationFrame.xul b/profile/resources/content/activationFrame.xul new file mode 100644 index 000000000000..3480cb9eced6 --- /dev/null +++ b/profile/resources/content/activationFrame.xul @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + diff --git a/profile/resources/content/makefile.win b/profile/resources/content/makefile.win index 5a028afcc19e..3c0ca13dd865 100644 --- a/profile/resources/content/makefile.win +++ b/profile/resources/content/makefile.win @@ -39,6 +39,8 @@ FILES=\ profileSelection.js \ confirmMigration.xul \ confirmMigration.js \ + activation.xul \ + activationFrame.xul \ $(NULL) install:: diff --git a/profile/resources/locale/en-US/MANIFEST b/profile/resources/locale/en-US/MANIFEST index 11d25dd70426..f40a0c0a0c79 100644 --- a/profile/resources/locale/en-US/MANIFEST +++ b/profile/resources/locale/en-US/MANIFEST @@ -9,3 +9,4 @@ newProfile1_2.properties profileSelection.dtd confirmMigration.dtd migration.properties +activation.dtd diff --git a/profile/resources/locale/en-US/Makefile.in b/profile/resources/locale/en-US/Makefile.in index 2f652531cc9c..34cf010da018 100644 --- a/profile/resources/locale/en-US/Makefile.in +++ b/profile/resources/locale/en-US/Makefile.in @@ -39,6 +39,7 @@ FILES = \ migration.properties \ profileSelection.dtd \ confirmMigration.dtd \ + activation.dtd \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/profile/resources/locale/en-US/activation.dtd b/profile/resources/locale/en-US/activation.dtd new file mode 100644 index 000000000000..b0cede58c53b --- /dev/null +++ b/profile/resources/locale/en-US/activation.dtd @@ -0,0 +1,28 @@ + + + + diff --git a/profile/resources/locale/en-US/makefile.win b/profile/resources/locale/en-US/makefile.win index 9cd00a7e7e35..c65cdeaab119 100644 --- a/profile/resources/locale/en-US/makefile.win +++ b/profile/resources/locale/en-US/makefile.win @@ -36,6 +36,7 @@ FILES=\ migration.properties \ profileSelection.dtd \ confirmMigration.dtd \ + activation.dtd \ $(NULL) install:: diff --git a/profile/src/nsProfile.cpp b/profile/src/nsProfile.cpp index 3b408eee9f27..6e9792bfb40c 100644 --- a/profile/src/nsProfile.cpp +++ b/profile/src/nsProfile.cpp @@ -102,6 +102,10 @@ #define ACTIVATION_EMAIL_SERVER_NAME "browser.registration.mailservername" #define ACTIVATION_EMAIL_SERVER_TYPE "browser.registration.mailservertype" +#define ACTIVATION_WINDOW_WIDTH 480 +#define ACTIVATION_WINDOW_HEIGHT 480 + +#define ACTIVATION_FRAME_URL "chrome://profile/content/activation.xul" #define PROFILE_SELECTION_URL "chrome://profile/content/profileSelection.xul" #define PROFILE_SELECTION_CMD_LINE_ARG "-SelectProfile" #define PROFILE_MANAGER_URL "chrome://profile/content/profileSelection.xul?manage=true" @@ -1708,8 +1712,6 @@ nsProfile::TriggerActivation(const char *profileName) NS_WITH_SERVICE(nsIPref, prefs, kPrefCID, &rv); if (NS_FAILED(rv)) return rv; - char* pregURL = nsnull; - rv = prefs->CopyCharPref(PREG_URL_PREF, &pregURL); // Check if the javascript is enabled.... PRBool javascriptEnabled = PR_TRUE; @@ -1734,14 +1736,14 @@ nsProfile::TriggerActivation(const char *profileName) if (NS_FAILED(rv)) return rv; nsCOMPtr registrationURL; - rv = NS_NewURI(getter_AddRefs(registrationURL), pregURL); + rv = NS_NewURI(getter_AddRefs(registrationURL), ACTIVATION_FRAME_URL); if (NS_FAILED(rv)) return rv; rv = pregAppShell->CreateTopLevelWindow(nsnull, registrationURL, PR_TRUE, PR_TRUE, NS_CHROME_ALL_CHROME, - NS_SIZETOCONTENT, // width - NS_SIZETOCONTENT, // height + ACTIVATION_WINDOW_WIDTH, // width + ACTIVATION_WINDOW_HEIGHT, // height getter_AddRefs(mPregWindow)); if (NS_FAILED(rv)) return rv; @@ -1762,7 +1764,6 @@ nsProfile::TriggerActivation(const char *profileName) ProcessPRegCookie(); - CRTFREEIF(pregURL); } CRTFREEIF(isPregInfoSet);