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

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

Issue 18888002: Introduce isHTMLAnchorElement and toHTMLAnchorElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
« no previous file with comments | « Source/core/html/HTMLAnchorElement.h ('k') | Source/core/rendering/HitTestResult.cpp » ('j') | 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 (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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 } 636 }
637 if (dragMode == DRAG_AUTO) { 637 if (dragMode == DRAG_AUTO) {
638 if ((m_dragSourceAction & DragSourceActionImage) 638 if ((m_dragSourceAction & DragSourceActionImage)
639 && node->hasTagName(HTMLNames::imgTag) 639 && node->hasTagName(HTMLNames::imgTag)
640 && src->settings() 640 && src->settings()
641 && src->settings()->loadsImagesAutomatically()) { 641 && src->settings()->loadsImagesAutomatically()) {
642 state.m_dragType = static_cast<DragSourceAction>(state.m_dra gType | DragSourceActionImage); 642 state.m_dragType = static_cast<DragSourceAction>(state.m_dra gType | DragSourceActionImage);
643 return node; 643 return node;
644 } 644 }
645 if ((m_dragSourceAction & DragSourceActionLink) 645 if ((m_dragSourceAction & DragSourceActionLink)
646 && node->hasTagName(HTMLNames::aTag) 646 && isHTMLAnchorElement(node)
647 && static_cast<HTMLAnchorElement*>(node)->isLiveLink()) { 647 && toHTMLAnchorElement(node)->isLiveLink()) {
648 state.m_dragType = static_cast<DragSourceAction>(state.m_dra gType | DragSourceActionLink); 648 state.m_dragType = static_cast<DragSourceAction>(state.m_dra gType | DragSourceActionLink);
649 return node; 649 return node;
650 } 650 }
651 } 651 }
652 } 652 }
653 } 653 }
654 654
655 // We either have nothing to drag or we have a selection and we're not over a draggable element. 655 // We either have nothing to drag or we have a selection and we're not over a draggable element.
656 return (state.m_dragType & DragSourceActionSelection) ? startNode : 0; 656 return (state.m_dragType & DragSourceActionSelection) ? startNode : 0;
657 } 657 }
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 return false; 945 return false;
946 #endif 946 #endif
947 } 947 }
948 948
949 void DragController::cleanupAfterSystemDrag() 949 void DragController::cleanupAfterSystemDrag()
950 { 950 {
951 } 951 }
952 952
953 } // namespace WebCore 953 } // namespace WebCore
954 954
OLDNEW
« no previous file with comments | « Source/core/html/HTMLAnchorElement.h ('k') | Source/core/rendering/HitTestResult.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698