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

Side by Side Diff: Source/core/dom/Clipboard.h

Issue 16715002: Refactor WebCore::DragImage. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: merge upstream changes, some changes per jamesr Created 7 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/loader/EmptyClients.h » ('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) 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 13 matching lines...) Expand all
24 #ifndef Clipboard_h 24 #ifndef Clipboard_h
25 #define Clipboard_h 25 #define Clipboard_h
26 26
27 #include "bindings/v8/ScriptWrappable.h" 27 #include "bindings/v8/ScriptWrappable.h"
28 #include "core/dom/ClipboardAccessPolicy.h" 28 #include "core/dom/ClipboardAccessPolicy.h"
29 #include "core/dom/Node.h" 29 #include "core/dom/Node.h"
30 #include "core/loader/cache/CachedResourceHandle.h" 30 #include "core/loader/cache/CachedResourceHandle.h"
31 #include "core/page/DragActions.h" 31 #include "core/page/DragActions.h"
32 #include "core/platform/DragImage.h" 32 #include "core/platform/DragImage.h"
33 #include "core/platform/graphics/IntPoint.h" 33 #include "core/platform/graphics/IntPoint.h"
34 #include "wtf/Forward.h"
34 35
35 namespace WebCore { 36 namespace WebCore {
36 37
38 class CachedImage;
37 class DataTransferItemList; 39 class DataTransferItemList;
38 class DragData; 40 class DragData;
41 class DragImage;
39 class FileList; 42 class FileList;
40 class Frame; 43 class Frame;
44 class Range;
41 45
42 // State available during IE's events for drag and drop and copy/paste 46 // State available during IE's events for drag and drop and copy/paste
43 class Clipboard : public RefCounted<Clipboard>, public ScriptWrappable { 47 class Clipboard : public RefCounted<Clipboard>, public ScriptWrappable {
44 public: 48 public:
45 // Whether this clipboard is serving a drag-drop or copy-paste request. 49 // Whether this clipboard is serving a drag-drop or copy-paste request.
46 enum ClipboardType { 50 enum ClipboardType {
47 CopyAndPaste, 51 CopyAndPaste,
48 DragAndDrop, 52 DragAndDrop,
49 }; 53 };
50 54
(...skipping 18 matching lines...) Expand all
69 // extensions beyond IE's API 73 // extensions beyond IE's API
70 virtual ListHashSet<String> types() const = 0; 74 virtual ListHashSet<String> types() const = 0;
71 virtual PassRefPtr<FileList> files() const = 0; 75 virtual PassRefPtr<FileList> files() const = 0;
72 76
73 IntPoint dragLocation() const { return m_dragLoc; } 77 IntPoint dragLocation() const { return m_dragLoc; }
74 CachedImage* dragImage() const { return m_dragImage.get(); } 78 CachedImage* dragImage() const { return m_dragImage.get(); }
75 virtual void setDragImage(CachedImage*, const IntPoint&) = 0; 79 virtual void setDragImage(CachedImage*, const IntPoint&) = 0;
76 Node* dragImageElement() const { return m_dragImageElement.get(); } 80 Node* dragImageElement() const { return m_dragImageElement.get(); }
77 virtual void setDragImageElement(Node*, const IntPoint&) = 0; 81 virtual void setDragImageElement(Node*, const IntPoint&) = 0;
78 82
79 virtual DragImageRef createDragImage(IntPoint& dragLocation) const = 0; 83 virtual PassOwnPtr<DragImage> createDragImage(IntPoint& dragLocation) const = 0;
80 virtual void declareAndWriteDragImage(Element*, const KURL&, const String& t itle, Frame*) = 0; 84 virtual void declareAndWriteDragImage(Element*, const KURL&, const String& t itle, Frame*) = 0;
81 virtual void writeURL(const KURL&, const String&, Frame*) = 0; 85 virtual void writeURL(const KURL&, const String&, Frame*) = 0;
82 virtual void writeRange(Range*, Frame*) = 0; 86 virtual void writeRange(Range*, Frame*) = 0;
83 virtual void writePlainText(const String&) = 0; 87 virtual void writePlainText(const String&) = 0;
84 88
85 virtual bool hasData() = 0; 89 virtual bool hasData() = 0;
86 90
87 void setAccessPolicy(ClipboardAccessPolicy); 91 void setAccessPolicy(ClipboardAccessPolicy);
88 bool canReadTypes() const; 92 bool canReadTypes() const;
89 bool canReadData() const; 93 bool canReadData() const;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 CachedResourceHandle<CachedImage> m_dragImage; 130 CachedResourceHandle<CachedImage> m_dragImage;
127 RefPtr<Node> m_dragImageElement; 131 RefPtr<Node> m_dragImageElement;
128 }; 132 };
129 133
130 DragOperation convertDropZoneOperationToDragOperation(const String& dragOperatio n); 134 DragOperation convertDropZoneOperationToDragOperation(const String& dragOperatio n);
131 String convertDragOperationToDropZoneOperation(DragOperation); 135 String convertDragOperationToDropZoneOperation(DragOperation);
132 136
133 } // namespace WebCore 137 } // namespace WebCore
134 138
135 #endif // Clipboard_h 139 #endif // Clipboard_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698