[GTK] Fix layering violations in PasteboardGtk
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Sep 2014 07:05:45 +0000 (07:05 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Sep 2014 07:05:45 +0000 (07:05 +0000)
commit75a21f7574b2974074929a3cd5c0d235e2a06f2a
treeee7a5c0ea5661a1cad5685f87fbc929338d4cc3e
parent3042d302804113a6809777584dec59e2d0a9ffc5
[GTK] Fix layering violations in PasteboardGtk
https://bugs.webkit.org/show_bug.cgi?id=136802

Reviewed by Darin Adler.

Source/WebCore:

Refactor the Pasteboard code moving the WebCore parts to the Editor.

* PlatformGTK.cmake: Add new file to compilation.
* editing/Editor.cpp:
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::copyImage):
* editing/Editor.h:
* editing/gtk/EditorGtk.cpp: Added.
(WebCore::createFragmentFromPasteBoardData):
(WebCore::Editor::pasteWithPasteboard):
(WebCore::getImageAndURLForElement):
(WebCore::Editor::writeImageToPasteboard):
(WebCore::Editor::writeSelectionToPasteboard):
* page/DragController.cpp:
(WebCore::DragController::startDrag):
* page/gtk/DragControllerGtk.cpp:
(WebCore::DragController::declareAndWriteDragImage):
* platform/Pasteboard.h:
* platform/gtk/DataObjectGtk.cpp: Remove range member, the caller
should call setText() + setMarkup() intead.
(WebCore::DataObjectGtk::setText):
(WebCore::DataObjectGtk::setMarkup):
(WebCore::DataObjectGtk::clearText):
(WebCore::DataObjectGtk::clearMarkup):
(WebCore::DataObjectGtk::clearAllExceptFilenames):
* platform/gtk/DataObjectGtk.h:
(WebCore::DataObjectGtk::hasText):
(WebCore::DataObjectGtk::hasMarkup):
(WebCore::DataObjectGtk::clearImage):
(WebCore::DataObjectGtk::text):
(WebCore::DataObjectGtk::markup):
(WebCore::DataObjectGtk::setRange): Deleted.
* platform/gtk/GtkDragAndDropHelper.h:
* platform/gtk/PasteboardGtk.cpp:
(WebCore::PasteboardImage::PasteboardImage):
(WebCore::PasteboardImage::~PasteboardImage):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::writeSelection): Deleted.
(WebCore::getURLForImageElement): Deleted.
(WebCore::Pasteboard::writeImage): Deleted.
(WebCore::Pasteboard::documentFragment): Deleted.
* platform/gtk/PasteboardHelper.cpp:
(WebCore::displayFromFrame): Deleted.
(WebCore::PasteboardHelper::getPrimarySelectionClipboard): Deleted.
* platform/gtk/PasteboardHelper.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::updateGlobalSelection): Use new API to
update the global selection.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/gtk/EditorGtk.cpp [new file with mode: 0644]
Source/WebCore/page/DragController.cpp
Source/WebCore/page/gtk/DragControllerGtk.cpp
Source/WebCore/platform/Pasteboard.h
Source/WebCore/platform/gtk/DataObjectGtk.cpp
Source/WebCore/platform/gtk/DataObjectGtk.h
Source/WebCore/platform/gtk/GtkDragAndDropHelper.h
Source/WebCore/platform/gtk/PasteboardGtk.cpp
Source/WebCore/platform/gtk/PasteboardHelper.cpp
Source/WebCore/platform/gtk/PasteboardHelper.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp