Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 234416
Collapse All | Expand All

(-)kazehakase-0.5.5.orig/ext/ruby/Makefile.am (-2 lines)
Lines 8-14 Link Here
8
	-DG_DISABLE_DEPRECATED=1
8
	-DG_DISABLE_DEPRECATED=1
9
9
10
INCLUDES =						\
10
INCLUDES =						\
11
	$(MOZILLA_COMPONENT_CFLAGS)			\
12
	$(GTK_CFLAGS)					\
11
	$(GTK_CFLAGS)					\
13
	$(LIBGNUTLS_CFLAGS)				\
12
	$(LIBGNUTLS_CFLAGS)				\
14
	$(RUBY_CFLAGS)					\
13
	$(RUBY_CFLAGS)					\
Lines 63-67 Link Here
63
	$(GTK_LIBS)				\
62
	$(GTK_LIBS)				\
64
	$(LIBGNUTLS_LIBS)			\
63
	$(LIBGNUTLS_LIBS)			\
65
	$(RUBY_LIBS)				\
64
	$(RUBY_LIBS)				\
66
	$(MOZILLA_COMPONENT_LIBS)		\
67
	$(top_builddir)/src/libkazehakase.la
65
	$(top_builddir)/src/libkazehakase.la
(-)kazehakase-0.5.5.orig/ext/ruby/Makefile.in (-2 lines)
Lines 306-312 Link Here
306
top_srcdir = @top_srcdir@
306
top_srcdir = @top_srcdir@
307
ext_LTLIBRARIES = ruby.la
307
ext_LTLIBRARIES = ruby.la
308
INCLUDES = \
308
INCLUDES = \
309
	$(MOZILLA_COMPONENT_CFLAGS)			\
310
	$(GTK_CFLAGS)					\
309
	$(GTK_CFLAGS)					\
311
	$(LIBGNUTLS_CFLAGS)				\
310
	$(LIBGNUTLS_CFLAGS)				\
312
	$(RUBY_CFLAGS)					\
311
	$(RUBY_CFLAGS)					\
Lines 354-360 Link Here
354
	$(GTK_LIBS)				\
353
	$(GTK_LIBS)				\
355
	$(LIBGNUTLS_LIBS)			\
354
	$(LIBGNUTLS_LIBS)			\
356
	$(RUBY_LIBS)				\
355
	$(RUBY_LIBS)				\
357
	$(MOZILLA_COMPONENT_LIBS)		\
358
	$(top_builddir)/src/libkazehakase.la
356
	$(top_builddir)/src/libkazehakase.la
359
357
360
all: all-am
358
all: all-am
(-)kazehakase-0.5.5.orig/module/embed/gecko/gtkmozembed/nsProfileDirServiceProvider2.cpp (-24 lines)
Lines 306-331 Link Here
306
        rv = EnsureProfileFileExists(localFile, domainDir);
306
        rv = EnsureProfileFileExists(localFile, domainDir);
307
    }
307
    }
308
  }
308
  }
309
  else if (strcmp(prop, NS_APP_MAIL_50_DIR) == 0) {
310
    rv = domainDir->Clone(getter_AddRefs(localFile));
311
    if (NS_SUCCEEDED(rv))
312
      rv = localFile->AppendNative(MAIL_DIR_50_NAME);
313
  }
314
  else if (strcmp(prop, NS_APP_IMAP_MAIL_50_DIR) == 0) {
315
    rv = domainDir->Clone(getter_AddRefs(localFile));
316
    if (NS_SUCCEEDED(rv))
317
      rv = localFile->AppendNative(IMAP_MAIL_DIR_50_NAME);
318
  }
319
  else if (strcmp(prop, NS_APP_NEWS_50_DIR) == 0) {
320
    rv = domainDir->Clone(getter_AddRefs(localFile));
321
    if (NS_SUCCEEDED(rv))
322
      rv = localFile->AppendNative(NEWS_DIR_50_NAME);
323
  }
