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

Side by Side Diff: third_party/WebKit/Source/core/clipboard/DataTransfer.h

Issue 2916043002: Move LocalFrame::DragImageForSelection DragController (Closed)
Patch Set: updated Created 3 years, 6 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) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 26 matching lines...) Expand all
37 37
38 namespace blink { 38 namespace blink {
39 39
40 class DataTransferItemList; 40 class DataTransferItemList;
41 class DragImage; 41 class DragImage;
42 class Element; 42 class Element;
43 class FileList; 43 class FileList;
44 class FrameSelection; 44 class FrameSelection;
45 class LocalFrame; 45 class LocalFrame;
46 class Node; 46 class Node;
47 class PaintRecordBuilder;
48 class PropertyTreeState;
47 49
48 // Used for drag and drop and copy/paste. 50 // Used for drag and drop and copy/paste.
49 // Drag and Drop: 51 // Drag and Drop:
50 // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html 52 // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html
51 // Clipboard API (copy/paste): 53 // Clipboard API (copy/paste):
52 // http://dev.w3.org/2006/webapi/clipops/clipops.html 54 // http://dev.w3.org/2006/webapi/clipops/clipops.html
53 class CORE_EXPORT DataTransfer final 55 class CORE_EXPORT DataTransfer final
54 : public GarbageCollectedFinalized<DataTransfer>, 56 : public GarbageCollectedFinalized<DataTransfer>,
55 public ScriptWrappable, 57 public ScriptWrappable,
56 public DataObject::Observer { 58 public DataObject::Observer {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 96
95 Vector<String> types(); 97 Vector<String> types();
96 FileList* files() const; 98 FileList* files() const;
97 99
98 IntPoint DragLocation() const { return drag_loc_; } 100 IntPoint DragLocation() const { return drag_loc_; }
99 void setDragImage(Element*, int x, int y); 101 void setDragImage(Element*, int x, int y);
100 void ClearDragImage(); 102 void ClearDragImage();
101 void SetDragImageResource(ImageResourceContent*, const IntPoint&); 103 void SetDragImageResource(ImageResourceContent*, const IntPoint&);
102 void SetDragImageElement(Node*, const IntPoint&); 104 void SetDragImageElement(Node*, const IntPoint&);
103 105
106 static std::unique_ptr<DragImage> NodeImage(const LocalFrame&, Node&);
Xiaocheng 2017/06/02 18:26:47 Please group all the static functions together.
104 std::unique_ptr<DragImage> CreateDragImage(IntPoint& drag_location, 107 std::unique_ptr<DragImage> CreateDragImage(IntPoint& drag_location,
105 LocalFrame*) const; 108 LocalFrame*) const;
106 void DeclareAndWriteDragImage(Element*, 109 void DeclareAndWriteDragImage(Element*,
107 const KURL& link_url, 110 const KURL& link_url,
108 const KURL& image_url, 111 const KURL& image_url,
109 const String& title); 112 const String& title);
110 void WriteURL(Node*, const KURL&, const String&); 113 void WriteURL(Node*, const KURL&, const String&);
111 void WriteSelection(const FrameSelection&); 114 void WriteSelection(const FrameSelection&);
112 115
113 void SetAccessPolicy(DataTransferAccessPolicy); 116 void SetAccessPolicy(DataTransferAccessPolicy);
(...skipping 11 matching lines...) Expand all
125 DragOperation DestinationOperation() const; 128 DragOperation DestinationOperation() const;
126 void SetSourceOperation(DragOperation); 129 void SetSourceOperation(DragOperation);
127 void SetDestinationOperation(DragOperation); 130 void SetDestinationOperation(DragOperation);
128 131
129 bool HasDropZoneType(const String&); 132 bool HasDropZoneType(const String&);
130 133
131 DataTransferItemList* items(); 134 DataTransferItemList* items();
132 135
133 DataObject* GetDataObject() const; 136 DataObject* GetDataObject() const;
134 137
138 static FloatRect DeviceSpaceBounds(const FloatRect, const LocalFrame&);
139 static std::unique_ptr<DragImage> CreateDragImage(const LocalFrame&,
140 float,
141 RespectImageOrientationEnum,
142 const FloatRect&,
143 PaintRecordBuilder&,
144 const PropertyTreeState&);
145
135 DECLARE_TRACE(); 146 DECLARE_TRACE();
136 147
137 private: 148 private:
138 DataTransfer(DataTransferType, DataTransferAccessPolicy, DataObject*); 149 DataTransfer(DataTransferType, DataTransferAccessPolicy, DataObject*);
139 150
140 void setDragImage(ImageResourceContent*, Node*, const IntPoint&); 151 void setDragImage(ImageResourceContent*, Node*, const IntPoint&);
141 152
142 bool HasFileOfType(const String&) const; 153 bool HasFileOfType(const String&) const;
143 bool HasStringOfType(const String&) const; 154 bool HasStringOfType(const String&) const;
144 155
(...skipping 15 matching lines...) Expand all
160 Member<Node> drag_image_element_; 171 Member<Node> drag_image_element_;
161 }; 172 };
162 173
163 DragOperation ConvertDropZoneOperationToDragOperation( 174 DragOperation ConvertDropZoneOperationToDragOperation(
164 const String& drag_operation); 175 const String& drag_operation);
165 String ConvertDragOperationToDropZoneOperation(DragOperation); 176 String ConvertDragOperationToDropZoneOperation(DragOperation);
166 177
167 } // namespace blink 178 } // namespace blink
168 179
169 #endif // DataTransfer_h 180 #endif // DataTransfer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698