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

Side by Side Diff: components/bookmarks/browser/bookmark_model.h

Issue 317333004: Added BookmarkClient::CanBeEditedByUser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added TODO 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Returns true if this bookmark model is currently in a mode where extensive 124 // Returns true if this bookmark model is currently in a mode where extensive
125 // changes might happen, such as for import and sync. This is helpful for 125 // changes might happen, such as for import and sync. This is helpful for
126 // observers that are created after the mode has started, and want to check 126 // observers that are created after the mode has started, and want to check
127 // state during their own initializer, such as the NTP. 127 // state during their own initializer, such as the NTP.
128 bool IsDoingExtensiveChanges() const { return extensive_changes_ > 0; } 128 bool IsDoingExtensiveChanges() const { return extensive_changes_ > 0; }
129 129
130 // Removes the node at the given |index| from |parent|. Removing a folder node 130 // Removes the node at the given |index| from |parent|. Removing a folder node
131 // recursively removes all nodes. Observers are notified immediately. 131 // recursively removes all nodes. Observers are notified immediately.
132 void Remove(const BookmarkNode* parent, int index); 132 void Remove(const BookmarkNode* parent, int index);
133 133
134 // Removes all the non-permanent bookmark nodes. Observers are only notified 134 // Removes all the non-permanent bookmark nodes that are editable by the user.
135 // when all nodes have been removed. There is no notification for individual 135 // Observers are only notified when all nodes have been removed. There is no
136 // node removals. 136 // notification for individual node removals.
137 void RemoveAll(); 137 void RemoveAll();
138 138
139 // Moves |node| to |new_parent| and inserts it at the given |index|. 139 // Moves |node| to |new_parent| and inserts it at the given |index|.
140 void Move(const BookmarkNode* node, 140 void Move(const BookmarkNode* node,
141 const BookmarkNode* new_parent, 141 const BookmarkNode* new_parent,
142 int index); 142 int index);
143 143
144 // Inserts a copy of |node| into |new_parent| at |index|. 144 // Inserts a copy of |node| into |new_parent| at |index|.
145 void Copy(const BookmarkNode* node, 145 void Copy(const BookmarkNode* node,
146 const BookmarkNode* new_parent, 146 const BookmarkNode* new_parent,
(...skipping 12 matching lines...) Expand all
159 159
160 // Sets the URL of |node|. 160 // Sets the URL of |node|.
161 void SetURL(const BookmarkNode* node, const GURL& url); 161 void SetURL(const BookmarkNode* node, const GURL& url);
162 162
163 // Sets the date added time of |node|. 163 // Sets the date added time of |node|.
164 void SetDateAdded(const BookmarkNode* node, base::Time date_added); 164 void SetDateAdded(const BookmarkNode* node, base::Time date_added);
165 165
166 // Returns the set of nodes with the |url|. 166 // Returns the set of nodes with the |url|.
167 void GetNodesByURL(const GURL& url, std::vector<const BookmarkNode*>* nodes); 167 void GetNodesByURL(const GURL& url, std::vector<const BookmarkNode*>* nodes);
168 168
169 // Returns the most recently added node for the |url|. Returns NULL if |url| 169 // Returns the most recently added user node for the |url|; urls from any
170 // is not bookmarked. 170 // nodes that are not editable by the user are never returned by this call.
171 const BookmarkNode* GetMostRecentlyAddedNodeForURL(const GURL& url); 171 // Returns NULL if |url| is not bookmarked.
172 const BookmarkNode* GetMostRecentlyAddedUserNodeForURL(const GURL& url);
172 173
173 // Returns true if there are bookmarks, otherwise returns false. 174 // Returns true if there are bookmarks, otherwise returns false.
174 // This method is thread safe. 175 // This method is thread safe.
175 bool HasBookmarks(); 176 bool HasBookmarks();
176 177
177 // Returns true if the specified URL is bookmarked. 178 // Returns true if the specified URL is bookmarked.
178 // 179 //
179 // If not on the main thread you *must* invoke BlockTillLoaded first. 180 // If not on the main thread you *must* invoke BlockTillLoaded first.
180 bool IsBookmarked(const GURL& url); 181 bool IsBookmarked(const GURL& url);
181 182
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 424
424 // See description of IsDoingExtensiveChanges above. 425 // See description of IsDoingExtensiveChanges above.
425 int extensive_changes_; 426 int extensive_changes_;
426 427
427 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; 428 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_;
428 429
429 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); 430 DISALLOW_COPY_AND_ASSIGN(BookmarkModel);
430 }; 431 };
431 432
432 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ 433 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_
OLDNEW
« no previous file with comments | « components/bookmarks/browser/bookmark_client.h ('k') | components/bookmarks/browser/bookmark_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698