Chromium Code Reviews| Index: chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.h |
| diff --git a/chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.h b/chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b789c101bfca0a4f823f51f537114b72061517f6 |
| --- /dev/null |
| +++ b/chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_ENHANCED_BOOKMARKS_CHROME_BOOKMARK_SERVER_CLUSTER_SERVICE_H_ |
| +#define CHROME_BROWSER_ENHANCED_BOOKMARKS_CHROME_BOOKMARK_SERVER_CLUSTER_SERVICE_H_ |
| + |
| +#include "chrome/browser/sync/profile_sync_service_observer.h" |
| +#include "components/enhanced_bookmarks/bookmark_server_cluster_service.h" |
| + |
| +class ProfileSyncService; |
| + |
| +namespace enhanced_bookmarks { |
| + |
| +// Manages requests to the bookmark server to do just-in-time requests. |
|
sky
2014/10/06 18:24:11
It isn't clear to me at all what any of this code
noyau (Ping after 24h)
2014/10/07 11:11:57
Updated the comment.
|
| +class ChromeBookmarkServerClusterService : public BookmarkServerClusterService, |
| + public ProfileSyncServiceObserver { |
| + public: |
| + ChromeBookmarkServerClusterService( |
| + const std::string& application_language_code, |
| + scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
| + ProfileOAuth2TokenService* token_service, |
| + SigninManagerBase* signin_manager, |
| + EnhancedBookmarkModel* enhanced_bookmark_model, |
| + PrefService* pref_service, |
| + ProfileSyncService* sync_service); |
| + virtual ~ChromeBookmarkServerClusterService(); |
| + |
| + // ProfileSyncServiceObserver implementation. |
| + virtual void OnStateChanged() OVERRIDE; |
|
sky
2014/10/06 18:24:11
OVERRIDE->override
noyau (Ping after 24h)
2014/10/07 11:11:57
This CL actually predates that :). I fixed it in a
|
| + // The stars cluster API relies on the information in chrome-sync. Sending a |
|
sky
2014/10/06 18:24:11
Style guide says no comments like this for overrid
noyau (Ping after 24h)
2014/10/07 11:11:57
Moved.
|
| + // cluster request immediately after a bookmark is changed from the bookmark |
| + // observer notification will yield the wrong results. The request must be |
| + // delayed until the sync cycle has completed. |
| + virtual void OnSyncCycleCompleted() OVERRIDE; |
| + |
| + private: |
| + // This class observes the sync service for changes. |
| + ProfileSyncService* sync_service_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkServerClusterService); |
| +}; |
| + |
| +} // namespace enhanced_bookmarks |
| + |
| +#endif // CHROME_BROWSER_ENHANCED_BOOKMARKS_CHROME_BOOKMARK_SERVER_CLUSTER_SERVICE_H_ |