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

Unified Diff: chrome/browser/extensions/extension_bookmark_manager_api.h

Issue 596105: Bookmark Manager Drag and Drop backend.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 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/extensions/extension_bookmark_manager_api.h
===================================================================
--- chrome/browser/extensions/extension_bookmark_manager_api.h (revision 39450)
+++ chrome/browser/extensions/extension_bookmark_manager_api.h (working copy)
@@ -5,12 +5,51 @@
#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARK_MANAGER_API_H_
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARK_MANAGER_API_H_
+#include "chrome/browser/bookmarks/bookmark_drag_data.h"
#include "chrome/browser/extensions/extension_bookmarks_module.h"
#include "chrome/browser/extensions/extension_function.h"
+#include "chrome/browser/renderer_host/render_view_host_delegate.h"
#include "chrome/browser/shell_dialogs.h"
class BookmarkNode;
+class ListValue;
+class Profile;
+class TabContents;
+// Class that handles the chrome.experimental.bookmarkManager events.
+class ExtensionBookmarkManagerEventRouter
+ : public RenderViewHostDelegate::BookmarkDrag {
+ public:
+ ExtensionBookmarkManagerEventRouter(Profile* profile,
+ TabContents* tab_contents);
+ virtual ~ExtensionBookmarkManagerEventRouter();
+
+ // RenderViewHostDelegate::BookmarkDrag interface
+ virtual void OnDragEnter(const DragData* data);
+ virtual void OnDragOver(const DragData* data);
+ virtual void OnDragLeave(const DragData* data);
+ virtual void OnDrop(const DragData* data);
+
+ // The bookmark drag and drop data. This gets set after a drop was done on
+ // the page. This returns NULL if no data is available.
+ const BookmarkDragData* GetBookmarkDragData();
+
+ // Clears the drag and drop data.
+ void ClearBookmarkDragData();
+
+ private:
+ // Helper to actually dispatch an event to extension listeners.
+ void DispatchEvent(const char* event_name, const ListValue* args);
+
+ void DispatchDragEvent(const DragData* data, const char* event_name);
+
+ Profile* profile_;
+ TabContents* tab_contents_;
+ BookmarkDragData bookmark_drag_data_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionBookmarkManagerEventRouter);
+};
+
class ClipboardBookmarkManagerFunction : public BookmarksFunction {
protected:
bool CopyOrCut(bool cut);
@@ -34,9 +73,9 @@
DECLARE_EXTENSION_FUNCTION_NAME("experimental.bookmarkManager.cut");
};
-class PasteBookmarkManagerFunction : public ClipboardBookmarkManagerFunction {
+class PasteBookmarkManagerFunction : public BookmarksFunction {
public:
- // Override ClipboardBookmarkManagerFunction.
+ // Override BookmarksFunction.
virtual bool RunImpl();
private:
@@ -44,9 +83,9 @@
};
class CanPasteBookmarkManagerFunction
- : public ClipboardBookmarkManagerFunction {
+ : public BookmarksFunction {
public:
- // Override ClipboardBookmarkManagerFunction.
+ // Override BookmarksFunction.
virtual bool RunImpl();
private:
@@ -87,9 +126,9 @@
};
class SortChildrenBookmarkManagerFunction
- : public ClipboardBookmarkManagerFunction {
+ : public BookmarksFunction {
public:
- // Override ClipboardBookmarkManagerFunction.
+ // Override BookmarksFunction.
virtual bool RunImpl();
private:
@@ -106,4 +145,22 @@
DECLARE_EXTENSION_FUNCTION_NAME("experimental.bookmarkManager.getStrings");
};
+class StartDragBookmarkManagerFunction
+ : public BookmarksFunction {
+ public:
+ // Override BookmarksFunction.
+ virtual bool RunImpl();
+
+ private:
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.bookmarkManager.startDrag");
+};
+
+class DropBookmarkManagerFunction : public BookmarksFunction {
+ public:
+ virtual bool RunImpl();
+
+ private:
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.bookmarkManager.drop");
+};
+
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARK_MANAGER_API_H_

Powered by Google App Engine
This is Rietveld 408576698