Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2782)

Unified Diff: chrome/browser/tab_contents/web_drag_bookmark_handler_aura.h

Issue 9757001: Support custom drag-and-drop of bookmarks in Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor style fixes from CR Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/tab_contents/web_drag_bookmark_handler_aura.h
diff --git a/chrome/browser/tab_contents/web_drag_bookmark_handler_aura.h b/chrome/browser/tab_contents/web_drag_bookmark_handler_aura.h
new file mode 100644
index 0000000000000000000000000000000000000000..60ba07f425ddbed963df9219a070601e6d41798e
--- /dev/null
+++ b/chrome/browser/tab_contents/web_drag_bookmark_handler_aura.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2012 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 CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_
+#define CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_
+#pragma once
+
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_drag_dest_delegate.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
+
+class TabContentsWrapper;
+
+// Chrome needs to intercept content drag events so it can dispatch them to the
+// bookmarks and extensions system.
+// Note that unlike the other platforms, Aura doesn't use all of the
+// WebDragDest infrastructure, just the WebDragDestDelegate.
+class WebDragBookmarkHandlerAura : public content::WebDragDestDelegate {
+ public:
+ WebDragBookmarkHandlerAura();
+ virtual ~WebDragBookmarkHandlerAura();
+
+ // Overridden from content::WebDragDestDelegate:
+ virtual void DragInitialize(content::WebContents* contents) OVERRIDE;
+ virtual void OnDragOver() OVERRIDE;
+ virtual void OnDragEnter() OVERRIDE;
+ virtual void OnDrop() OVERRIDE;
+ virtual void OnDragLeave() OVERRIDE;
+
+ virtual void OnReceiveDragData(const ui::OSExchangeData& data) OVERRIDE;
+
+ private:
+ // The TabContentsWrapper for the drag.
+ // Weak reference; may be NULL if the contents aren't contained in a wrapper
+ // (e.g. WebUI dialogs).
+ TabContentsWrapper* tab_;
+
+ // The bookmark data for the active drag. Empty when there is no active drag.
+ BookmarkNodeData bookmark_drag_data_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebDragBookmarkHandlerAura);
+};
+
+#endif // CHROME_BROWSER_TAB_CONTENTS_WEB_DRAG_BOOKMARK_HANDLER_AURA_H_

Powered by Google App Engine
This is Rietveld 408576698