diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-29 23:54:57 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-29 23:54:57 +0000 |
commit | 03b3bbf29d5d6eb23984206379e9b9e8f89f16df (patch) | |
tree | af67081fbf56601b473de03fc6472672173308cf /chrome/browser/extensions/extension_bookmark_manager_api.h | |
parent | 9ec3fdb430b97e942b6612835bb2076a704c016a (diff) | |
download | chromium_src-03b3bbf29d5d6eb23984206379e9b9e8f89f16df.zip chromium_src-03b3bbf29d5d6eb23984206379e9b9e8f89f16df.tar.gz chromium_src-03b3bbf29d5d6eb23984206379e9b9e8f89f16df.tar.bz2 |
Add clipboard hooks to the bookmark manager extension API.
This adds the following functions:
copy(idList)
cut(idList)
paste(parentId)
canPaste(parentId, callback)
BUG=32194
TEST=browser_tests.exe --gtest_filter=ExtensionApiTest.BookmarkManager
Review URL: http://codereview.chromium.org/557050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37569 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_bookmark_manager_api.h')
-rw-r--r-- | chrome/browser/extensions/extension_bookmark_manager_api.h | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/chrome/browser/extensions/extension_bookmark_manager_api.h b/chrome/browser/extensions/extension_bookmark_manager_api.h index f0bf1a3..72f1bf0 100644 --- a/chrome/browser/extensions/extension_bookmark_manager_api.h +++ b/chrome/browser/extensions/extension_bookmark_manager_api.h @@ -5,39 +5,58 @@ #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARK_MANAGER_API_H_ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARK_MANAGER_API_H_ +#include "chrome/browser/extensions/extension_bookmarks_module.h" #include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/shell_dialogs.h" -#include "chrome/browser/extensions/extension_bookmarks_module.h" -class CopyBookmarkManagerFunction : public AsyncExtensionFunction { +class BookmarkNode; + +class ClipboardBookmarkManagerFunction : public BookmarksFunction { + protected: + bool CopyOrCut(bool cut); + // Returns a single bookmark node from the ID passed as the first argument. + const BookmarkNode* GetNodeFromArguments(); +}; + +class CopyBookmarkManagerFunction : public ClipboardBookmarkManagerFunction { public: - // Override BookmarkManagerFunction. + // Override ClipboardBookmarkManagerFunction. virtual bool RunImpl(); private: DECLARE_EXTENSION_FUNCTION_NAME("experimental.bookmarkManager.copy"); }; -class CutBookmarkManagerFunction : public AsyncExtensionFunction { +class CutBookmarkManagerFunction : public ClipboardBookmarkManagerFunction { public: - // Override BookmarkManagerFunction. + // Override ClipboardBookmarkManagerFunction. virtual bool RunImpl(); private: DECLARE_EXTENSION_FUNCTION_NAME("experimental.bookmarkManager.cut"); }; -class PasteBookmarkManagerFunction : public AsyncExtensionFunction { +class PasteBookmarkManagerFunction : public ClipboardBookmarkManagerFunction { public: - // Override BookmarkManagerFunction. + // Override ClipboardBookmarkManagerFunction. virtual bool RunImpl(); private: DECLARE_EXTENSION_FUNCTION_NAME("experimental.bookmarkManager.paste"); }; +class CanPasteBookmarkManagerFunction + : public ClipboardBookmarkManagerFunction { + public: + // Override ClipboardBookmarkManagerFunction. + virtual bool RunImpl(); + + private: + DECLARE_EXTENSION_FUNCTION_NAME("experimental.bookmarkManager.canPaste"); +}; + class BookmarkManagerIOFunction : public BookmarksFunction, - public SelectFileDialog::Listener { + public SelectFileDialog::Listener { public: // Overridden from SelectFileDialog::Listener: virtual void FileSelected(const FilePath& path, int index, void* params) = 0; @@ -51,7 +70,7 @@ class BookmarkManagerIOFunction : public BookmarksFunction, class ImportBookmarksFunction : public BookmarkManagerIOFunction { public: - // Override BookmarkManagerFunction. + // Override BookmarkManagerIOFunction. bool RunImpl(); void FileSelected(const FilePath& path, int index, void* params); @@ -61,7 +80,7 @@ class ImportBookmarksFunction : public BookmarkManagerIOFunction { class ExportBookmarksFunction : public BookmarkManagerIOFunction { public: - // Override BookmarkManagerFunction. + // Override BookmarkManagerIOFunction. bool RunImpl(); void FileSelected(const FilePath& path, int index, void* params); @@ -71,7 +90,7 @@ class ExportBookmarksFunction : public BookmarkManagerIOFunction { class BookmarkManagerGetStringsFunction : public AsyncExtensionFunction { public: - // Override BookmarkManagerFunction. + // Override AsyncExtensionFunction. virtual bool RunImpl(); private: |