summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tab_contents
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-08 21:49:16 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-08 21:49:16 +0000
commit0d726c521db7f2f456e04223ef71a1c8c28764f1 (patch)
tree2c6bcde57b5b98ca38bd337ccbea08dc9f9d6f74 /chrome/browser/views/tab_contents
parent4a99e834fe351c8e81a70ea571d52b3cdde40af1 (diff)
downloadchromium_src-0d726c521db7f2f456e04223ef71a1c8c28764f1.zip
chromium_src-0d726c521db7f2f456e04223ef71a1c8c28764f1.tar.gz
chromium_src-0d726c521db7f2f456e04223ef71a1c8c28764f1.tar.bz2
Pulls WebDragDest out of TabContentsViewGtk so that it can be used by
both views and gtk. BUG=none TEST=none Review URL: http://codereview.chromium.org/265041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28457 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tab_contents')
-rw-r--r--chrome/browser/views/tab_contents/tab_contents_view_gtk.cc6
-rw-r--r--chrome/browser/views/tab_contents/tab_contents_view_gtk.h5
2 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc
index 665a63d..8667bce 100644
--- a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc
+++ b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/tab_contents/interstitial_page.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
+#include "chrome/browser/tab_contents/web_drag_dest_gtk.h"
#include "chrome/browser/views/sad_tab_view.h"
#include "chrome/browser/views/tab_contents/render_view_context_menu_win.h"
#include "views/focus/view_storage.h"
@@ -152,6 +153,9 @@ RenderWidgetHostView* TabContentsViewGtk::CreateViewForWidget(
gtk_widget_add_events(view->native_view(), GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK);
+ // Renderer target DnD.
+ drag_dest_.reset(new WebDragDestGtk(tab_contents(), view->native_view()));
+
gtk_fixed_put(GTK_FIXED(GetNativeView()), view->native_view(), 0, 0);
return view;
}
@@ -265,7 +269,7 @@ void TabContentsViewGtk::RestoreFocus() {
}
void TabContentsViewGtk::UpdateDragCursor(WebDragOperation operation) {
- NOTIMPLEMENTED();
+ drag_dest_->UpdateDragStatus(operation);
}
void TabContentsViewGtk::GotFocus() {
diff --git a/chrome/browser/views/tab_contents/tab_contents_view_gtk.h b/chrome/browser/views/tab_contents/tab_contents_view_gtk.h
index 324846e..993992b 100644
--- a/chrome/browser/views/tab_contents/tab_contents_view_gtk.h
+++ b/chrome/browser/views/tab_contents/tab_contents_view_gtk.h
@@ -13,6 +13,7 @@
class RenderViewContextMenuWin;
class SadTabView;
class TabContentsDragSource;
+class WebDragDestGtk;
namespace views {
class NativeViewHost;
}
@@ -93,6 +94,10 @@ class TabContentsViewGtk : public TabContentsView,
// The event for the last mouse down we handled. We need this for drags.
GdkEventButton last_mouse_down_;
+ // The helper object that handles drag destination related interactions with
+ // GTK.
+ scoped_ptr<WebDragDestGtk> drag_dest_;
+
DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk);
};