Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6834)

Unified Diff: chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.h

Issue 539173004: Bring up of the enhanced bookmarks cluster service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@intermediary2
Patch Set: Removing empty DEPS file, fixing a nit. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..4cf51f53fc470a21fe5f3f877971cdace9c548df
--- /dev/null
+++ b/chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.h
@@ -0,0 +1,45 @@
+// 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.
+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,
+ BookmarkModel* bookmark_model,
+ PrefService* pref_service,
+ ProfileSyncService* sync_service);
+ virtual ~ChromeBookmarkServerClusterService();
+
+ // ProfileSyncServiceObserver implementation.
+ virtual void OnStateChanged() OVERRIDE;
+ // The stars cluster API relies on the information in chrome-sync. Sending a
+ // 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_

Powered by Google App Engine
This is Rietveld 408576698