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