| OLD | NEW |
| 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 16 matching lines...) Expand all Loading... |
| 27 #include "url/gurl.h" | 27 #include "url/gurl.h" |
| 28 | 28 |
| 29 class BookmarkExpandedStateTracker; | 29 class BookmarkExpandedStateTracker; |
| 30 class BookmarkIndex; | 30 class BookmarkIndex; |
| 31 class BookmarkLoadDetails; | 31 class BookmarkLoadDetails; |
| 32 class BookmarkModel; | 32 class BookmarkModel; |
| 33 class BookmarkModelObserver; | 33 class BookmarkModelObserver; |
| 34 class BookmarkStorage; | 34 class BookmarkStorage; |
| 35 struct BookmarkTitleMatch; | 35 struct BookmarkTitleMatch; |
| 36 class Profile; | 36 class Profile; |
| 37 class ScopedGroupBookmarkActions; |
| 37 | 38 |
| 38 namespace base { | 39 namespace base { |
| 39 class SequencedTaskRunner; | 40 class SequencedTaskRunner; |
| 40 } | 41 } |
| 41 | 42 |
| 42 namespace chrome { | 43 namespace chrome { |
| 43 struct FaviconImageResult; | 44 struct FaviconImageResult; |
| 44 } | 45 } |
| 45 | 46 |
| 46 // BookmarkNode --------------------------------------------------------------- | 47 // BookmarkNode --------------------------------------------------------------- |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 void SetNodeSyncTransactionVersion(const BookmarkNode* node, | 433 void SetNodeSyncTransactionVersion(const BookmarkNode* node, |
| 433 int64 sync_transaction_version); | 434 int64 sync_transaction_version); |
| 434 | 435 |
| 435 // Returns the profile that corresponds to this BookmarkModel. | 436 // Returns the profile that corresponds to this BookmarkModel. |
| 436 Profile* profile() { return profile_; } | 437 Profile* profile() { return profile_; } |
| 437 | 438 |
| 438 private: | 439 private: |
| 439 friend class BookmarkCodecTest; | 440 friend class BookmarkCodecTest; |
| 440 friend class BookmarkModelTest; | 441 friend class BookmarkModelTest; |
| 441 friend class BookmarkStorage; | 442 friend class BookmarkStorage; |
| 443 friend class ScopedGroupBookmarkActions; |
| 442 | 444 |
| 443 // Used to order BookmarkNodes by URL. | 445 // Used to order BookmarkNodes by URL. |
| 444 class NodeURLComparator { | 446 class NodeURLComparator { |
| 445 public: | 447 public: |
| 446 bool operator()(const BookmarkNode* n1, const BookmarkNode* n2) const { | 448 bool operator()(const BookmarkNode* n1, const BookmarkNode* n2) const { |
| 447 return n1->url() < n2->url(); | 449 return n1->url() < n2->url(); |
| 448 } | 450 } |
| 449 }; | 451 }; |
| 450 | 452 |
| 451 // Implementation of IsBookmarked. Before calling this the caller must obtain | 453 // Implementation of IsBookmarked. Before calling this the caller must obtain |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 // Invoked from the node to load the favicon. Requests the favicon from the | 509 // Invoked from the node to load the favicon. Requests the favicon from the |
| 508 // favicon service. | 510 // favicon service. |
| 509 void LoadFavicon(BookmarkNode* node); | 511 void LoadFavicon(BookmarkNode* node); |
| 510 | 512 |
| 511 // Called to notify the observers that the favicon has been loaded. | 513 // Called to notify the observers that the favicon has been loaded. |
| 512 void FaviconLoaded(const BookmarkNode* node); | 514 void FaviconLoaded(const BookmarkNode* node); |
| 513 | 515 |
| 514 // If we're waiting on a favicon for node, the load request is canceled. | 516 // If we're waiting on a favicon for node, the load request is canceled. |
| 515 void CancelPendingFaviconLoadRequests(BookmarkNode* node); | 517 void CancelPendingFaviconLoadRequests(BookmarkNode* node); |
| 516 | 518 |
| 519 // Notifies the observers that a set of changes initiated by a single user |
| 520 // action is about to happen and has completed. |
| 521 void BeginGroupedChanges(); |
| 522 void EndGroupedChanges(); |
| 523 |
| 517 // content::NotificationObserver: | 524 // content::NotificationObserver: |
| 518 virtual void Observe(int type, | 525 virtual void Observe(int type, |
| 519 const content::NotificationSource& source, | 526 const content::NotificationSource& source, |
| 520 const content::NotificationDetails& details) OVERRIDE; | 527 const content::NotificationDetails& details) OVERRIDE; |
| 521 | 528 |
| 522 // Generates and returns the next node ID. | 529 // Generates and returns the next node ID. |
| 523 int64 generate_next_node_id(); | 530 int64 generate_next_node_id(); |
| 524 | 531 |
| 525 // Sets the maximum node ID to the given value. | 532 // Sets the maximum node ID to the given value. |
| 526 // This is used by BookmarkCodec to report the maximum ID after it's done | 533 // This is used by BookmarkCodec to report the maximum ID after it's done |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 579 |
| 573 // See description of IsDoingExtensiveChanges above. | 580 // See description of IsDoingExtensiveChanges above. |
| 574 int extensive_changes_; | 581 int extensive_changes_; |
| 575 | 582 |
| 576 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; | 583 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; |
| 577 | 584 |
| 578 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 585 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
| 579 }; | 586 }; |
| 580 | 587 |
| 581 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ | 588 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
| OLD | NEW |