| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_ENHANCED_BOOKMARKS_CHROME_BOOKMARK_SERVER_CLUSTER_SERVICE
_H_ | 5 #ifndef CHROME_BROWSER_ENHANCED_BOOKMARKS_CHROME_BOOKMARK_SERVER_CLUSTER_SERVICE
_H_ |
| 6 #define CHROME_BROWSER_ENHANCED_BOOKMARKS_CHROME_BOOKMARK_SERVER_CLUSTER_SERVICE
_H_ | 6 #define CHROME_BROWSER_ENHANCED_BOOKMARKS_CHROME_BOOKMARK_SERVER_CLUSTER_SERVICE
_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/sync/profile_sync_service_observer.h" | 8 #include "chrome/browser/sync/profile_sync_service_observer.h" |
| 9 #include "components/enhanced_bookmarks/bookmark_server_cluster_service.h" | 9 #include "components/enhanced_bookmarks/bookmark_server_cluster_service.h" |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 ~ChromeBookmarkServerClusterService() override; | 27 ~ChromeBookmarkServerClusterService() override; |
| 28 | 28 |
| 29 // BookmarkServerClusterService | 29 // BookmarkServerClusterService |
| 30 void AddObserver(BookmarkServerServiceObserver* observer) override; | 30 void AddObserver(BookmarkServerServiceObserver* observer) override; |
| 31 | 31 |
| 32 // ProfileSyncServiceObserver implementation. | 32 // ProfileSyncServiceObserver implementation. |
| 33 void OnStateChanged() override; | 33 void OnStateChanged() override; |
| 34 void OnSyncCycleCompleted() override; | 34 void OnSyncCycleCompleted() override; |
| 35 | 35 |
| 36 // EnhancedBookmarkModelObserver implementation. | 36 // EnhancedBookmarkModelObserver implementation. |
| 37 void EnhancedBookmarkAdded(const BookmarkNode* node) override; | 37 void EnhancedBookmarkAdded(const bookmarks::BookmarkNode* node) override; |
| 38 void EnhancedBookmarkRemoved(const BookmarkNode* node) override; | 38 void EnhancedBookmarkRemoved(const bookmarks::BookmarkNode* node) override; |
| 39 void EnhancedBookmarkNodeChanged(const BookmarkNode* node) override; | 39 void EnhancedBookmarkNodeChanged( |
| 40 const bookmarks::BookmarkNode* node) override; |
| 41 |
| 40 private: | 42 private: |
| 41 // This sets an internal flag to fetch new clusters. | 43 // This sets an internal flag to fetch new clusters. |
| 42 void InvalidateCache(); | 44 void InvalidateCache(); |
| 43 | 45 |
| 44 // This class observes the sync service for changes. | 46 // This class observes the sync service for changes. |
| 45 ProfileSyncService* sync_service_; | 47 ProfileSyncService* sync_service_; |
| 46 bool sync_refresh_skipped_ = false; | 48 bool sync_refresh_skipped_ = false; |
| 47 // This holds the number of cluster refreshes needed. | 49 // This holds the number of cluster refreshes needed. |
| 48 int refreshes_needed_ = 0; | 50 int refreshes_needed_ = 0; |
| 49 | 51 |
| 50 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkServerClusterService); | 52 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkServerClusterService); |
| 51 }; | 53 }; |
| 52 | 54 |
| 53 } // namespace enhanced_bookmarks | 55 } // namespace enhanced_bookmarks |
| 54 | 56 |
| 55 #endif // CHROME_BROWSER_ENHANCED_BOOKMARKS_CHROME_BOOKMARK_SERVER_CLUSTER_SERV
ICE_H_ | 57 #endif // CHROME_BROWSER_ENHANCED_BOOKMARKS_CHROME_BOOKMARK_SERVER_CLUSTER_SERV
ICE_H_ |
| OLD | NEW |