cef/libcef/web_drop_target_gtk.h
Marshall Greenblatt 2497090b12 - Linux: Add support for HTML5 drag&drop (issue #40).
- Linux: Fix GTK cefclient to properly shutdown on CTRL+c (issue #40).
- Linux: Fix compile error due to v8_impl.cc revision 469 changes.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@475 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-23 19:04:54 +00:00

53 lines
1.6 KiB
C++

// Copyright (c) 2012 The Chromium Embedded Framework Authors.
// Portions copyright (c) 2010 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 CEF_LIBCEF_WEB_DROP_TARGET_GTK_H_
#define CEF_LIBCEF_WEB_DROP_TARGET_GTK_H_
#include <gtk/gtk.h>
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
class BrowserWebViewDelegate;
class CefBrowserImpl;
class WebDropData;
namespace WebKit {
class WebView;
}
class WebDropTarget : public base::RefCounted<WebDropTarget> {
public:
explicit WebDropTarget(CefBrowserImpl* browser);
virtual ~WebDropTarget();
WebKit::WebView* getView();
BrowserWebViewDelegate* getDelegate();
// Called by GTK callbacks
bool OnDragMove(GtkWidget* widget, GdkDragContext* context, gint x, gint y,
guint time);
void OnDragLeave(GtkWidget* widget, GdkDragContext* context, guint time);
bool OnDragDrop(GtkWidget* widget, GdkDragContext* context, gint x, gint y,
guint time);
void OnDragEnd(GtkWidget* widget, GdkDragContext* context, guint time);
void OnDragDataReceived(GtkWidget* widget, GdkDragContext* context, gint x,
gint y, GtkSelectionData* data, guint info,
guint time);
void DragLeave();
private:
CefBrowserImpl* browser_;
scoped_ptr<WebDropData> drop_data_;
bool entered_;
int data_requests_;
GdkDragContext* context_;
base::WeakPtrFactory<WebDropTarget> method_factory_;
};
#endif // CEF_LIBCEF_WEB_DROP_TARGET_GTK_H_