Expose Cookies functionality to java

ASSIGNED
Assigned to

Status

Core Graveyard
Java APIs to WebShell
P3
normal
ASSIGNED
17 years ago
5 years ago

People

(Reporter: edburns, Assigned: edburns)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(5 attachments)

(Assignee)

Description

17 years ago
There are three parts to this.

1. Prefs.  Make it so the user can set cookie prefs

2. Make it so the user can be prompted when the server wishes to set a cookie, 
if the prefs say that the user wants to be prompted.

3. Enable the custom app to set cookies.
(Assignee)

Comment 1

17 years ago
Created attachment 20420 [details]
tar.gz, checkpoint.  Implements webclient side of part 2.
(Assignee)

Comment 2

17 years ago
Created attachment 20484 [details]
tar.gz, final implementation of UniversalDialog support.
(Assignee)

Comment 3

17 years ago
How to test this bug.

1. Remove your .mozilla directory, or equivalent

1.5 Set up the proxy preferences so you can get to bugzilla.mozilla.org.

2. Start mozilla and go to Edit-Preferences->Advanced->Cookies.

3. Remove all Cookies

4. Accept all cookies, and warn me before accepting cookes

5. Stop mozilla.

Start webclient and visit
<http://bugzilla.mozilla.org/enter_bug.cgi?product=Browser>, then enter
your bugzilla userid and password.  A Confirm dialog should come up.
Make sure that the dialog does the right thing, that is, if you accept
the cookie, exit webclient, start up mozilla, and use the cookie viewer
to see that the cookie is there.  Please note that you see the Enter a
bug page whether you accept the cookie or not.

A classes_spec/org/mozilla/webclient/Cookies.java
M classes_spec/org/mozilla/webclient/Navigation.java
M classes_spec/org/mozilla/webclient/Prompt.java
M classes_spec/org/mozilla/webclient/test/EMWindow.java
M classes_spec/org/mozilla/webclient/test/PasswordDialog.java
A classes_spec/org/mozilla/webclient/test/UniversalDialog.java
M src_moz/CBrowserContainer.cpp
M src_moz/Makefile.win
A src_moz/PromptActionEvents.cpp
A src_moz/PromptActionEvents.h
M src_moz/ns_util.cpp
M src_moz/ns_util.h
M src_share/jni_util.cpp
M src_share/jni_util.h
Status: NEW → ASSIGNED
(Assignee)

Comment 4

17 years ago
Created attachment 20494 [details]
tar.gz checkpoint, prefs part.
(Assignee)

Comment 5

17 years ago
Created attachment 20509 [details]
tar.gz, woking first iteration of prefs, Can setPrefs!

Comment 6

17 years ago
tested on Solaris - r=ashuk

Comment 7

17 years ago
Diff of changes needed in src_moz/motif/NativeLoaderStub.cpp for code to work on
Solaris.

---------------

ashuk@versailles[147]>diff NativeLoaderStub.cpp
../../../src_moz/motif/NativeLoaderStub.cpp
116,118c116,118
< void (* nativeSetUnicharPref) (JNIEnv *env, jobject obj, jstring, jstring);
< void (* nativeSetIntPref) (JNIEnv *env, jobject obj, jstring, jint);
< void (* nativeSetBoolPref) (JNIEnv *env, jobject obj, jstring, jboolean);
---
> void (* nativeSetUnicharPref) (JNIEnv *, jobject, jstring, jstring);
> void (* nativeSetIntPref) (JNIEnv *, jobject, jstring, jint);
> void (* nativeSetBoolPref) (JNIEnv *, jobject, jstring, jboolean);
397c397
<   nativeSetUnicharPref = (void (*) (JNIEnv *env, jobject obj, jstring,
jstring)) dlsym(dll,
"Java_org_mozilla_webclient_wrapper_1native_PrefrencesImpl_nativeSetUnicharPref");
---
>   nativeSetUnicharPref = (void (*) (JNIEnv *, jobject, jstring, jstring))
dlsym(dll,
"Java_org_mozilla_webclient_wrapper_1native_PreferencesImpl_nativeSetUnicharPref");
401c401
<   nativeSetIntPref = (void (*) (JNIEnv *env, jobject obj, jstring, jint))
dlsym(dll,
"Java_org_mozilla_webclient_wrapper_1native_PrefrencesImpl_nativeSetIntPref");
---
>   nativeSetIntPref = (void (*) (JNIEnv *, jobject, jstring, jint)) dlsym(dll,
"Java_org_mozilla_webclient_wrapper_1native_PreferencesImpl_nativeSetIntPref");
405c405
<   nativeSetBoolPref = (void (*) (JNIEnv *env, jobject obj, jstring, jboolean))
dlsym(dll,
"Java_org_mozilla_webclient_wrapper_1native_PrefrencesImpl_nativeSetBoolPref");
---
>   nativeSetBoolPref = (void (*) (JNIEnv *, jobject, jstring, jboolean))
dlsym(dll,
"Java_org_mozilla_webclient_wrapper_1native_PreferencesImpl_nativeSetBoolPref");


---------------

Ed, pls review.

Updated

17 years ago
QA Contact: geetha.vaidyanaathan → avm

Comment 8

16 years ago
Created attachment 40435 [details]
Set/Get cookie functionality

Comment 9

16 years ago
I have had a go at implementing part 3 of this (Enable the custom app to set 
cookies). I have only implemented Cookies.setCookieString and 
Cookies.getCookieString. This seems to work for me so hopefully it might turn 
out to be useful for an addition to webclient.

I am not too sure about the prompt parameter in CookiesActionEvents.cpp for the 
call to nsICookieServices.setCookieString. I have left it to nsnull for now.
Component: Java APIs to WebShell → Java APIs to WebShell
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.