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

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

Issue 242823002: Extract GetNodeByID() method from BookmarkModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android built and fixed - invert Created 6 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // Returns all the bookmarked urls and their titles. 166 // Returns all the bookmarked urls and their titles.
167 // This method is thread safe. 167 // This method is thread safe.
168 // See BookmarkService for more details on this. 168 // See BookmarkService for more details on this.
169 virtual void GetBookmarks( 169 virtual void GetBookmarks(
170 std::vector<BookmarkService::URLAndTitle>* urls) OVERRIDE; 170 std::vector<BookmarkService::URLAndTitle>* urls) OVERRIDE;
171 171
172 // Blocks until loaded; this is NOT invoked on the main thread. 172 // Blocks until loaded; this is NOT invoked on the main thread.
173 // See BookmarkService for more details on this. 173 // See BookmarkService for more details on this.
174 virtual void BlockTillLoaded() OVERRIDE; 174 virtual void BlockTillLoaded() OVERRIDE;
175 175
176 // Returns the node with |id|, or NULL if there is no node with |id|.
177 const BookmarkNode* GetNodeByID(int64 id) const;
178
179 // Adds a new folder node at the specified position. 176 // Adds a new folder node at the specified position.
180 const BookmarkNode* AddFolder(const BookmarkNode* parent, 177 const BookmarkNode* AddFolder(const BookmarkNode* parent,
181 int index, 178 int index,
182 const base::string16& title); 179 const base::string16& title);
183 180
184 // Adds a url at the specified position. 181 // Adds a url at the specified position.
185 const BookmarkNode* AddURL(const BookmarkNode* parent, 182 const BookmarkNode* AddURL(const BookmarkNode* parent,
186 int index, 183 int index,
187 const base::string16& title, 184 const base::string16& title,
188 const GURL& url); 185 const GURL& url);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 // Notifies the history backend about urls of removed bookmarks. 296 // Notifies the history backend about urls of removed bookmarks.
300 void NotifyHistoryAboutRemovedBookmarks( 297 void NotifyHistoryAboutRemovedBookmarks(
301 const std::set<GURL>& removed_bookmark_urls) const; 298 const std::set<GURL>& removed_bookmark_urls) const;
302 299
303 // Adds the |node| at |parent| in the specified |index| and notifies its 300 // Adds the |node| at |parent| in the specified |index| and notifies its
304 // observers. 301 // observers.
305 BookmarkNode* AddNode(BookmarkNode* parent, 302 BookmarkNode* AddNode(BookmarkNode* parent,
306 int index, 303 int index,
307 BookmarkNode* node); 304 BookmarkNode* node);
308 305
309 // Implementation of GetNodeByID.
310 const BookmarkNode* GetNodeByID(const BookmarkNode* node, int64 id) const;
311
312 // Returns true if the parent and index are valid. 306 // Returns true if the parent and index are valid.
313 bool IsValidIndex(const BookmarkNode* parent, int index, bool allow_end); 307 bool IsValidIndex(const BookmarkNode* parent, int index, bool allow_end);
314 308
315 // Creates one of the possible permanent nodes (bookmark bar node, other node 309 // Creates one of the possible permanent nodes (bookmark bar node, other node
316 // and mobile node) from |type|. 310 // and mobile node) from |type|.
317 BookmarkPermanentNode* CreatePermanentNode(BookmarkNode::Type type); 311 BookmarkPermanentNode* CreatePermanentNode(BookmarkNode::Type type);
318 312
319 // Notification that a favicon has finished loading. If we can decode the 313 // Notification that a favicon has finished loading. If we can decode the
320 // favicon, FaviconLoaded is invoked. 314 // favicon, FaviconLoaded is invoked.
321 void OnFaviconDataAvailable( 315 void OnFaviconDataAvailable(
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 389
396 // See description of IsDoingExtensiveChanges above. 390 // See description of IsDoingExtensiveChanges above.
397 int extensive_changes_; 391 int extensive_changes_;
398 392
399 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; 393 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_;
400 394
401 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); 395 DISALLOW_COPY_AND_ASSIGN(BookmarkModel);
402 }; 396 };
403 397
404 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ 398 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698