Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Side by Side Diff: webkit/glue/webview_impl.cc

Issue 28108: Add an identity (id) to system drag & drop. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webview_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2007 Google Inc. All Rights Reserved. 2 * Copyright 2007 Google Inc. All Rights Reserved.
3 * 3 *
4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
5 * 5 *
6 * ***** BEGIN LICENSE BLOCK ***** 6 * ***** BEGIN LICENSE BLOCK *****
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 observed_new_navigation_(false), 327 observed_new_navigation_(false),
328 #ifndef NDEBUG 328 #ifndef NDEBUG
329 new_navigation_loader_(NULL), 329 new_navigation_loader_(NULL),
330 #endif 330 #endif
331 zoom_level_(0), 331 zoom_level_(0),
332 context_menu_allowed_(false), 332 context_menu_allowed_(false),
333 doing_drag_and_drop_(false), 333 doing_drag_and_drop_(false),
334 suppress_next_keypress_event_(false), 334 suppress_next_keypress_event_(false),
335 window_open_disposition_(IGNORE_ACTION), 335 window_open_disposition_(IGNORE_ACTION),
336 ime_accept_events_(true), 336 ime_accept_events_(true),
337 drag_target_dispatch_(false),
338 drag_identity_(0),
337 autocomplete_popup_showing_(false) { 339 autocomplete_popup_showing_(false) {
338 // WebKit/win/WebView.cpp does the same thing, except they call the 340 // WebKit/win/WebView.cpp does the same thing, except they call the
339 // KJS specific wrapper around this method. We need to have threading 341 // KJS specific wrapper around this method. We need to have threading
340 // initialized because CollatorICU requires it. 342 // initialized because CollatorICU requires it.
341 WTF::initializeThreading(); 343 WTF::initializeThreading();
342 344
343 // set to impossible point so we always get the first mouse pos 345 // set to impossible point so we always get the first mouse pos
344 last_mouse_position_.SetPoint(-1, -1); 346 last_mouse_position_.SetPoint(-1, -1);
345 347
346 // the page will take ownership of the various clients 348 // the page will take ownership of the various clients
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 page_->dragController()->dragEnded(); 1467 page_->dragController()->dragEnded();
1466 DCHECK(doing_drag_and_drop_); 1468 DCHECK(doing_drag_and_drop_);
1467 doing_drag_and_drop_ = false; 1469 doing_drag_and_drop_ = false;
1468 } 1470 }
1469 1471
1470 bool WebViewImpl::DragTargetDragEnter(const WebDropData& drop_data, 1472 bool WebViewImpl::DragTargetDragEnter(const WebDropData& drop_data,
1471 int client_x, int client_y, int screen_x, int screen_y) { 1473 int client_x, int client_y, int screen_x, int screen_y) {
1472 DCHECK(!current_drop_data_.get()); 1474 DCHECK(!current_drop_data_.get());
1473 1475
1474 current_drop_data_ = webkit_glue::WebDropDataToChromiumDataObject(drop_data); 1476 current_drop_data_ = webkit_glue::WebDropDataToChromiumDataObject(drop_data);
1477 drag_identity_ = drop_data.identity;
1475 1478
1476 DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y), 1479 DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y),
1477 IntPoint(screen_x, screen_y), kDropTargetOperation); 1480 IntPoint(screen_x, screen_y), kDropTargetOperation);
1481 drag_target_dispatch_ = true;
1478 DragOperation effect = page_->dragController()->dragEntered(&drag_data); 1482 DragOperation effect = page_->dragController()->dragEntered(&drag_data);
1483 drag_target_dispatch_ = false;
1484
1479 return effect != DragOperationNone; 1485 return effect != DragOperationNone;
1480 } 1486 }
1481 1487
1482 bool WebViewImpl::DragTargetDragOver( 1488 bool WebViewImpl::DragTargetDragOver(
1483 int client_x, int client_y, int screen_x, int screen_y) { 1489 int client_x, int client_y, int screen_x, int screen_y) {
1484 DCHECK(current_drop_data_.get()); 1490 DCHECK(current_drop_data_.get());
1491
1485 DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y), 1492 DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y),
1486 IntPoint(screen_x, screen_y), kDropTargetOperation); 1493 IntPoint(screen_x, screen_y), kDropTargetOperation);
1494 drag_target_dispatch_ = true;
1487 DragOperation effect = page_->dragController()->dragUpdated(&drag_data); 1495 DragOperation effect = page_->dragController()->dragUpdated(&drag_data);
1496 drag_target_dispatch_ = false;
1497
1488 return effect != DragOperationNone; 1498 return effect != DragOperationNone;
1489 } 1499 }
1490 1500
1491 void WebViewImpl::DragTargetDragLeave() { 1501 void WebViewImpl::DragTargetDragLeave() {
1492 DCHECK(current_drop_data_.get()); 1502 DCHECK(current_drop_data_.get());
1503
1493 DragData drag_data(current_drop_data_.get(), IntPoint(), IntPoint(), 1504 DragData drag_data(current_drop_data_.get(), IntPoint(), IntPoint(),
1494 DragOperationNone); 1505 DragOperationNone);
1506 drag_target_dispatch_ = true;
1495 page_->dragController()->dragExited(&drag_data); 1507 page_->dragController()->dragExited(&drag_data);
1508 drag_target_dispatch_ = false;
1509
1496 current_drop_data_ = NULL; 1510 current_drop_data_ = NULL;
1511 drag_identity_ = 0;
1497 } 1512 }
1498 1513
1499 void WebViewImpl::DragTargetDrop( 1514 void WebViewImpl::DragTargetDrop(
1500 int client_x, int client_y, int screen_x, int screen_y) { 1515 int client_x, int client_y, int screen_x, int screen_y) {
1501 DCHECK(current_drop_data_.get()); 1516 DCHECK(current_drop_data_.get());
1517
1502 DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y), 1518 DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y),
1503 IntPoint(screen_x, screen_y), kDropTargetOperation); 1519 IntPoint(screen_x, screen_y), kDropTargetOperation);
1520 drag_target_dispatch_ = true;
1504 page_->dragController()->performDrag(&drag_data); 1521 page_->dragController()->performDrag(&drag_data);
1522 drag_target_dispatch_ = false;
1523
1505 current_drop_data_ = NULL; 1524 current_drop_data_ = NULL;
1525 drag_identity_ = 0;
1526 }
1527
1528 int32 WebViewImpl::GetDragIdentity() {
1529 if (drag_target_dispatch_)
1530 return drag_identity_;
1531 return 0;
1506 } 1532 }
1507 1533
1508 SearchableFormData* WebViewImpl::CreateSearchableFormDataForFocusedNode() { 1534 SearchableFormData* WebViewImpl::CreateSearchableFormDataForFocusedNode() {
1509 if (!page_.get()) 1535 if (!page_.get())
1510 return NULL; 1536 return NULL;
1511 1537
1512 if (RefPtr<Frame> focused = page_->focusController()->focusedFrame()) { 1538 if (RefPtr<Frame> focused = page_->focusController()->focusedFrame()) {
1513 RefPtr<Document> document = focused->document(); 1539 RefPtr<Document> document = focused->document();
1514 if (document.get()) { 1540 if (document.get()) {
1515 RefPtr<Node> focused_node = document->focusedNode(); 1541 RefPtr<Node> focused_node = document->focusedNode();
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 Frame* frame = page_->focusController()->focusedFrame(); 1719 Frame* frame = page_->focusController()->focusedFrame();
1694 if (!frame) 1720 if (!frame)
1695 return NULL; 1721 return NULL;
1696 1722
1697 Document* document = frame->document(); 1723 Document* document = frame->document();
1698 if (!document) 1724 if (!document)
1699 return NULL; 1725 return NULL;
1700 1726
1701 return document->focusedNode(); 1727 return document->focusedNode();
1702 } 1728 }
OLDNEW
« no previous file with comments | « webkit/glue/webview_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698