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

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

Issue 1307763003: Get rid of VisibleSelection constructor with Range parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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/editing/VisibleSelection.cpp ('k') | Source/web/WebLocalFrameImpl.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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 // which would be empty when asking the cached BitmapImages. 709 // which would be empty when asking the cached BitmapImages.
710 return (cachedImage && !cachedImage->errorOccurred()) ? 710 return (cachedImage && !cachedImage->errorOccurred()) ?
711 cachedImage->image() : nullptr; 711 cachedImage->image() : nullptr;
712 } 712 }
713 713
714 static void prepareDataTransferForImageDrag(LocalFrame* source, DataTransfer* da taTransfer, Element* node, const KURL& linkURL, const KURL& imageURL, const Stri ng& label) 714 static void prepareDataTransferForImageDrag(LocalFrame* source, DataTransfer* da taTransfer, Element* node, const KURL& linkURL, const KURL& imageURL, const Stri ng& label)
715 { 715 {
716 if (node->isContentRichlyEditable()) { 716 if (node->isContentRichlyEditable()) {
717 RefPtrWillBeRawPtr<Range> range = source->document()->createRange(); 717 RefPtrWillBeRawPtr<Range> range = source->document()->createRange();
718 range->selectNode(node, ASSERT_NO_EXCEPTION); 718 range->selectNode(node, ASSERT_NO_EXCEPTION);
719 source->selection().setSelection(VisibleSelection(range.get())); 719 source->selection().setSelection(VisibleSelection(EphemeralRange(range.g et())));
720 } 720 }
721 dataTransfer->declareAndWriteDragImage(node, !linkURL.isEmpty() ? linkURL : imageURL, label); 721 dataTransfer->declareAndWriteDragImage(node, !linkURL.isEmpty() ? linkURL : imageURL, label);
722 } 722 }
723 723
724 bool DragController::populateDragDataTransfer(LocalFrame* src, const DragState& state, const IntPoint& dragOrigin) 724 bool DragController::populateDragDataTransfer(LocalFrame* src, const DragState& state, const IntPoint& dragOrigin)
725 { 725 {
726 ASSERT(dragTypeIsValid(state.m_dragType)); 726 ASSERT(dragTypeIsValid(state.m_dragType));
727 ASSERT(src); 727 ASSERT(src);
728 if (!src->view() || !src->contentLayoutObject()) 728 if (!src->view() || !src->contentLayoutObject())
729 return false; 729 return false;
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 958
959 DEFINE_TRACE(DragController) 959 DEFINE_TRACE(DragController)
960 { 960 {
961 visitor->trace(m_page); 961 visitor->trace(m_page);
962 visitor->trace(m_documentUnderMouse); 962 visitor->trace(m_documentUnderMouse);
963 visitor->trace(m_dragInitiator); 963 visitor->trace(m_dragInitiator);
964 visitor->trace(m_fileInputElementUnderMouse); 964 visitor->trace(m_fileInputElementUnderMouse);
965 } 965 }
966 966
967 } // namespace blink 967 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/VisibleSelection.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698