324
  else if (strcmp(prop, NS_APP_MESSENGER_FOLDER_CACHE_50_DIR) == 0) {
325
    rv = domainDir->Clone(getter_AddRefs(localFile));
326
    if (NS_SUCCEEDED(rv))
327
      rv = localFile->AppendNative(MSG_FOLDER_CACHE_DIR_50_NAME);
328
  }
329
  else if (strcmp(prop, NS_APP_STORAGE_50_FILE) == 0) {
309
  else if (strcmp(prop, NS_APP_STORAGE_50_FILE) == 0) {
330
    rv = domainDir->Clone(getter_AddRefs(localFile));
310
    rv = domainDir->Clone(getter_AddRefs(localFile));
331
    if (NS_SUCCEEDED(rv))
311
    if (NS_SUCCEEDED(rv))
Lines 518-527 Link Here
518
  (void) directoryService->Undefine(NS_APP_BOOKMARKS_50_FILE);
498
  (void) directoryService->Undefine(NS_APP_BOOKMARKS_50_FILE);
519
  (void) directoryService->Undefine(NS_APP_DOWNLOADS_50_FILE);
499
  (void) directoryService->Undefine(NS_APP_DOWNLOADS_50_FILE);
520
  (void) directoryService->Undefine(NS_APP_SEARCH_50_FILE);
500
  (void) directoryService->Undefine(NS_APP_SEARCH_50_FILE);
521
  (void) directoryService->Undefine(NS_APP_MAIL_50_DIR);
522
  (void) directoryService->Undefine(NS_APP_IMAP_MAIL_50_DIR);
523
  (void) directoryService->Undefine(NS_APP_NEWS_50_DIR);
524
  (void) directoryService->Undefine(NS_APP_MESSENGER_FOLDER_CACHE_50_DIR);
525
501
526
  return NS_OK;
502
  return NS_OK;
527
}
503
}
(-)kazehakase-0.5.5.orig/module/embed/gecko/GtkPromptService.cpp (-1 / +170 lines)
Lines 36-41 Link Here
36
 *
36
 *
37
 * ***** END LICENSE BLOCK ***** */
37
 * ***** END LICENSE BLOCK ***** */
38
38
39
#include "config.h"
39
#include "GtkPromptService.h"
40
#include "GtkPromptService.h"
40
#include <nsIWindowWatcher.h>
41
#include <nsIWindowWatcher.h>
41
#include <nsIWebBrowserChrome.h>
42
#include <nsIWebBrowserChrome.h>
Lines 49-54 Link Here
49
#include <nsIDOMCharacterData.h>
50
#include <nsIDOMCharacterData.h>
50
#include <nsIDOMText.h>
51
#include <nsIDOMText.h>
51
#include <nsMemory.h>
52
#include <nsMemory.h>
53
#ifdef HAVE_GECKO_1_9
54
#include <nsIAuthInformation.h>
55
#include <nsIStringBundle.h>
56
#include <nsServiceManagerUtils.h>
57
/* That is ugly but I didn't find another way, except including
58
 * NS_GetAuthHostPort */
