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

Side by Side Diff: third_party/WebKit/Source/core/page/DragController.cpp

Issue 2171493003: [Editing][DOM][CodeHealth] Make Node::hasEditableStyle global functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Google Inc. 3 * Copyright (C) 2008 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(false); 417 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(false);
418 m_fileInputElementUnderMouse = nullptr; 418 m_fileInputElementUnderMouse = nullptr;
419 return false; 419 return false;
420 } 420 }
421 421
422 DragOperation DragController::operationForLoad(DragData* dragData) 422 DragOperation DragController::operationForLoad(DragData* dragData)
423 { 423 {
424 ASSERT(dragData); 424 ASSERT(dragData);
425 Document* doc = m_page->deprecatedLocalMainFrame()->documentAtPoint(dragData ->clientPosition()); 425 Document* doc = m_page->deprecatedLocalMainFrame()->documentAtPoint(dragData ->clientPosition());
426 426
427 if (doc && (m_didInitiateDrag || doc->isPluginDocument() || doc->hasEditable Style())) 427 if (doc && (m_didInitiateDrag || doc->isPluginDocument() || hasEditableStyle (*doc)))
428 return DragOperationNone; 428 return DragOperationNone;
429 return dragOperation(dragData); 429 return dragOperation(dragData);
430 } 430 }
431 431
432 static bool setSelectionToDragCaret(LocalFrame* frame, VisibleSelection& dragCar et, Range*& range, const IntPoint& point) 432 static bool setSelectionToDragCaret(LocalFrame* frame, VisibleSelection& dragCar et, Range*& range, const IntPoint& point)
433 { 433 {
434 frame->selection().setSelection(dragCaret); 434 frame->selection().setSelection(dragCaret);
435 if (frame->selection().isNone()) { 435 if (frame->selection().isNone()) {
436 dragCaret = VisibleSelection(frame->positionForPoint(point)); 436 dragCaret = VisibleSelection(frame->positionForPoint(point));
437 frame->selection().setSelection(dragCaret); 437 frame->selection().setSelection(dragCaret);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 HitTestResult result = m_page->deprecatedLocalMainFrame()->eventHandler().hi tTestResultAtPoint(point); 557 HitTestResult result = m_page->deprecatedLocalMainFrame()->eventHandler().hi tTestResultAtPoint(point);
558 558
559 if (!result.innerNode()) 559 if (!result.innerNode())
560 return false; 560 return false;
561 561
562 if (dragData->containsFiles() && asFileInput(result.innerNode())) 562 if (dragData->containsFiles() && asFileInput(result.innerNode()))
563 return true; 563 return true;
564 564
565 if (isHTMLPlugInElement(*result.innerNode())) { 565 if (isHTMLPlugInElement(*result.innerNode())) {
566 HTMLPlugInElement* plugin = toHTMLPlugInElement(result.innerNode()); 566 HTMLPlugInElement* plugin = toHTMLPlugInElement(result.innerNode());
567 if (!plugin->canProcessDrag() && !result.innerNode()->hasEditableStyle() ) 567 if (!plugin->canProcessDrag() && !hasEditableStyle(*result.innerNode()))
568 return false; 568 return false;
569 } else if (!result.innerNode()->hasEditableStyle()) { 569 } else if (!hasEditableStyle(*result.innerNode())) {
570 return false; 570 return false;
571 } 571 }
572 572
573 if (m_didInitiateDrag && m_documentUnderMouse == m_dragInitiator && result.i sSelected()) 573 if (m_didInitiateDrag && m_documentUnderMouse == m_dragInitiator && result.i sSelected())
574 return false; 574 return false;
575 575
576 return true; 576 return true;
577 } 577 }
578 578
579 static DragOperation defaultOperationForDrag(DragOperation srcOpMask) 579 static DragOperation defaultOperationForDrag(DragOperation srcOpMask)
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 996
997 DEFINE_TRACE(DragController) 997 DEFINE_TRACE(DragController)
998 { 998 {
999 visitor->trace(m_page); 999 visitor->trace(m_page);
1000 visitor->trace(m_documentUnderMouse); 1000 visitor->trace(m_documentUnderMouse);
1001 visitor->trace(m_dragInitiator); 1001 visitor->trace(m_dragInitiator);
1002 visitor->trace(m_fileInputElementUnderMouse); 1002 visitor->trace(m_fileInputElementUnderMouse);
1003 } 1003 }
1004 1004
1005 } // namespace blink 1005 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698