Hello playmobil,
I'd like you to do a code review. Please execute
g4 diff -c 9280187
or point your web browser to
http://mondrian/9280187
to review the following code:
Change 9280187 by [EMAIL PROTECTED] on 2008/12/05 18:49:36 *pending*
Add cursor feedback, for desktop.acceptDrag, on Safari.
PRESUBMIT=passed
R=playmobil
[EMAIL PROTECTED]
DELTA=10 (5 added, 0 deleted, 5 changed)
OCL=9280187
Affected files ...
...
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_sf.mm#7
edit
10 delta lines: 5 added, 0 deleted, 5 changed
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 9280187 by [EMAIL PROTECTED] on 2008/12/05 18:49:36 *pending*
Add cursor feedback, for desktop.acceptDrag, on Safari.
Affected files ...
...
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_sf.mm#7
edit
====
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_sf.mm#7
-
/Users/nigeltao/devel/srcmacgears2/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_sf.mm
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_sf.mm
2008-12-05 18:25:50.000000000 +1100
+++ googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_sf.mm
2008-12-05 17:33:49.000000000 +1100
@@ -38,6 +38,8 @@
static FileDragAndDropMetaData *g_file_drag_and_drop_meta_data = NULL;
static bool g_is_in_a_drag_operation = false;
static bool g_is_in_a_drop_operation = false;
+static bool g_drag_operation_has_been_set = false;
+static NSDragOperation g_drag_operation = NSDragOperationNone;
bool IsInADragOperation() {
return g_is_in_a_drag_operation;
@@ -153,24 +155,27 @@
}
g_is_in_a_drag_operation = true;
+ g_drag_operation_has_been_set = false;
NSDragOperation result = [self swizzledDraggingEntered:draggingInfo];
g_is_in_a_drag_operation = false;
- return result;
+ return g_drag_operation_has_been_set ? g_drag_operation : result;
}
- (NSDragOperation)swizzledDraggingUpdated:(id <NSDraggingInfo>)draggingInfo {
g_is_in_a_drag_operation = true;
+ g_drag_operation_has_been_set = false;
NSDragOperation result = [self swizzledDraggingUpdated:draggingInfo];
g_is_in_a_drag_operation = false;
- return result;
+ return g_drag_operation_has_been_set ? g_drag_operation : result;
}
- (NSDragOperation)swizzledDraggingExited:(id <NSDraggingInfo>)draggingInfo {
g_is_in_a_drag_operation = true;
+ g_drag_operation_has_been_set = false;
NSDragOperation result = [self swizzledDraggingExited:draggingInfo];
g_file_drag_and_drop_meta_data->Reset();
g_is_in_a_drag_operation = false;
- return result;
+ return g_drag_operation_has_been_set ? g_drag_operation : result;
}
- (BOOL)swizzledPerformDragOperation:(id <NSDraggingInfo>)draggingInfo {
@@ -220,8 +225,8 @@
return;
}
event->SetPropertyBool(STRING16(L"returnValue"), false);
- // TODO(nigeltao): Set the cursor to copy or none, depending on the value
- // of acceptance.
+ g_drag_operation_has_been_set = true;
+ g_drag_operation = acceptance ? NSDragOperationCopy : NSDragOperationNone;
}
void GetDragData(ModuleEnvironment *module_environment,