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

Unified Diff: chrome/browser/extensions/api/bookmarks/bookmarks_api.h

Issue 308273002: Made the bookmarks extension APIs aware of managed bookmarks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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/api/bookmarks/bookmarks_api.h
diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.h b/chrome/browser/extensions/api/bookmarks/bookmarks_api.h
index fc73e0c76f045cd6b62fdc4d324ea31f3095fd89..2c02d87b5c956c98f90331a3f173e3fabe62ede8 100644
--- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.h
+++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.h
@@ -18,6 +18,8 @@
#include "extensions/browser/event_router.h"
#include "ui/shell_dialogs/select_file_dialog.h"
+class ChromeBookmarkClient;
+
namespace base {
class FilePath;
class ListValue;
@@ -125,6 +127,9 @@ class BookmarksFunction : public ChromeAsyncExtensionFunction,
// RunAsync semantic equivalent called when the bookmarks are ready.
virtual bool RunOnReady() = 0;
+ // Helper to get the ChromeBookmarkClient.
+ ChromeBookmarkClient* GetChromeBookmarkClient();
+
// Helper to get the bookmark id as int64 from the given string id.
// Sets error_ to an error string if the given id string can't be parsed
// as an int64. In case of error, doesn't change id and returns false.
@@ -146,6 +151,12 @@ class BookmarksFunction : public ChromeAsyncExtensionFunction,
// error_ to the appropriate error string.
bool EditBookmarksEnabled();
+ // Helper that checks if |node| can be modified. Returns false if |node|
+ // is NULL, or a managed node, or the root node. In these cases the node
+ // can't be edited, can't have new child nodes appended, and its direct
+ // children can't be moved or reordered.
+ bool CanBeModified(const BookmarkNode* node);
+
private:
// BaseBookmarkModelObserver:
virtual void BookmarkModelChanged() OVERRIDE;
« no previous file with comments | « chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc ('k') | chrome/browser/extensions/api/bookmarks/bookmarks_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698