59
#define kNotFound -1
60
NS_COM void AppendUTF16toUTF8( const nsAString& aSource, nsACString& aDest );
61
#include <nsStringAPI.h>
62
#include <nsIProxiedChannel.h>
63
#include <nsIProxyInfo.h>
64
#include <nsIIDNService.h>
65
#include <nsNetCID.h>
66
#include <nsIURI.h>
67
#include <nsNetUtil.h>
68
#include <nsPromptUtils.h>
69
#endif
52
70
53
#include <glib/gi18n.h>
71
#include <glib/gi18n.h>
54
#include "kz-prompt-dialog.h"
72
#include "kz-prompt-dialog.h"
Lines 89-96 Link Here
89
{
107
{
90
}
108
}
91
109
92
110
#ifdef HAVE_GECKO_1_9
111
NS_IMPL_ISUPPORTS2(GtkPromptService, nsIPromptService, nsIPromptService2)
112
#else
93
NS_IMPL_ISUPPORTS1(GtkPromptService, nsIPromptService)
113
NS_IMPL_ISUPPORTS1(GtkPromptService, nsIPromptService)
114
#endif
94
115
95
NS_IMETHODIMP
116
NS_IMETHODIMP
96
GtkPromptService::Alert(nsIDOMWindow* aParent, const PRUnichar* aDialogTitle, 
117
GtkPromptService::Alert(nsIDOMWindow* aParent, const PRUnichar* aDialogTitle, 
Lines 338-347 Link Here
338
	KzPromptDialog *prompt = KZ_PROMPT_DIALOG(kz_prompt_dialog_new_with_parent
359
	KzPromptDialog *prompt = KZ_PROMPT_DIALOG(kz_prompt_dialog_new_with_parent
339
	    						(TYPE_PROMPT_USER_PASS,
360
	    						(TYPE_PROMPT_USER_PASS,
340
	    					         GTK_WINDOW(GetGtkWindowForDOMWindow(aParent))));
361
	    					         GTK_WINDOW(GetGtkWindowForDOMWindow(aParent))));
362
#ifndef HAVE_GECKO_1_9
341
	gchar *host = GetURIForDOMWindow(aParent);
363
	gchar *host = GetURIForDOMWindow(aParent);
342
	kz_prompt_dialog_set_host (prompt, host);
364
	kz_prompt_dialog_set_host (prompt, host);
343
	if (host)
365
	if (host)
344
		g_free(host);
366
		g_free(host);
367
#endif
345
	kz_prompt_dialog_set_title(prompt,
368
	kz_prompt_dialog_set_title(prompt,
346
	    			   aDialogTitle ? cTitle.get() : _("Prompt"));
369
	    			   aDialogTitle ? cTitle.get() : _("Prompt"));
347
	kz_prompt_dialog_set_message_text(prompt, cText.get());
370
	kz_prompt_dialog_set_message_text(prompt, cText.get());
Lines 391-400 Link Here
391
	KzPromptDialog *prompt = KZ_PROMPT_DIALOG(kz_prompt_dialog_new_with_parent
414
	KzPromptDialog *prompt = KZ_PROMPT_DIALOG(kz_prompt_dialog_new_with_parent
392
	    						(TYPE_PROMPT_PASS,
415
	    						(TYPE_PROMPT_PASS,
393
	    					         GTK_WINDOW(GetGtkWindowForDOMWindow(aParent))));
416
	    					         GTK_WINDOW(GetGtkWindowForDOMWindow(aParent))));
417
#ifndef HAVE_GECKO_1_9
394
	gchar *host = GetURIForDOMWindow(aParent);
418
	gchar *host = GetURIForDOMWindow(aParent);
395
	kz_prompt_dialog_set_host (prompt, host);
419
	kz_prompt_dialog_set_host (prompt, host);
396
	if (host)
420
	if (host)
397
		g_free(host);
421
		g_free(host);
422
#endif
398
	kz_prompt_dialog_set_title(prompt,
423
	kz_prompt_dialog_set_title(prompt,
399
	    			   aDialogTitle ? cTitle.get() : _("Prompt"));
424
	    			   aDialogTitle ? cTitle.get() : _("Prompt"));
400
	kz_prompt_dialog_set_message_text(prompt, cText.get());
425
	kz_prompt_dialog_set_message_text(prompt, cText.get());
Lines 510-512 Link Here
510
	NS_UTF16ToCString(uri, NS_CSTRING_ENCODING_UTF8, c_uri);
535
	NS_UTF16ToCString(uri, NS_CSTRING_ENCODING_UTF8, c_uri);
511
	return g_strdup(c_uri.get());
536
	return g_strdup(c_uri.get());
512
}
537
}
538
539
#ifdef HAVE_GECKO_1_9
540
static nsresult
541
MakeDialogText(nsIChannel* aChannel, nsIAuthInformation* aAuthInfo,
542
               nsString& message)
