Commit 016624b9 authored by avi@chromium.org's avatar avi@chromium.org

Revert "Tweak the WebDragDestDelegate to be useful for more than GTK."

This reverts commit r107985.

BUG=
TEST=

Review URL: http://codereview.chromium.org/8384015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107990 0039d316-1c4b-4281-b951-d872f2087c98
parent 2a09ec21
...@@ -6,29 +6,28 @@ ...@@ -6,29 +6,28 @@
#define CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_GTK_H_ #define CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_GTK_H_
#pragma once #pragma once
#include "base/compiler_specific.h"
#include "chrome/browser/bookmarks/bookmark_node_data.h" #include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "content/browser/tab_contents/web_drag_dest_delegate.h" #include "content/browser/tab_contents/web_drag_dest_delegate_gtk.h"
class TabContentsWrapper; class TabContentsWrapper;
// Chrome needs to intercept content drag events so it can dispatch them to the // Chrome needs to intercept content drag events so it can dispatch them to the
// bookmarks and extensions system. // bookmarks and extensions system.
class WebDragBookmarkHandlerGtk : public content::WebDragDestDelegate { class WebDragBookmarkHandlerGtk : public content::WebDragDestDelegateGtk {
public: public:
WebDragBookmarkHandlerGtk(); WebDragBookmarkHandlerGtk();
virtual ~WebDragBookmarkHandlerGtk(); virtual ~WebDragBookmarkHandlerGtk();
// Overridden from WebDragBookmarkDelegate: // Overridden from WebDragBookmarkDelegate:
virtual void DragInitialize(TabContents* contents) OVERRIDE; virtual void DragInitialize(TabContents* contents);
virtual GdkAtom GetBookmarkTargetAtom() const OVERRIDE; virtual GdkAtom GetBookmarkTargetAtom() const;
virtual void OnReceiveDataFromGtk(GtkSelectionData* data) OVERRIDE; virtual void OnReceiveDataFromGtk(GtkSelectionData* data);
virtual void OnReceiveProcessedData(const GURL& url, virtual void OnReceiveProcessedData(const GURL& url,
const string16& title) OVERRIDE; const string16& title);
virtual void OnDragOver() OVERRIDE; virtual void OnDragOver();
virtual void OnDragEnter() OVERRIDE; virtual void OnDragEnter();
virtual void OnDrop() OVERRIDE; virtual void OnDrop();
virtual void OnDragLeave() OVERRIDE; virtual void OnDragLeave();
private: private:
// The TabContentsWrapper for |tab_contents_|. // The TabContentsWrapper for |tab_contents_|.
......
...@@ -2,13 +2,11 @@ ...@@ -2,13 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_BROWSER_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_H_ #ifndef CONTENT_BROWSER_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_GTK_H_
#define CONTENT_BROWSER_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_H_ #define CONTENT_BROWSER_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_GTK_H_
#pragma once #pragma once
#if defined(TOOLKIT_GTK)
#include <gtk/gtk.h> #include <gtk/gtk.h>
#endif // TOOLKIT_GTK
#include "base/string16.h" #include "base/string16.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
...@@ -19,19 +17,13 @@ class TabContents; ...@@ -19,19 +17,13 @@ class TabContents;
namespace content { namespace content {
// An optional delegate that listens for drags of bookmark data. // An optional delegate that listens for drags of bookmark data.
class CONTENT_EXPORT WebDragDestDelegate { class CONTENT_EXPORT WebDragDestDelegateGtk {
public: public:
// Announces that a drag has started. It's valid that a drag starts, along // Announces that a drag has started. It's valid that a drag starts, along
// with over/enter/leave/drop notifications without receiving any bookmark // with over/enter/leave/drop notifications without receiving any bookmark
// data. // data.
virtual void DragInitialize(TabContents* contents) = 0; virtual void DragInitialize(TabContents* contents) = 0;
// Notifications of drag progression.
virtual void OnDragOver() = 0;
virtual void OnDragEnter() = 0;
virtual void OnDrop() = 0;
#if defined(TOOLKIT_GTK)
// Returns the bookmark atom type. GTK and Views return different values here. // Returns the bookmark atom type. GTK and Views return different values here.
virtual GdkAtom GetBookmarkTargetAtom() const = 0; virtual GdkAtom GetBookmarkTargetAtom() const = 0;
...@@ -40,14 +32,18 @@ class CONTENT_EXPORT WebDragDestDelegate { ...@@ -40,14 +32,18 @@ class CONTENT_EXPORT WebDragDestDelegate {
virtual void OnReceiveDataFromGtk(GtkSelectionData* data) = 0; virtual void OnReceiveDataFromGtk(GtkSelectionData* data) = 0;
virtual void OnReceiveProcessedData(const GURL& url, virtual void OnReceiveProcessedData(const GURL& url,
const string16& title) = 0; const string16& title) = 0;
#endif // TOOLKIT_GTK
// Notifications of drag progression.
virtual void OnDragOver() = 0;
virtual void OnDragEnter() = 0;
virtual void OnDrop() = 0;
// This should also clear any state kept about this drag. // This should also clear any state kept about this drag.
virtual void OnDragLeave() = 0; virtual void OnDragLeave() = 0;
virtual ~WebDragDestDelegate() {} virtual ~WebDragDestDelegateGtk() {}
}; };
} // namespace content } // namespace content
#endif // CONTENT_BROWSER_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_H_ #endif // CONTENT_BROWSER_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_GTK_H_
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/drag_utils_gtk.h" #include "content/browser/tab_contents/drag_utils_gtk.h"
#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/web_drag_dest_delegate.h" #include "content/browser/tab_contents/web_drag_dest_delegate_gtk.h"
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
#include "net/base/net_util.h" #include "net/base/net_util.h"
#include "ui/base/dragdrop/gtk_dnd_util.h" #include "ui/base/dragdrop/gtk_dnd_util.h"
......
...@@ -20,7 +20,7 @@ class TabContents; ...@@ -20,7 +20,7 @@ class TabContents;
namespace content { namespace content {
class WebDragDestDelegate; class WebDragDestDelegateGtk;
// A helper class that handles DnD for drops in the renderer. In GTK parlance, // A helper class that handles DnD for drops in the renderer. In GTK parlance,
// this handles destination-side DnD, but not source-side DnD. // this handles destination-side DnD, but not source-side DnD.
...@@ -37,8 +37,8 @@ class CONTENT_EXPORT WebDragDestGtk { ...@@ -37,8 +37,8 @@ class CONTENT_EXPORT WebDragDestGtk {
// See OnDragLeave(). // See OnDragLeave().
void DragLeave(); void DragLeave();
WebDragDestDelegate* delegate() const { return delegate_; } WebDragDestDelegateGtk* delegate() const { return delegate_; }
void set_delegate(WebDragDestDelegate* delegate) { delegate_ = delegate; } void set_delegate(WebDragDestDelegateGtk* delegate) { delegate_ = delegate; }
private: private:
// Called when a system drag crosses over the render view. As there is no drag // Called when a system drag crosses over the render view. As there is no drag
...@@ -94,7 +94,7 @@ class CONTENT_EXPORT WebDragDestGtk { ...@@ -94,7 +94,7 @@ class CONTENT_EXPORT WebDragDestGtk {
int destroy_handler_; int destroy_handler_;
// A delegate that can receive drag information about drag events. // A delegate that can receive drag information about drag events.
WebDragDestDelegate* delegate_; WebDragDestDelegateGtk* delegate_;
ScopedRunnableMethodFactory<WebDragDestGtk> method_factory_; ScopedRunnableMethodFactory<WebDragDestGtk> method_factory_;
......
...@@ -538,7 +538,7 @@ ...@@ -538,7 +538,7 @@
'browser/tab_contents/tab_contents_view.cc', 'browser/tab_contents/tab_contents_view.cc',
'browser/tab_contents/tab_contents_view.h', 'browser/tab_contents/tab_contents_view.h',
'browser/tab_contents/title_updated_details.h', 'browser/tab_contents/title_updated_details.h',
'browser/tab_contents/web_drag_dest_delegate.h', 'browser/tab_contents/web_drag_dest_delegate_gtk.h',
'browser/tab_contents/web_drag_dest_gtk.cc', 'browser/tab_contents/web_drag_dest_gtk.cc',
'browser/tab_contents/web_drag_dest_gtk.h', 'browser/tab_contents/web_drag_dest_gtk.h',
'browser/tab_contents/web_drag_source_gtk.cc', 'browser/tab_contents/web_drag_source_gtk.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment