summaryrefslogtreecommitdiffstats
path: root/views/widget/drop_target_gtk.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 21:44:19 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 21:44:19 +0000
commit302e0e1a827df92e6eba995ce589a871954f5bf2 (patch)
tree0dd29c01c54948b297e258828b91f2776c18f08c /views/widget/drop_target_gtk.h
parent3af66ca4e22b15e29a96794f5a9f4ab356d17b87 (diff)
downloadchromium_src-302e0e1a827df92e6eba995ce589a871954f5bf2.zip
chromium_src-302e0e1a827df92e6eba995ce589a871954f5bf2.tar.gz
chromium_src-302e0e1a827df92e6eba995ce589a871954f5bf2.tar.bz2
Reverts recent patch as broke build on toolkit_views.
TBR=ben BUG=none TEST=none Review URL: http://codereview.chromium.org/174023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23658 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/drop_target_gtk.h')
-rw-r--r--views/widget/drop_target_gtk.h113
1 files changed, 0 insertions, 113 deletions
diff --git a/views/widget/drop_target_gtk.h b/views/widget/drop_target_gtk.h
deleted file mode 100644
index b4a5c56..0000000
--- a/views/widget/drop_target_gtk.h
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef VIEWS_WIDGET_DROP_TARGET_GTK_H_
-#define VIEWS_WIDGET_DROP_TARGET_GTK_H_
-
-#include <gtk/gtk.h>
-#include <set>
-
-#include "app/os_exchange_data.h"
-#include "base/scoped_ptr.h"
-#include "views/widget/drop_helper.h"
-
-class OSExchangeDataProviderGtk;
-
-namespace views {
-
-class RootView;
-class View;
-
-// DropTarget implementation for Gtk.
-//
-// The data for a drop is not immediately available on X. As such we lazily
-// ask for data as necessary. Some Views require data before they can determine
-// if the drop is going to be allowed. When such a View is encountered the
-// relevant data is requested from the drag source. When the data is available
-// the target is notified. Similarly if the drop completes and the data has
-// not yet been fetched, it is fetched and the target then notified.
-//
-// When a drop finishes this class calls back to the containing WidgetGtk
-// which results in deleting the DropTargetGtk.
-class DropTargetGtk {
- public:
- explicit DropTargetGtk(RootView* root_view,
- GdkDragContext* context);
- ~DropTargetGtk();
-
- // If a drag and drop is underway and |view| is the current drop target, the
- // drop target is set to null.
- // This is invoked when a View is removed from the RootView to make sure
- // we don't target a view that was removed during dnd.
- void ResetTargetViewIfEquals(View* view);
-
- // Drop methods from Gtk. These are forwarded from the containing WidgetGtk.
- void OnDragDataReceived(GdkDragContext* context,
- gint x,
- gint y,
- GtkSelectionData* data,
- guint info,
- guint time);
- gboolean OnDragDrop(GdkDragContext* context,
- gint x,
- gint y,
- guint time);
- void OnDragLeave(GdkDragContext* context, guint time);
- gboolean OnDragMotion(GdkDragContext* context,
- gint x,
- gint y,
- guint time);
-
- private:
- // Invoked when the drop finishes AND all the data is available.
- void FinishDrop(GdkDragContext* context, gint x, gint y, guint time);
-
- // Returns in |f2| and |cf2| the intersection of |f1| |f2| and
- // |cf1|, |cf2|.
- void IntersectFormats(int f1, const std::set<GdkAtom>& cf1,
- int* f2, std::set<GdkAtom>* cf2);
-
- // Requests the formats in |formats| and the custom formats in
- // |custom_formats|.
- void RequestFormats(GdkDragContext* context,
- int formats,
- const std::set<GdkAtom>& custom_formats,
- guint time);
-
- // Reutrns the Provider of the OSExchangeData we created.
- OSExchangeDataProviderGtk& data_provider() const;
-
- // Manages sending the appropriate drop methods to the view the drop is over.
- DropHelper helper_;
-
- // The formats we've requested from the drag source.
- //
- // NOTE: these formats are the intersection of the formats requested by the
- // drop target and the formats provided by the source.
- int requested_formats_;
- std::set<GdkAtom> requested_custom_formats_;
-
- // The data.
- scoped_ptr<OSExchangeData> data_;
-
- // Are we waiting for data from the source before we can notify the view?
- // This is set in two distinct ways: when the view requires the data before
- // it can answer Can Drop (that is, AreDropTypesRequired returns true) and
- // when the user dropped the data but we didn't get it all yet.
- bool waiting_for_data_;
-
- // Has OnDragDrop been invoked?
- bool received_drop_;
-
- // The view under the mouse. This is not necessarily the same as
- // helper_.target_view(). The two differ if the view under the mouse requires
- // the data.
- View* pending_view_;
-
- DISALLOW_COPY_AND_ASSIGN(DropTargetGtk);
-};
-
-} // namespace views
-
-#endif // VIEWS_WIDGET_DROP_TARGET_GTK_H_