| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 else if (eventType == names.dragoverEvent) | 248 else if (eventType == names.dragoverEvent) |
| 249 *eventId = DragOverId; | 249 *eventId = DragOverId; |
| 250 else if (eventType == names.dragleaveEvent) | 250 else if (eventType == names.dragleaveEvent) |
| 251 *eventId = DragLeaveId; | 251 *eventId = DragLeaveId; |
| 252 else if (eventType == names.dropEvent) | 252 else if (eventType == names.dropEvent) |
| 253 *eventId = DropId; | 253 *eventId = DropId; |
| 254 else | 254 else |
| 255 return false; | 255 return false; |
| 256 | 256 |
| 257 // Drag events are mouse events and should have a clipboard. | 257 // Drag events are mouse events and should have a clipboard. |
| 258 MouseEvent* me = reinterpret_cast<MouseEvent*>(event); | 258 MouseEvent* me = static_cast<MouseEvent*>(event); |
| 259 Clipboard* clipboard = me->clipboard(); | 259 Clipboard* clipboard = me->clipboard(); |
| 260 if (!clipboard) | 260 if (!clipboard) |
| 261 return false; | 261 return false; |
| 262 | 262 |
| 263 // And that clipboard should be accessible by WebKit policy. | 263 // And that clipboard should be accessible by WebKit policy. |
| 264 ClipboardChromium* chrome = reinterpret_cast<ClipboardChromium*>(clipboard); | 264 ClipboardChromium* chrome = static_cast<ClipboardChromium*>(clipboard); |
| 265 HashSet<String> accessible(chrome->types()); | 265 HashSet<String> accessible(chrome->types()); |
| 266 if (accessible.isEmpty()) | 266 if (accessible.isEmpty()) |
| 267 return false; | 267 return false; |
| 268 | 268 |
| 269 RefPtr<ChromiumDataObject> dataObject(chrome->dataObject()); | 269 RefPtr<ChromiumDataObject> dataObject(chrome->dataObject()); |
| 270 if (dataObject && data) | 270 if (dataObject && data) |
| 271 *data = WebDragData(dataObject); | 271 *data = WebDragData(dataObject); |
| 272 | 272 |
| 273 return dataObject != NULL; | 273 return dataObject != NULL; |
| 274 } | 274 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 285 #endif | 285 #endif |
| 286 } | 286 } |
| 287 | 287 |
| 288 bool WebBindings::isDragEvent(NPObject* event) | 288 bool WebBindings::isDragEvent(NPObject* event) |
| 289 { | 289 { |
| 290 int eventId; | 290 int eventId; |
| 291 return getDragData(event, &eventId, NULL); | 291 return getDragData(event, &eventId, NULL); |
| 292 } | 292 } |
| 293 | 293 |
| 294 } // namespace WebKit | 294 } // namespace WebKit |
| OLD | NEW |