Hello michaeln,

I'd like you to do a code review.  Please execute
        g4 diff -c 10947778

or point your web browser to
        http://mondrian/10947778
(this changelist has been uploaded to Mondrian)

to review the following code:

Change 10947778 by n...@noel-gears2 on 2009/04/28 13:18:42 *pending*

        Define CPAPI for chrome gears drag drop. 
        
        Matt's away so I'm sending this you.  This is minor update, that
        was Matt's recommendation, so I changed the minor version (to 95)
        and documented the interface calls.
        
        Approval sought -- but like all CPAPI updates, they are done last
        with a matching submit into the chrome svn.
        
        So I don't intend to submit this yet.  I'll do that latter with a
        matching chrome svn change as the last CL need to do for chrome
        drag drop.
        
        But if it's ok to submit it now, well let me know.
        
        PRESUBMIT=passed
        R=michaeln
        [email protected]
        DELTA=36  (35 added, 0 deleted, 1 changed)
        OCL=10947778

Affected files ...

... 
//depot/googleclient/gears/opensource/third_party/chrome/chrome_plugin_api.h#4 
edit

36 delta lines: 35 added, 0 deleted, 1 changed

Also consider running:
        g4 lint -c 10947778

which verifies that the changelist doesn't introduce new style violations.

If you can't do the review, please let me know as soon as possible.  During
your review, please ensure that all new code has corresponding unit tests and
that existing unit tests are updated appropriately.  Visit
http://www/eng/code_review.html for more information.

This is a semiautomated message from "g4 mail".  Complaints or suggestions?
Mail [email protected].
Change 10947778 by n...@noel-gears2 on 2009/04/28 13:18:42 *pending*

        Define CPAPI for chrome gears drag drop. 
        
        Matt's away so I'm sending this you.  This is minor update, that
        was Matt's recommendation, so I changed the minor version (to 95)
        and documented the interface calls.
        
        Approval sought -- but like all CPAPI updates, they are done last
        with a matching submit into the chrome svn.
        
        So I don't intend to submit this yet.  I'll do that latter with a
        matching chrome svn change as the last CL need to do for chrome
        drag drop.
        
        But if it's ok to submit it now, well let me know.
        
        OCL=10947778

Affected files ...

... 
//depot/googleclient/gears/opensource/third_party/chrome/chrome_plugin_api.h#4 
edit

==== 
//depot/googleclient/gears/opensource/third_party/chrome/chrome_plugin_api.h#4 
- 
c:\Users\noel.GOOGLE\src-gears2/googleclient/gears/opensource/third_party/chrome/chrome_plugin_api.h
 ====
# action=edit type=text
--- googleclient/gears/opensource/third_party/chrome/chrome_plugin_api.h        
2009-02-23 16:26:38.000000000 +1100
+++ googleclient/gears/opensource/third_party/chrome/chrome_plugin_api.h        
2009-04-28 13:02:47.000000000 +1000
@@ -59,7 +59,7 @@
 // The current version of the API, used by the 'version' field of CPPluginFuncs
 // and CPBrowserFuncs.
 #define CP_MAJOR_VERSION 0
-#define CP_MINOR_VERSION 9
+#define CP_MINOR_VERSION 95
 #define CP_VERSION       ((CP_MAJOR_VERSION << 8) | (CP_MINOR_VERSION))
 
 #define CP_GET_MAJOR_VERSION(version) ((version & 0xff00) >> 8)
@@ -441,6 +441,39 @@
 typedef void (STDCALL *CPP_OnFileDialogResultFunc)(void *data,
                                                    const char **files,
                                                    uint32 files_len);
+
+// Asks the browser to verify that NPObject* 'event' is the current drag event
+// the browser is dispatching, and extract drag data from the event if so.  On
+// success, returns the drag 'identity' (an up-counter that the browser chrome
+// increases each time a user drag enters a renderer tab), the drag 'event_id'
+// and the 'drag_type' being a utf8 encoded string with values "Files", "Text"
+// or "URL".  If 'add_data' is true, also return the 'drag_data', again a utf8
+// encoded string with the data for the drag type.  For drag type "Files", the
+// data is a backspace delimited list of file paths.
+//
+// The call fails with a CPError if 'event' is an invalid drag event, and sets
+// the 'identity' and 'event_id' to 0.  Note: on success, non-NULL 'drag_type'
+// and 'drag_data' should be freed with CPB_Free() when done.
+//
+typedef CPError (STDCALL *CPB_GetDragDataFunc)(
+   CPID id, CPBrowsingContext context, struct NPObject* event, bool add_data,
+   uint32* identity, uint32* event_id, char** drag_type, char** drag_data);
+
+// Asks the browser to verify that NPObject* 'event' is the current drag event
+// the browser is dispatching and show the requested drop 'effect' if so.  The
+// browser displays drop effects during dragenter and dragover events, to give
+// user visible feedback (with a drag cursor, typically) to indicate whether a
+// subsequent drop event will succeed or not.  The implementation supports the
+// so-called "copy" and "none" effects.  When 'effect' is non-zero, the "copy"
+// effect is shown.  Otherwise, the "none" effect is shown, which prevents the
+// subsequent drop event from succeeding.  Returns CPError on failure, meaning
+// the 'event' is an invalid drag event.
+//
+// Note: 'effect' is int to allow for new effects in future.  For example, the
+// HTML5-defined drop effects "move" and "link".
+//
+typedef CPError (STDCALL *CPB_SetDropEffectFunc)(
+    CPID id, CPBrowsingContext context, struct NPObject* event, int effect);
 
 // Function table for issuing requests using via the other side's network 
stack.
 // For the plugin, this functions deal with issuing requests through the
@@ -516,6 +549,8 @@
   CPB_SendSyncMessageFunc send_sync_message;
   CPB_PluginThreadAsyncCallFunc plugin_thread_async_call;
   CPB_OpenFileDialogFunc open_file_dialog;
+  CPB_GetDragDataFunc get_drag_data;
+  CPB_SetDropEffectFunc set_drop_effect;
 } CPBrowserFuncs;
 
 

Reply via email to