543
{
544
  nsresult rv;
545
  nsCOMPtr<nsIStringBundleService> bundleSvc =
546
    do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
547
  NS_ENSURE_SUCCESS(rv, rv);
548
549
  nsCOMPtr<nsIStringBundle> bundle;
550
  rv = bundleSvc->CreateBundle("chrome://global/locale/prompts.properties",
551
                               getter_AddRefs(bundle));
552
  NS_ENSURE_SUCCESS(rv, rv);
553
554
  // figure out what message to display...
555
  nsCAutoString host;
556
  PRInt32 port;
557
  NS_GetAuthHostPort(aChannel, aAuthInfo, PR_FALSE, host, &port);
558
559
  nsAutoString displayHost;
560
  CopyUTF8toUTF16(host, displayHost);
561
562
  nsCOMPtr<nsIURI> uri;
563
  aChannel->GetURI(getter_AddRefs(uri));
564
565
  nsCAutoString scheme;
566
  uri->GetScheme(scheme);
567
568
  nsAutoString username;
569
  aAuthInfo->GetUsername(username);
570
571
  PRUint32 flags;
572
  aAuthInfo->GetFlags(&flags);
573
  PRBool proxyAuth = (flags & nsIAuthInformation::AUTH_PROXY) != 0;
574
575
  nsAutoString realm;
576
  aAuthInfo->GetRealm(realm);
577
578
  // Append the port if it was specified
579
  if (port != -1) {
580
    displayHost.Append(PRUnichar(':'));
581
    displayHost.AppendInt(port);
582
  }
583
584
  NS_NAMED_LITERAL_STRING(proxyText, "EnterLoginForProxy");
585
  NS_NAMED_LITERAL_STRING(originText, "EnterLoginForRealm");
586
  NS_NAMED_LITERAL_STRING(noRealmText, "EnterUserPasswordFor");
587
  NS_NAMED_LITERAL_STRING(passwordText, "EnterPasswordFor");
588
589
  const PRUnichar *text;
590
  if (proxyAuth) {
591
    text = proxyText.get();
592
  } else {
593
    text = originText.get();
594
595
    // prepend "scheme://"
596
    nsAutoString schemeU;
597
    CopyASCIItoUTF16(scheme, schemeU);
598
    schemeU.AppendLiteral("://");
599
    displayHost.Insert(schemeU, 0);
600
  }
601
602
  const PRUnichar *strings[] = { realm.get(), displayHost.get() };
603
  PRUint32 count = NS_ARRAY_LENGTH(strings);
604
605
  if (flags & nsIAuthInformation::ONLY_PASSWORD) {
606
    text = passwordText.get();
607
    strings[0] = username.get();
608
  } else if (!proxyAuth && realm.IsEmpty()) {
609
    text = noRealmText.get();
610
    count--;
611
    strings[0] = strings[1];
612
  }
613
614
  rv = bundle->FormatStringFromName(text, strings, count, getter_Copies(message));
615
  return rv;
616
}
617
618
NS_METHOD
619
GtkPromptService::PromptAuth(nsIDOMWindow *aParent,
620
                              nsIChannel *aChannel,
621
                              PRUint32 level,
622
                              nsIAuthInformation *authInfo,
623
                              const PRUnichar *checkboxLabel,
624
                              PRBool *checkValue,
625
                              PRBool *retval)
