| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 } | 359 } |
| 360 | 360 |
| 361 // Sets the store to NULL, making it so the BookmarkModel does not persist | 361 // Sets the store to NULL, making it so the BookmarkModel does not persist |
| 362 // any changes to disk. This is only useful during testing to speed up | 362 // any changes to disk. This is only useful during testing to speed up |
| 363 // testing. | 363 // testing. |
| 364 void ClearStore(); | 364 void ClearStore(); |
| 365 | 365 |
| 366 // Returns whether the bookmarks file changed externally. | 366 // Returns whether the bookmarks file changed externally. |
| 367 bool file_changed() const { return file_changed_; } | 367 bool file_changed() const { return file_changed_; } |
| 368 | 368 |
| 369 // Returns the next node ID. |
| 370 int64 next_node_id() const { return next_node_id_; } |
| 371 |
| 369 private: | 372 private: |
| 370 // Used to order BookmarkNodes by URL. | 373 // Used to order BookmarkNodes by URL. |
| 371 class NodeURLComparator { | 374 class NodeURLComparator { |
| 372 public: | 375 public: |
| 373 bool operator()(const BookmarkNode* n1, const BookmarkNode* n2) const { | 376 bool operator()(const BookmarkNode* n1, const BookmarkNode* n2) const { |
| 374 return n1->GetURL() < n2->GetURL(); | 377 return n1->GetURL() < n2->GetURL(); |
| 375 } | 378 } |
| 376 }; | 379 }; |
| 377 | 380 |
| 378 // Implementation of IsBookmarked. Before calling this the caller must | 381 // Implementation of IsBookmarked. Before calling this the caller must |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 scoped_refptr<BookmarkStorage> store_; | 501 scoped_refptr<BookmarkStorage> store_; |
| 499 | 502 |
| 500 scoped_ptr<BookmarkIndex> index_; | 503 scoped_ptr<BookmarkIndex> index_; |
| 501 | 504 |
| 502 base::WaitableEvent loaded_signal_; | 505 base::WaitableEvent loaded_signal_; |
| 503 | 506 |
| 504 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 507 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
| 505 }; | 508 }; |
| 506 | 509 |
| 507 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ | 510 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
| OLD | NEW |