1 diff -ur kazehakase-0.5.5.orig/macros/gecko.m4 kazehakase-0.5.5/macros/gecko.m4
2 --- kazehakase-0.5.5.orig/macros/gecko.m4 2008-07-29 16:15:29.000000000 +0200
3 +++ kazehakase-0.5.5/macros/gecko.m4 2008-07-30 10:38:30.000000000 +0200
6 MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $GECKO_MODULE`"
7 mozilla_include_type="`$PKG_CONFIG --variable=includetype $GECKO_MODULE`"
8 - if test x"$mozilla_include_type" = "xunstable"; then
9 - MOZILLA_INCLUDE_ROOT="$MOZILLA_INCLUDE_ROOT/unstable"
11 AC_SUBST(MOZILLA_INCLUDE_ROOT)
13 MOZILLA_HOME="`$PKG_CONFIG --variable=libdir $GECKO_MODULE`"
14 diff -ur kazehakase-0.5.5.orig/module/embed/gecko/gtkmozembed/nsProfileDirServiceProvider2.cpp kazehakase-0.5.5/module/embed/gecko/gtkmozembed/nsProfileDirServiceProvider2.cpp
15 --- kazehakase-0.5.5.orig/module/embed/gecko/gtkmozembed/nsProfileDirServiceProvider2.cpp 2008-07-29 16:15:30.000000000 +0200
16 +++ kazehakase-0.5.5/module/embed/gecko/gtkmozembed/nsProfileDirServiceProvider2.cpp 2008-07-30 10:38:30.000000000 +0200
18 rv = EnsureProfileFileExists(localFile, domainDir);
21 - else if (strcmp(prop, NS_APP_MAIL_50_DIR) == 0) {
22 - rv = domainDir->Clone(getter_AddRefs(localFile));
23 - if (NS_SUCCEEDED(rv))
24 - rv = localFile->AppendNative(MAIL_DIR_50_NAME);
26 - else if (strcmp(prop, NS_APP_IMAP_MAIL_50_DIR) == 0) {
27 - rv = domainDir->Clone(getter_AddRefs(localFile));
28 - if (NS_SUCCEEDED(rv))
29 - rv = localFile->AppendNative(IMAP_MAIL_DIR_50_NAME);
31 - else if (strcmp(prop, NS_APP_NEWS_50_DIR) == 0) {
32 - rv = domainDir->Clone(getter_AddRefs(localFile));
33 - if (NS_SUCCEEDED(rv))
34 - rv = localFile->AppendNative(NEWS_DIR_50_NAME);
36 - else if (strcmp(prop, NS_APP_MESSENGER_FOLDER_CACHE_50_DIR) == 0) {
37 - rv = domainDir->Clone(getter_AddRefs(localFile));
38 - if (NS_SUCCEEDED(rv))
39 - rv = localFile->AppendNative(MSG_FOLDER_CACHE_DIR_50_NAME);
41 else if (strcmp(prop, NS_APP_STORAGE_50_FILE) == 0) {
42 rv = domainDir->Clone(getter_AddRefs(localFile));
45 (void) directoryService->Undefine(NS_APP_BOOKMARKS_50_FILE);
46 (void) directoryService->Undefine(NS_APP_DOWNLOADS_50_FILE);
47 (void) directoryService->Undefine(NS_APP_SEARCH_50_FILE);
48 - (void) directoryService->Undefine(NS_APP_MAIL_50_DIR);
49 - (void) directoryService->Undefine(NS_APP_IMAP_MAIL_50_DIR);
50 - (void) directoryService->Undefine(NS_APP_NEWS_50_DIR);
51 - (void) directoryService->Undefine(NS_APP_MESSENGER_FOLDER_CACHE_50_DIR);
55 diff -urN kazehakase-0.5.5.orig/ext/ruby/Makefile.am kazehakase-0.5.5/ext/ruby/Makefile.am
56 --- kazehakase-0.5.5.orig/ext/ruby/Makefile.am 2008-07-29 17:15:31.000000000 +0300
57 +++ kazehakase-0.5.5/ext/ruby/Makefile.am 2008-08-11 02:22:57.000000000 +0300
59 -DG_DISABLE_DEPRECATED=1
62 - $(MOZILLA_COMPONENT_CFLAGS) \
70 - $(MOZILLA_COMPONENT_LIBS) \
71 $(top_builddir)/src/libkazehakase.la
72 diff -urN kazehakase-0.5.5.orig/ext/ruby/Makefile.in kazehakase-0.5.5/ext/ruby/Makefile.in
73 --- kazehakase-0.5.5.orig/ext/ruby/Makefile.in 2008-07-29 17:21:39.000000000 +0300
74 +++ kazehakase-0.5.5/ext/ruby/Makefile.in 2008-08-11 02:22:57.000000000 +0300
76 top_srcdir = @top_srcdir@
77 ext_LTLIBRARIES = ruby.la
79 - $(MOZILLA_COMPONENT_CFLAGS) \
87 - $(MOZILLA_COMPONENT_LIBS) \
88 $(top_builddir)/src/libkazehakase.la
91 diff -urN kazehakase-0.5.5.orig/module/embed/gecko/GtkPromptService.cpp kazehakase-0.5.5/module/embed/gecko/GtkPromptService.cpp
92 --- kazehakase-0.5.5.orig/module/embed/gecko/GtkPromptService.cpp 2008-07-29 17:15:30.000000000 +0300
93 +++ kazehakase-0.5.5/module/embed/gecko/GtkPromptService.cpp 2008-08-11 02:22:57.000000000 +0300
96 * ***** END LICENSE BLOCK ***** */
99 #include "GtkPromptService.h"
100 #include <nsIWindowWatcher.h>
101 #include <nsIWebBrowserChrome.h>
103 #include <nsIDOMCharacterData.h>
104 #include <nsIDOMText.h>
105 #include <nsMemory.h>
106 +#ifdef HAVE_GECKO_1_9
107 +#include <nsIAuthInformation.h>
108 +#include <nsIStringBundle.h>
109 +#include <nsServiceManagerUtils.h>
110 +/* That is ugly but I didn't find another way, except including
111 + * NS_GetAuthHostPort */
112 +#define kNotFound -1
113 +NS_COM void AppendUTF16toUTF8( const nsAString& aSource, nsACString& aDest );
114 +#include <nsStringAPI.h>
115 +#include <nsIProxiedChannel.h>
116 +#include <nsIProxyInfo.h>
117 +#include <nsIIDNService.h>
118 +#include <nsNetCID.h>
120 +#include <nsNetUtil.h>
121 +#include <nsPromptUtils.h>
124 #include <glib/gi18n.h>
125 #include "kz-prompt-dialog.h"
131 +#ifdef HAVE_GECKO_1_9
132 +NS_IMPL_ISUPPORTS2(GtkPromptService, nsIPromptService, nsIPromptService2)
134 NS_IMPL_ISUPPORTS1(GtkPromptService, nsIPromptService)
138 GtkPromptService::Alert(nsIDOMWindow* aParent, const PRUnichar* aDialogTitle,
139 @@ -338,10 +359,12 @@
140 KzPromptDialog *prompt = KZ_PROMPT_DIALOG(kz_prompt_dialog_new_with_parent
141 (TYPE_PROMPT_USER_PASS,
142 GTK_WINDOW(GetGtkWindowForDOMWindow(aParent))));
143 +#ifndef HAVE_GECKO_1_9
144 gchar *host = GetURIForDOMWindow(aParent);
145 kz_prompt_dialog_set_host (prompt, host);
149 kz_prompt_dialog_set_title(prompt,
150 aDialogTitle ? cTitle.get() : _("Prompt"));
151 kz_prompt_dialog_set_message_text(prompt, cText.get());
152 @@ -391,10 +414,12 @@
153 KzPromptDialog *prompt = KZ_PROMPT_DIALOG(kz_prompt_dialog_new_with_parent
155 GTK_WINDOW(GetGtkWindowForDOMWindow(aParent))));
156 +#ifndef HAVE_GECKO_1_9
157 gchar *host = GetURIForDOMWindow(aParent);
158 kz_prompt_dialog_set_host (prompt, host);
162 kz_prompt_dialog_set_title(prompt,
163 aDialogTitle ? cTitle.get() : _("Prompt"));
164 kz_prompt_dialog_set_message_text(prompt, cText.get());
165 @@ -510,3 +535,147 @@
166 NS_UTF16ToCString(uri, NS_CSTRING_ENCODING_UTF8, c_uri);
167 return g_strdup(c_uri.get());
170 +#ifdef HAVE_GECKO_1_9
172 +MakeDialogText(nsIChannel* aChannel, nsIAuthInformation* aAuthInfo,
176 + nsCOMPtr<nsIStringBundleService> bundleSvc =
177 + do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
178 + NS_ENSURE_SUCCESS(rv, rv);
180 + nsCOMPtr<nsIStringBundle> bundle;
181 + rv = bundleSvc->CreateBundle("chrome://global/locale/prompts.properties",
182 + getter_AddRefs(bundle));
183 + NS_ENSURE_SUCCESS(rv, rv);
185 + // figure out what message to display...
186 + nsCAutoString host;
188 + NS_GetAuthHostPort(aChannel, aAuthInfo, PR_FALSE, host, &port);
190 + nsAutoString displayHost;
191 + CopyUTF8toUTF16(host, displayHost);
193 + nsCOMPtr<nsIURI> uri;
194 + aChannel->GetURI(getter_AddRefs(uri));
196 + nsCAutoString scheme;
197 + uri->GetScheme(scheme);
199 + nsAutoString username;
200 + aAuthInfo->GetUsername(username);
203 + aAuthInfo->GetFlags(&flags);
204 + PRBool proxyAuth = (flags & nsIAuthInformation::AUTH_PROXY) != 0;
206 + nsAutoString realm;
207 + aAuthInfo->GetRealm(realm);
209 + // Append the port if it was specified
211 + displayHost.Append(PRUnichar(':'));
212 + displayHost.AppendInt(port);
215 + NS_NAMED_LITERAL_STRING(proxyText, "EnterLoginForProxy");
216 + NS_NAMED_LITERAL_STRING(originText, "EnterLoginForRealm");
217 + NS_NAMED_LITERAL_STRING(noRealmText, "EnterUserPasswordFor");
218 + NS_NAMED_LITERAL_STRING(passwordText, "EnterPasswordFor");
220 + const PRUnichar *text;
222 + text = proxyText.get();
224 + text = originText.get();
226 + // prepend "scheme://"
227 + nsAutoString schemeU;
228 + CopyASCIItoUTF16(scheme, schemeU);
229 + schemeU.AppendLiteral("://");
230 + displayHost.Insert(schemeU, 0);
233 + const PRUnichar *strings[] = { realm.get(), displayHost.get() };
234 + PRUint32 count = NS_ARRAY_LENGTH(strings);
236 + if (flags & nsIAuthInformation::ONLY_PASSWORD) {
237 + text = passwordText.get();
238 + strings[0] = username.get();
239 + } else if (!proxyAuth && realm.IsEmpty()) {
240 + text = noRealmText.get();
242 + strings[0] = strings[1];
245 + rv = bundle->FormatStringFromName(text, strings, count, getter_Copies(message));
250 +GtkPromptService::PromptAuth(nsIDOMWindow *aParent,
251 + nsIChannel *aChannel,
253 + nsIAuthInformation *authInfo,
254 + const PRUnichar *checkboxLabel,
255 + PRBool *checkValue,
258 + NS_ENSURE_ARG_POINTER (retval);
259 + NS_ENSURE_ARG_POINTER (authInfo);
262 + MakeDialogText(aChannel, authInfo, message);
264 + nsAutoString defaultUser, defaultDomain, defaultPass;
265 + authInfo->GetUsername(defaultUser);
266 + authInfo->GetDomain(defaultDomain);
267 + authInfo->GetPassword(defaultPass);
270 + authInfo->GetFlags(&flags);
272 + if ((flags & nsIAuthInformation::NEED_DOMAIN) && !defaultDomain.IsEmpty()) {
273 + defaultDomain.Append(PRUnichar('\\'));
274 + defaultUser.Insert(defaultDomain, 0);
277 + // NOTE: Allocation failure is not fatal here (just default to empty string
278 + // if allocation fails)
279 + PRUnichar *user = ToNewUnicode(defaultUser),
280 + *pass = ToNewUnicode(defaultPass);
282 + if (flags & nsIAuthInformation::ONLY_PASSWORD)
283 + rv = PromptPassword(aParent, nsnull, message.get(),
284 + &pass, checkboxLabel,
285 + checkValue, retval);
287 + rv = PromptUsernameAndPassword(aParent, nsnull, message.get(),
288 + &user, &pass, checkboxLabel,
289 + checkValue, retval);
291 + nsString userStr(user);
292 + nsString passStr(pass);
293 + authInfo->SetUsername(userStr);
294 + authInfo->SetPassword(passStr);
299 +NS_METHOD GtkPromptService::AsyncPromptAuth(nsIDOMWindow *aParent,
300 + nsIChannel *aChannel,
301 + nsIAuthPromptCallback *aCallback,
302 + nsISupports *aContext,
304 + nsIAuthInformation *authInfo,
305 + const PRUnichar *checkboxLabel,
306 + PRBool *checkValue,
307 + nsICancelable **retval)
309 + return NS_ERROR_NOT_IMPLEMENTED;
313 diff -urN kazehakase-0.5.5.orig/module/embed/gecko/GtkPromptService.h kazehakase-0.5.5/module/embed/gecko/GtkPromptService.h
314 --- kazehakase-0.5.5.orig/module/embed/gecko/GtkPromptService.h 2008-07-29 17:15:30.000000000 +0300
315 +++ kazehakase-0.5.5/module/embed/gecko/GtkPromptService.h 2008-08-11 02:22:57.000000000 +0300
318 * ***** END LICENSE BLOCK ***** */
320 +#ifdef HAVE_GECKO_1_9
321 +#include <nsIPromptService2.h>
323 #include <nsIPromptService.h>
327 #define NS_PROMPTSERVICE_CID \
332 -class GtkPromptService : public nsIPromptService
333 +class GtkPromptService :
334 +#ifdef HAVE_GECKO_1_9
335 + public nsIPromptService2
337 + public nsIPromptService
345 NS_DECL_NSIPROMPTSERVICE
346 +#ifdef HAVE_GECKO_1_9
347 + NS_DECL_NSIPROMPTSERVICE2
351 const char *GetButtonLabel(PRUint32 aFlags, PRUint32 aPos,
352 diff -urN kazehakase-0.5.5.orig/module/embed/gecko/kz-mozutils.h kazehakase-0.5.5/module/embed/gecko/kz-mozutils.h
353 --- kazehakase-0.5.5.orig/module/embed/gecko/kz-mozutils.h 2008-07-29 17:15:30.000000000 +0300
354 +++ kazehakase-0.5.5/module/embed/gecko/kz-mozutils.h 2008-08-11 02:22:57.000000000 +0300
356 * The following functions is taken from include/necko/nsNetUtils.h in mozilla
359 +#ifndef nsNetUtil_h__
362 GetIOService (nsIIOService **ioService)
371 #endif /* __KZ_MOZ_UTILS_H__ */