626
{
627
	NS_ENSURE_ARG_POINTER (retval);
628
	NS_ENSURE_ARG_POINTER (authInfo);
629
630
  nsString message;
631
  MakeDialogText(aChannel, authInfo, message);
632
633
  nsAutoString defaultUser, defaultDomain, defaultPass;
634
  authInfo->GetUsername(defaultUser);
635
  authInfo->GetDomain(defaultDomain);
636
  authInfo->GetPassword(defaultPass);
637
638
  PRUint32 flags;
639
  authInfo->GetFlags(&flags);
640
641
  if ((flags & nsIAuthInformation::NEED_DOMAIN) && !defaultDomain.IsEmpty()) {
642
    defaultDomain.Append(PRUnichar('\\'));
643
    defaultUser.Insert(defaultDomain, 0);
644
  }
645
646
  // NOTE: Allocation failure is not fatal here (just default to empty string
647
  // if allocation fails)
648
  PRUnichar *user = ToNewUnicode(defaultUser),
649
    *pass = ToNewUnicode(defaultPass);
650
  nsresult rv;
651
  if (flags & nsIAuthInformation::ONLY_PASSWORD)
652
    rv = PromptPassword(aParent, nsnull, message.get(),
653
                                  &pass, checkboxLabel,
654
                                  checkValue, retval);
655
  else
656
    rv = PromptUsernameAndPassword(aParent, nsnull, message.get(),
657
                                             &user, &pass, checkboxLabel,
658
                                             checkValue, retval);
659
660
  nsString userStr(user);
661
  nsString passStr(pass);
662
  authInfo->SetUsername(userStr);
663
  authInfo->SetPassword(passStr);
664
665
  return rv;
666
}
667
668
NS_METHOD GtkPromptService::AsyncPromptAuth(nsIDOMWindow *aParent,
669
                                            nsIChannel *aChannel,
670
                                            nsIAuthPromptCallback *aCallback,
671
                                            nsISupports *aContext,
672
                                            PRUint32 level,
673
                                            nsIAuthInformation *authInfo,
674
                                            const PRUnichar *checkboxLabel,
675
                                            PRBool *checkValue,
676
                                            nsICancelable **retval)
677
{
678
  return NS_ERROR_NOT_IMPLEMENTED;
679
}
680
681
#endif
(-)kazehakase-0.5.5.orig/module/embed/gecko/GtkPromptService.h (-1 / +13 lines)
Lines 37-43 Link Here
37
 *
37
 *
38
 * ***** END LICENSE BLOCK ***** */
38
 * ***** END LICENSE BLOCK ***** */
39
39
40
#ifdef HAVE_GECKO_1_9
41
#include <nsIPromptService2.h>
42
#else
40
#include <nsIPromptService.h>
43
#include <nsIPromptService.h>
44
#endif
41
#include <gtk/gtk.h>
45
#include <gtk/gtk.h>
42
46
43
#define NS_PROMPTSERVICE_CID \
47
#define NS_PROMPTSERVICE_CID \
Lines 45-51 Link Here
45
49
46
class nsIDOMWindow;
50
class nsIDOMWindow;
47
51
48
class GtkPromptService : public nsIPromptService
52
class GtkPromptService :
53
#ifdef HAVE_GECKO_1_9
54
	public nsIPromptService2
55
#else
56
	public nsIPromptService
57
#endif
49
{
58
{
50
public:
59
public:
51
	GtkPromptService();
60
	GtkPromptService();
Lines 53-58 Link Here
53
62
54
	NS_DECL_ISUPPORTS
63
	NS_DECL_ISUPPORTS
55
	NS_DECL_NSIPROMPTSERVICE
64
	NS_DECL_NSIPROMPTSERVICE
65
#ifdef HAVE_GECKO_1_9
66
	NS_DECL_NSIPROMPTSERVICE2
67
#endif
56
68
57
private:
69
private:
58
	const char *GetButtonLabel(PRUint32 aFlags, PRUint32 aPos,
70
	const char *GetButtonLabel(PRUint32 aFlags, PRUint32 aPos,
(-)kazehakase-0.5.5.orig/module/embed/gecko/kz-mozutils.h (-1 / +3 lines)
Lines 49-54 Link Here
49
 * The following functions is taken from include/necko/nsNetUtils.h in mozilla
49
 * The following functions is taken from include/necko/nsNetUtils.h in mozilla
50
 */
50
 */
51
51
52
#ifndef nsNetUtil_h__
53
52
inline nsresult
54
inline nsresult
53
GetIOService (nsIIOService **ioService)
55
GetIOService (nsIIOService **ioService)
54
{
56
{
Lines 245-250 Link Here
245
247
246
  return resultBuffer;
248
  return resultBuffer;
247
}
249
}
248
250
#endif
249
251
250
#endif /* __KZ_MOZ_UTILS_H__ */
252
#endif /* __KZ_MOZ_UTILS_H__ */

Return to bug 234416