OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 // Returns all the bookmarked urls. | 289 // Returns all the bookmarked urls. |
290 // This method is thread safe. | 290 // This method is thread safe. |
291 // See BookmarkService for more details on this. | 291 // See BookmarkService for more details on this. |
292 virtual void GetBookmarks(std::vector<GURL>* urls) OVERRIDE; | 292 virtual void GetBookmarks(std::vector<GURL>* urls) OVERRIDE; |
293 | 293 |
294 // Blocks until loaded; this is NOT invoked on the main thread. | 294 // Blocks until loaded; this is NOT invoked on the main thread. |
295 // See BookmarkService for more details on this. | 295 // See BookmarkService for more details on this. |
296 virtual void BlockTillLoaded() OVERRIDE; | 296 virtual void BlockTillLoaded() OVERRIDE; |
297 | 297 |
298 // Returns the node with |id|, or NULL if there is no node with |id|. | 298 // Returns the node with |id|, or NULL if there is no node with |id|. |
299 const BookmarkNode* GetNodeByID(int64 id); | 299 const BookmarkNode* GetNodeByID(int64 id) const; |
300 | 300 |
301 // Adds a new folder node at the specified position. | 301 // Adds a new folder node at the specified position. |
302 const BookmarkNode* AddFolder(const BookmarkNode* parent, | 302 const BookmarkNode* AddFolder(const BookmarkNode* parent, |
303 int index, | 303 int index, |
304 const string16& title); | 304 const string16& title); |
305 | 305 |
306 // Adds a url at the specified position. | 306 // Adds a url at the specified position. |
307 const BookmarkNode* AddURL(const BookmarkNode* parent, | 307 const BookmarkNode* AddURL(const BookmarkNode* parent, |
308 int index, | 308 int index, |
309 const string16& title, | 309 const string16& title, |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 | 386 |
387 // Adds the node at the specified position and sends notification. If | 387 // Adds the node at the specified position and sends notification. If |
388 // was_bookmarked is true, it indicates a bookmark already existed for the | 388 // was_bookmarked is true, it indicates a bookmark already existed for the |
389 // URL. | 389 // URL. |
390 BookmarkNode* AddNode(BookmarkNode* parent, | 390 BookmarkNode* AddNode(BookmarkNode* parent, |
391 int index, | 391 int index, |
392 BookmarkNode* node, | 392 BookmarkNode* node, |
393 bool was_bookmarked); | 393 bool was_bookmarked); |
394 | 394 |
395 // Implementation of GetNodeByID. | 395 // Implementation of GetNodeByID. |
396 const BookmarkNode* GetNodeByID(const BookmarkNode* node, int64 id); | 396 const BookmarkNode* GetNodeByID(const BookmarkNode* node, int64 id) const; |
397 | 397 |
398 // Returns true if the parent and index are valid. | 398 // Returns true if the parent and index are valid. |
399 bool IsValidIndex(const BookmarkNode* parent, int index, bool allow_end); | 399 bool IsValidIndex(const BookmarkNode* parent, int index, bool allow_end); |
400 | 400 |
401 // Creates one of the possible permanent nodes (bookmark bar node, other node | 401 // Creates one of the possible permanent nodes (bookmark bar node, other node |
402 // and synced node) from |type|. | 402 // and synced node) from |type|. |
403 BookmarkNode* CreatePermanentNode(BookmarkNode::Type type); | 403 BookmarkNode* CreatePermanentNode(BookmarkNode::Type type); |
404 | 404 |
405 // Notification that a favicon has finished loading. If we can decode the | 405 // Notification that a favicon has finished loading. If we can decode the |
406 // favicon, FaviconLoaded is invoked. | 406 // favicon, FaviconLoaded is invoked. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 scoped_ptr<BookmarkIndex> index_; | 479 scoped_ptr<BookmarkIndex> index_; |
480 | 480 |
481 base::WaitableEvent loaded_signal_; | 481 base::WaitableEvent loaded_signal_; |
482 | 482 |
483 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; | 483 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; |
484 | 484 |
485 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 485 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
486 }; | 486 }; |
487 | 487 |
488 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ | 488 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
OLD | NEW |