Changeset 87978 in webkit
- Timestamp:
- Jun 2, 2011 6:05:56 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
- Property svn:executable deleted
r87964 r87978 1 2011-05-28 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Gustavo Noronha Silva. 4 5 [GTK] Remove PasteboardHelperGtk 6 https://bugs.webkit.org/show_bug.cgi?id=61690 7 8 Remove the virtual methods from PasteboardHelper, so that PasteboardHelperGtk 9 can be removed. Since the GtkClipboard IDs are verified to be the same between 10 WebKit and WebCore we no longer need to communicate from WebCore to WebKit to 11 get them. 12 13 No new tests. This is just a code refactor. 14 15 * platform/Pasteboard.h: Remove GTK+ specific methods. They are no longer needed. 16 * platform/gtk/ClipboardGtk.cpp: Remove the m_helper member and access the 17 PasteboardHelper singleton directly. 18 * platform/gtk/ClipboardGtk.h: Ditto. 19 * platform/gtk/PasteboardGtk.cpp: Ditto. 20 * platform/gtk/PasteboardHelper.cpp: 21 (WebCore::removeMarkupPrefix): Remove an extra line. 22 (WebCore::PasteboardHelper::defaultPasteboardHelper): Added this static getter 23 for the singleton. 24 (WebCore::PasteboardHelper::PasteboardHelper): Moved the contents of initTargetList here. 25 (WebCore::PasteboardHelper::getCurrentClipboard): Instead of talking with WebKit to determine 26 whether or not to use the primary selection clipboard, just use our new member. 27 (WebCore::PasteboardHelper::fillSelectionData): Use our local enum to get the ID. 28 (WebCore::PasteboardHelper::targetListForDataObject): Ditto. 29 (WebCore::PasteboardHelper::dropAtomsForContext): Ditto. 30 (WebCore::getClipboardContentsCallback): Ditto. 31 * platform/gtk/PasteboardHelper.h: PasteboardHelper now keeps track of whether or 32 not to use the primary selection clipboard internally. 33 (WebCore::PasteboardHelper::setUsePrimarySelectionClipboard): Added. 34 (WebCore::PasteboardHelper::usePrimarySelectionClipboard): Added. 35 1 36 2011-06-02 Levi Weintraub <leviw@chromium.org> 2 37 -
trunk/Source/WebCore/platform/Pasteboard.h
r79494 r87978 114 114 115 115 #if PLATFORM(GTK) 116 void setHelper(PasteboardHelper*);117 PasteboardHelper* helper();118 116 ~Pasteboard(); 119 117 #endif … … 140 138 PasteboardPrivate p; 141 139 #endif 142 143 #if PLATFORM(GTK)144 PasteboardHelper* m_helper;145 #endif146 140 }; 147 141 -
trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp
r79249 r87978 61 61 , m_dataObject(DataObjectGtk::forClipboard(clipboard)) 62 62 , m_clipboard(clipboard) 63 , m_helper(Pasteboard::generalPasteboard()->helper())64 63 , m_frame(frame) 65 64 { … … 70 69 , m_dataObject(dataObject) 71 70 , m_clipboard(0) 72 , m_helper(Pasteboard::generalPasteboard()->helper())73 71 , m_frame(frame) 74 72 { … … 125 123 126 124 if (m_clipboard) 127 m_helper->writeClipboardContents(m_clipboard);125 PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(m_clipboard); 128 126 } 129 127 … … 137 135 138 136 if (m_clipboard) 139 m_helper->writeClipboardContents(m_clipboard);137 PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(m_clipboard); 140 138 } 141 139 … … 151 149 152 150 if (m_clipboard) 153 m_helper->getClipboardContents(m_clipboard);151 PasteboardHelper::defaultPasteboardHelper()->getClipboardContents(m_clipboard); 154 152 155 153 ClipboardDataType type = dataObjectTypeFromHTMLClipboardType(typeString); … … 185 183 186 184 if (success && m_clipboard) 187 m_helper->writeClipboardContents(m_clipboard);185 PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(m_clipboard); 188 186 189 187 return success; … … 196 194 197 195 if (m_clipboard) 198 m_helper->getClipboardContents(m_clipboard);196 PasteboardHelper::defaultPasteboardHelper()->getClipboardContents(m_clipboard); 199 197 200 198 HashSet<String> types; … … 225 223 226 224 if (m_clipboard) 227 m_helper->getClipboardContents(m_clipboard);225 PasteboardHelper::defaultPasteboardHelper()->getClipboardContents(m_clipboard); 228 226 229 227 RefPtr<FileList> fileList = FileList::create(); … … 303 301 m_dataObject->setURL(url, label); 304 302 if (m_clipboard) 305 m_helper->writeClipboardContents(m_clipboard);303 PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(m_clipboard); 306 304 } 307 305 … … 314 312 315 313 if (m_clipboard) 316 m_helper->writeClipboardContents(m_clipboard);314 PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(m_clipboard); 317 315 } 318 316 … … 322 320 323 321 if (m_clipboard) 324 m_helper->writeClipboardContents(m_clipboard);322 PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(m_clipboard); 325 323 } 326 324 … … 328 326 { 329 327 if (m_clipboard) 330 m_helper->getClipboardContents(m_clipboard);328 PasteboardHelper::defaultPasteboardHelper()->getClipboardContents(m_clipboard); 331 329 332 330 return m_dataObject->hasText() || m_dataObject->hasMarkup() -
trunk/Source/WebCore/platform/gtk/ClipboardGtk.h
r76248 r87978 75 75 virtual bool hasData(); 76 76 77 PasteboardHelper* helper() { return m_helper; }78 77 PassRefPtr<DataObjectGtk> dataObject() { return m_dataObject; } 79 78 … … 84 83 RefPtr<DataObjectGtk> m_dataObject; 85 84 GtkClipboard* m_clipboard; 86 PasteboardHelper* m_helper;87 85 Frame* m_frame; 88 86 }; -
trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp
r87709 r87978 53 53 Pasteboard::Pasteboard() 54 54 { 55 notImplemented();56 }57 58 Pasteboard::~Pasteboard()59 {60 delete m_helper;61 }62 63 PasteboardHelper* Pasteboard::helper()64 {65 return m_helper;66 }67 68 void Pasteboard::setHelper(PasteboardHelper* helper)69 {70 m_helper = helper;71 55 } 72 56 73 57 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame) 74 58 { 75 GtkClipboard* clipboard = m_helper->getClipboard(frame); 59 PasteboardHelper* helper = PasteboardHelper::defaultPasteboardHelper(); 60 GtkClipboard* clipboard = helper->getClipboard(frame); 76 61 DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); 77 62 dataObject->setText(frame->editor()->selectedText()); 78 63 dataObject->setMarkup(createMarkup(selectedRange, 0, AnnotateForInterchange, false, AbsoluteURLs)); 79 m_helper->writeClipboardContents(clipboard);64 helper->writeClipboardContents(clipboard); 80 65 } 81 66 … … 85 70 DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); 86 71 dataObject->setText(text); 87 m_helper->writeClipboardContents(clipboard);72 PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(clipboard); 88 73 } 89 74 … … 93 78 return; 94 79 95 GtkClipboard* clipboard = m_helper->getClipboard(frame); 80 PasteboardHelper* helper = PasteboardHelper::defaultPasteboardHelper(); 81 GtkClipboard* clipboard = helper->getClipboard(frame); 96 82 DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); 97 83 dataObject->setURL(url, label); 98 m_helper->writeClipboardContents(clipboard);84 helper->writeClipboardContents(clipboard); 99 85 } 100 86 … … 147 133 dataObject->setImage(pixbuf.get()); 148 134 149 m_helper->writeClipboardContents(clipboard);135 PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(clipboard); 150 136 } 151 137 … … 164 150 bool allowPlainText, bool& chosePlainText) 165 151 { 166 GtkClipboard* clipboard = m_helper->getCurrentClipboard(frame); 152 PasteboardHelper* helper = PasteboardHelper::defaultPasteboardHelper(); 153 GtkClipboard* clipboard = helper->getCurrentClipboard(frame); 167 154 DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); 168 m_helper->getClipboardContents(clipboard);155 helper->getClipboardContents(clipboard); 169 156 170 157 chosePlainText = false; … … 191 178 String Pasteboard::plainText(Frame* frame) 192 179 { 193 GtkClipboard* clipboard = m_helper->getCurrentClipboard(frame); 180 PasteboardHelper* helper = PasteboardHelper::defaultPasteboardHelper(); 181 GtkClipboard* clipboard = helper->getCurrentClipboard(frame); 194 182 DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); 195 183 196 m_helper->getClipboardContents(clipboard);184 helper->getClipboardContents(clipboard); 197 185 return dataObject->text(); 198 186 } -
trunk/Source/WebCore/platform/gtk/PasteboardHelper.cpp
r86330 r87978 43 43 static void removeMarkupPrefix(String& markup) 44 44 { 45 46 45 // The markup prefix is not harmful, but we remove it from the string anyway, so that 47 46 // we can have consistent results with other ports during the layout tests. … … 66 65 } 67 66 67 PasteboardHelper* PasteboardHelper::defaultPasteboardHelper() 68 { 69 DEFINE_STATIC_LOCAL(PasteboardHelper, defaultHelper, ()); 70 return &defaultHelper; 71 } 72 68 73 PasteboardHelper::PasteboardHelper() 69 74 : m_targetList(gtk_target_list_new(0, 0)) 75 , m_usePrimarySelectionClipboard(false) 70 76 { 71 77 initGdkAtoms(); 78 79 gtk_target_list_add_text_targets(m_targetList, PasteboardHelper::TargetTypeText); 80 gtk_target_list_add(m_targetList, markupAtom, 0, PasteboardHelper::TargetTypeMarkup); 81 gtk_target_list_add_uri_targets(m_targetList, PasteboardHelper::TargetTypeURIList); 82 gtk_target_list_add(m_targetList, netscapeURLAtom, 0, PasteboardHelper::TargetTypeNetscapeURL); 83 gtk_target_list_add_image_targets(m_targetList, PasteboardHelper::TargetTypeImage, TRUE); 72 84 } 73 85 … … 75 87 { 76 88 gtk_target_list_unref(m_targetList); 77 }78 79 void PasteboardHelper::initializeTargetList()80 {81 gtk_target_list_add_text_targets(m_targetList, getIdForTargetType(TargetTypeText));82 gtk_target_list_add(m_targetList, markupAtom, 0, getIdForTargetType(TargetTypeMarkup));83 gtk_target_list_add_uri_targets(m_targetList, getIdForTargetType(TargetTypeURIList));84 gtk_target_list_add(m_targetList, netscapeURLAtom, 0, getIdForTargetType(TargetTypeNetscapeURL));85 gtk_target_list_add_image_targets(m_targetList, getIdForTargetType(TargetTypeImage), TRUE);86 89 } 87 90 … … 100 103 GtkClipboard* PasteboardHelper::getCurrentClipboard(Frame* frame) 101 104 { 102 if ( usePrimarySelectionClipboard(widgetFromFrame(frame)))105 if (m_usePrimarySelectionClipboard) 103 106 return getPrimarySelectionClipboard(frame); 104 107 return getClipboard(frame); … … 157 160 void PasteboardHelper::fillSelectionData(GtkSelectionData* selectionData, guint info, DataObjectGtk* dataObject) 158 161 { 159 if (info == getIdForTargetType(TargetTypeText))162 if (info == TargetTypeText) 160 163 gtk_selection_data_set_text(selectionData, dataObject->text().utf8().data(), -1); 161 164 162 else if (info == getIdForTargetType(TargetTypeMarkup)) {165 else if (info == TargetTypeMarkup) { 163 166 // Some Linux applications refuse to accept pasted markup unless it is 164 167 // prefixed by a content-type meta tag. … … 167 170 reinterpret_cast<const guchar*>(markup.data()), markup.length() + 1); 168 171 169 } else if (info == getIdForTargetType(TargetTypeURIList)) {172 } else if (info == TargetTypeURIList) { 170 173 CString uriList = dataObject->uriList().utf8(); 171 174 gtk_selection_data_set(selectionData, uriListAtom, 8, 172 175 reinterpret_cast<const guchar*>(uriList.data()), uriList.length() + 1); 173 176 174 } else if (info == getIdForTargetType(TargetTypeNetscapeURL)&& dataObject->hasURL()) {177 } else if (info == TargetTypeNetscapeURL && dataObject->hasURL()) { 175 178 String url(dataObject->url()); 176 179 String result(url); … … 186 189 reinterpret_cast<const guchar*>(resultData.get()), strlen(resultData.get()) + 1); 187 190 188 } else if (info == getIdForTargetType(TargetTypeImage))191 } else if (info == TargetTypeImage) 189 192 gtk_selection_data_set_pixbuf(selectionData, dataObject->image()); 190 193 } … … 195 198 196 199 if (dataObject->hasText()) 197 gtk_target_list_add_text_targets(list, getIdForTargetType(TargetTypeText));200 gtk_target_list_add_text_targets(list, TargetTypeText); 198 201 199 202 if (dataObject->hasMarkup()) 200 gtk_target_list_add(list, markupAtom, 0, getIdForTargetType(TargetTypeMarkup));203 gtk_target_list_add(list, markupAtom, 0, TargetTypeMarkup); 201 204 202 205 if (dataObject->hasURIList()) { 203 gtk_target_list_add_uri_targets(list, getIdForTargetType(TargetTypeURIList));204 gtk_target_list_add(list, netscapeURLAtom, 0, getIdForTargetType(TargetTypeNetscapeURL));206 gtk_target_list_add_uri_targets(list, TargetTypeURIList); 207 gtk_target_list_add(list, netscapeURLAtom, 0, TargetTypeNetscapeURL); 205 208 } 206 209 207 210 if (dataObject->hasImage()) 208 gtk_target_list_add_image_targets(list, getIdForTargetType(TargetTypeImage), TRUE);211 gtk_target_list_add_image_targets(list, TargetTypeImage, TRUE); 209 212 210 213 return list; … … 250 253 // For images, try to find the most applicable image type. 251 254 GRefPtr<GtkTargetList> list(gtk_target_list_new(0, 0)); 252 gtk_target_list_add_image_targets(list.get(), getIdForTargetType(TargetTypeImage), TRUE);255 gtk_target_list_add_image_targets(list.get(), TargetTypeImage, TRUE); 253 256 GdkAtom atom = gtk_drag_dest_find_target(widget, context, list.get()); 254 257 if (atom != GDK_NONE) … … 264 267 DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); 265 268 ASSERT(dataObject); 266 Pasteboard ::generalPasteboard()->helper()->fillSelectionData(selectionData, info, dataObject);269 PasteboardHelper::defaultPasteboardHelper()->fillSelectionData(selectionData, info, dataObject); 267 270 } 268 271 -
trunk/Source/WebCore/platform/gtk/PasteboardHelper.h
r66531 r87978 26 26 #define PasteboardHelper_h 27 27 28 /*29 * FIXME: this is for WebCore support and must be removed once30 * a better solution is found31 */32 33 28 #include "Frame.h" 34 29 … … 41 36 PasteboardHelper(); 42 37 virtual ~PasteboardHelper(); 38 static PasteboardHelper* defaultPasteboardHelper(); 39 40 void setUsePrimarySelectionClipboard(bool usePrimary) { m_usePrimarySelectionClipboard = usePrimary; } 41 bool usePrimarySelectionClipboard() { return m_usePrimarySelectionClipboard; } 43 42 44 43 GtkClipboard* getCurrentClipboard(Frame*); … … 53 52 void getClipboardContents(GtkClipboard*); 54 53 55 enum PasteboardTargetType { TargetTypeText, TargetTypeMarkup, TargetTypeURIList, TargetTypeNetscapeURL, TargetTypeImage, TargetTypeUnknown }; 56 virtual guint getIdForTargetType(PasteboardTargetType) = 0; 57 58 protected: 59 void initializeTargetList(); 60 virtual bool usePrimarySelectionClipboard(GtkWidget*) = 0; 54 enum PasteboardTargetType { TargetTypeMarkup, TargetTypeText, TargetTypeImage, TargetTypeURIList, TargetTypeNetscapeURL, TargetTypeUnknown }; 61 55 62 56 private: 63 57 GtkTargetList* m_targetList; 58 bool m_usePrimarySelectionClipboard; 64 59 }; 65 60 -
trunk/Source/WebKit/gtk/ChangeLog
r87925 r87978 1 2011-05-28 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Gustavo Noronha Silva. 4 5 [GTK] Remove PastboardHelperGtk 6 https://bugs.webkit.org/show_bug.cgi?id=61690 7 8 Remove PasteboardHelperGtk and talk directly to WebCore for pasteboard 9 activity. This change moves the PasteboardHelper singleton from WebKit 10 to WebCore. 11 12 * GNUmakefile.am: Remove PasteboardHelperGtk from the source list. 13 * WebCoreSupport/AssertMatchingEnums.cpp: Added assertions verifying that the 14 WebCore versions of the GtkClipboard enums match those in the WebKit API. 15 * WebCoreSupport/DragClientGtk.cpp: 16 (WebKit::DragClient::startDrag): Access the pasteboard helper via a static method. 17 * WebCoreSupport/EditorClientGtk.cpp: 18 (WebKit::setSelectionPrimaryClipboardIfNeeded): Ditto. Call into the helper to specify 19 that the current clipboard is selection primary now. 20 * WebCoreSupport/PasteboardHelperGtk.cpp: Removed. 21 * webkit/webkitglobals.cpp: Remove function to set and get the pasteboard helper. 22 * webkit/webkitglobalsprivate.h: Ditto. 23 * webkit/webkitwebview.cpp: 24 (webkit_web_view_button_press_event): Access the pasteboard helper via a static method. 25 (webkit_web_view_drag_data_get): Ditto. 26 (webkit_web_view_drag_motion): Ditto. 27 (webkit_web_view_drag_data_received): Ditto. 28 (webkit_web_view_init): Ditto. 29 (webkit_web_view_get_copy_target_list): Ditto. 30 (webkit_web_view_get_paste_target_list): Ditto. 31 * webkit/webkitwebviewprivate.h: Ditto. 32 1 33 2011-06-02 Joone Hur <joone.hur@collabora.co.uk> 2 34 -
trunk/Source/WebKit/gtk/GNUmakefile.am
r87741 r87978 197 197 Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \ 198 198 Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \ 199 Source/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \200 Source/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \201 199 Source/WebKit/gtk/webkit/webkitapplicationcache.cpp \ 202 200 Source/WebKit/gtk/webkit/webkitdownload.cpp \ -
trunk/Source/WebKit/gtk/WebCoreSupport/AssertMatchingEnums.cpp
r78749 r87978 26 26 #include "FindOptions.h" 27 27 #include "FrameLoaderTypes.h" 28 #include "PasteboardHelper.h" 28 29 #include "webkitwebnavigationaction.h" 29 30 #include "webkitwebsettings.h" 31 #include "webkitwebview.h" 30 32 #include <wtf/Assertions.h> 31 33 … … 49 51 COMPILE_ASSERT_MATCHING_ENUM(WebKit::WebFindOptionsWrapAround, WrapAround); 50 52 COMPILE_ASSERT_MATCHING_ENUM(WebKit::WebFindOptionsStartInSelection, StartInSelection); 53 54 COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_WEB_VIEW_TARGET_INFO_HTML, PasteboardHelper::TargetTypeMarkup); 55 COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_WEB_VIEW_TARGET_INFO_TEXT, PasteboardHelper::TargetTypeText); 56 COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_WEB_VIEW_TARGET_INFO_IMAGE, PasteboardHelper::TargetTypeImage); 57 COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_WEB_VIEW_TARGET_INFO_URI_LIST, PasteboardHelper::TargetTypeURIList); 58 COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_WEB_VIEW_TARGET_INFO_NETSCAPE_URL, PasteboardHelper::TargetTypeNetscapeURL); -
trunk/Source/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
r85214 r87978 104 104 WebKitWebView* webView = webkit_web_frame_get_web_view(kit(frame)); 105 105 RefPtr<DataObjectGtk> dataObject = clipboardGtk->dataObject(); 106 GRefPtr<GtkTargetList> targetList( clipboardGtk->helper()->targetListForDataObject(dataObject.get()));106 GRefPtr<GtkTargetList> targetList(PasteboardHelper::defaultPasteboardHelper()->targetListForDataObject(dataObject.get())); 107 107 GOwnPtr<GdkEvent> currentEvent(gtk_get_current_event()); 108 108 -
trunk/Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
r86436 r87978 37 37 #include "NotImplemented.h" 38 38 #include "Page.h" 39 #include "PasteboardHelper Gtk.h"39 #include "PasteboardHelper.h" 40 40 #include "PlatformKeyboardEvent.h" 41 41 #include "WebKitDOMBinding.h" … … 296 296 GClosure* callback = g_cclosure_new_object(G_CALLBACK(collapseSelection), G_OBJECT(webView)); 297 297 g_closure_set_marshal(callback, g_cclosure_marshal_VOID__VOID); 298 pasteboardHelperInstance()->writeClipboardContents(clipboard, callback);298 PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(clipboard, callback); 299 299 viewSettingClipboard = 0; 300 300 } -
trunk/Source/WebKit/gtk/webkit/webkitglobals.cpp
r85868 r87978 274 274 PageGroup::setShouldTrackVisitedLinks(true); 275 275 276 Pasteboard::generalPasteboard()->setHelper(WebKit::pasteboardHelperInstance());277 276 GOwnPtr<gchar> iconDatabasePath(g_build_filename(g_get_user_data_dir(), "webkit", "icondatabase", NULL)); 278 277 webkit_icon_database_set_path(webkit_get_icon_database(), iconDatabasePath.get()); … … 294 293 namespace WebKit { 295 294 296 PasteboardHelperGtk* pasteboardHelperInstance()297 {298 static PasteboardHelperGtk* helper = new PasteboardHelperGtk();299 return helper;300 }301 302 295 } /** end namespace WebKit */ 303 296 -
trunk/Source/WebKit/gtk/webkit/webkitglobalsprivate.h
r80561 r87978 29 29 #define WEBKIT_PARAM_READWRITE ((GParamFlags)(G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB)) 30 30 31 namespace WebKit {32 33 class PasteboardHelperGtk;34 PasteboardHelperGtk* pasteboardHelperInstance();35 36 }37 38 31 extern "C" { 39 32 -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r87925 r87978 70 70 #include "Pasteboard.h" 71 71 #include "PasteboardHelper.h" 72 #include "PasteboardHelperGtk.h"73 72 #include "PlatformKeyboardEvent.h" 74 73 #include "PlatformWheelEvent.h" … … 141 140 */ 142 141 142 using namespace WebKit; 143 using namespace WebCore; 144 143 145 static const double defaultDPI = 96.0; 144 146 static IntPoint globalPointForClientPoint(GdkWindow* window, const IntPoint& clientPoint); 145 146 using namespace WebKit;147 using namespace WebCore;148 147 149 148 enum { … … 783 782 /* Copy selection to the X11 selection clipboard */ 784 783 if (event->button == 2) { 785 bool primary = webView->priv->usePrimaryForPaste; 786 webView->priv->usePrimaryForPaste = true; 784 PasteboardHelper* helper = PasteboardHelper::defaultPasteboardHelper(); 785 bool wasUsingPrimary = helper->usePrimarySelectionClipboard(); 786 helper->setUsePrimarySelectionClipboard(true); 787 787 788 788 Editor* editor = webView->priv->corePage->focusController()->focusedOrMainFrame()->editor(); … … 790 790 editor->paste(); 791 791 792 webView->priv->usePrimaryForPaste = primary;792 helper->setUsePrimarySelectionClipboard(wasUsingPrimary); 793 793 } 794 794 #endif … … 1499 1499 return; 1500 1500 1501 pasteboardHelperInstance()->fillSelectionData(selectionData, info, priv->draggingDataObjects.get(context).get());1501 PasteboardHelper::defaultPasteboardHelper()->fillSelectionData(selectionData, info, priv->draggingDataObjects.get(context).get()); 1502 1502 } 1503 1503 … … 1559 1559 priv->droppingContexts.set(context, droppingContext); 1560 1560 1561 Vector<GdkAtom> acceptableTargets( pasteboardHelperInstance()->dropAtomsForContext(widget, context));1561 Vector<GdkAtom> acceptableTargets(PasteboardHelper::defaultPasteboardHelper()->dropAtomsForContext(widget, context)); 1562 1562 droppingContext->pendingDataRequests = acceptableTargets.size(); 1563 1563 for (size_t i = 0; i < acceptableTargets.size(); i++) … … 1592 1592 DroppingContext* droppingContext = priv->droppingContexts.get(context); 1593 1593 droppingContext->pendingDataRequests--; 1594 pasteboardHelperInstance()->fillDataObjectFromDropData(selectionData, info, droppingContext->dataObject.get());1594 PasteboardHelper::defaultPasteboardHelper()->fillDataObjectFromDropData(selectionData, info, droppingContext->dataObject.get()); 1595 1595 1596 1596 if (droppingContext->pendingDataRequests) … … 3492 3492 3493 3493 gtk_drag_dest_set(GTK_WIDGET(webView), static_cast<GtkDestDefaults>(0), 0, 0, static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_PRIVATE)); 3494 gtk_drag_dest_set_target_list(GTK_WIDGET(webView), pasteboardHelperInstance()->targetList());3494 gtk_drag_dest_set_target_list(GTK_WIDGET(webView), PasteboardHelper::defaultPasteboardHelper()->targetList()); 3495 3495 } 3496 3496 … … 3535 3535 if (webkit_download_get_destination_uri(download)) 3536 3536 webkit_download_start(download); 3537 }3538 3539 bool webkit_web_view_use_primary_for_paste(WebKitWebView* webView)3540 {3541 return webView->priv->usePrimaryForPaste;3542 3537 } 3543 3538 … … 4325 4320 GtkTargetList* webkit_web_view_get_copy_target_list(WebKitWebView* webView) 4326 4321 { 4327 return pasteboardHelperInstance()->targetList();4322 return PasteboardHelper::defaultPasteboardHelper()->targetList(); 4328 4323 } 4329 4324 … … 4342 4337 GtkTargetList* webkit_web_view_get_paste_target_list(WebKitWebView* webView) 4343 4338 { 4344 return pasteboardHelperInstance()->targetList();4339 return PasteboardHelper::defaultPasteboardHelper()->targetList(); 4345 4340 } 4346 4341 -
trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h
r86102 r87978 87 87 88 88 gboolean disposing; 89 gboolean usePrimaryForPaste;90 89 91 90 #if ENABLE(VIDEO) … … 122 121 123 122 WEBKIT_API gchar* webkit_web_view_get_selected_text(WebKitWebView*); 124 bool webkit_web_view_use_primary_for_paste(WebKitWebView*);125 123 126 124 void webViewEnterFullscreen(WebKitWebView* webView, WebCore::Node*);
Note: See TracChangeset
for help on using the changeset viewer.