** Work in progress **
** Comments invited **

Task: Goto, fill and submit a normal form or modal dialogue on a
webpage automatically.
================================================================

GOAL 1: Renderer Process to Notify Browser Process a form is seen.

The reason I need to achieve this communication is to allow a context
sensitive passcard menu for the user.  Also will be required when user
clicks submit to offer remembering form.  Now the Chrome UI will know
if there a form on display, and can search for a matching passcard
that will fill this form.  In some cases the UI may be expecting a
form and can then fill and submit the form automatically.


Renderer currently scans every page after it is loaded for a password
form.
See webframeloaderclient_impl.cc function
dispatchDidFinishDocumentLoad() (Line 352, bookmark Finished Load)

Enhance this function to call new function OnFormsSeen in delegate.
(which is render_view.cc)  Pass a FormData struct up the system. (Use
existing structure and message)

** Created a test structure with hard coded values for now. **

Current function OnPasswordFormsSeen works.  It calls a send macro to
send an IPC message to the browser process.  IPC Macros are defined in
render_messages_internal.h.  This includes host and client messages!
Incoming message processor for Browser Process is render_view_host.cc.

In render_view.cc create function OnFormsSeen (Line 2166 Bookmark On
Forms Seen).  Found an existing message for passing FormData from b2r
called ViewMsg_FormFill.  Plan to use same message in this case to go
r2b.  Headers to update with new function prototype are
render_view.h.  Also add a skeleton to webview_delegate.h

Now we need to receive the message.  Create new function
OnMsgFormsSeen in render_view_host.c  (Line 1063 Bookmark Browser Msg
In).  Add prototype to render_view_host.h.
Add IPC_MESSAGE_HANDLER to same file, (line 669 bookmark Browser
Handler).

Tested in debugger (single process mode). Hard coded data is
received.



GOAL 2: Browser to send renderer data and submit form.

This is already coded, except one error as fixed and explained below.

Create a Menu option Test Passcards.

This creates a hardcoded FormData structure, and calls … get ready…

1.      GetSelectedTabContents()
2.      -> AsWebContents()
3.      -> FillForm() in class WebContents.

Web_contents.cc line 1021, calls FillForm() in class RenderViewHost
Render_view_host.cc line 338 sends an IPC Message to the renderer.

On receipt of message renderer calls FillForm() in namespace
webkit_glue.
This executes Dom_operations.cc line 410.

FillForm
This does two main calls.
1.      It calls FindFormElements to get elements matching the FormData
structure.
2.      If the result is not empty it then calls FillFormImpl.

FindFormElements
This checks origin and action fields in FormData against the current
web page and form, then calls FindFormInputElements that searches for
matching form elements for all FormData elements (and the submit
button now I’ve fixed it).

NOTE: action must identify the right form!

FillFormImpl
This checks autoComplete (I think the way it does it once and not for
each element is dubious), then steps through all found elements.

•       If the element is the submit button it calls setActivatedSubmit()
•       Else it calls setValue(), setAutofilled() and then onChange()
•       At end, if submit was found it calls submit().

NOTE: 3rd parameter to this function was hardcoded as false when
called from FillForm().  This prohibited it from ever trying to submit
the form!  I have changed this to true, and fixed another problem so
if the name of submit is in the FormData structure it will attempt to
submit.

Tested!



GOAL 3: Parse a web page for forms reliably.

Not sure about current Glue code for stepping through forms!  Facebook
homepage has 2 forms but the second one is shown having about 170
items – it has about 8!

I have a parse routine that writes what it sees to a text file.  I
would like this to be a special hidden Chrome page that can be used
for form filling debugging.  This would be useful on release!

More importantly it needs to actually succeed in identifying the form
structure properly!

Needs to work with multiple forms on a page!



GOAL 4: Plug passcard storage and operation into the bookmark
subsystem.

Once form filling works, I will need to make it available to the user.

Current password manager is pants and I want to throw it away!
Current bookmark system does not support favicons, thumbnails or
labels.  Need to look at how history backend works using some SQL
subsystem to see if it is worth using it for bookmarks.

I need to create a back end that actually does the form load and
filling once a user asks it to.

I will also need a way to edit the backend data (doesn’t need to be
pretty).



GOAL 5: Allow creation of passcard if required during normal browsing.

GOAL 6: Change Chrome User Interface to access and initiate form
filling.

GOAL 7: Support HTML Modal authentication form.

GOAL 8: Implement a smooth and sexy bookmark and passcard manager.


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

Is there any documentation for the HTML structures within webkit?  I
have found their documentation of each class, but I need to understand
how the whole structure relates to the HTML source.  Will be single
stepping through it soon if I can't find any existing docs!

Chris


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Chromium-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/chromium-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to