OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_servi
ce.h" |
| 6 |
| 7 #include "chrome/browser/sync/profile_sync_service.h" |
| 8 #include "components/bookmarks/browser/bookmark_model.h" |
| 9 |
| 10 namespace enhanced_bookmarks { |
| 11 |
| 12 ChromeBookmarkServerClusterService::ChromeBookmarkServerClusterService( |
| 13 const std::string& application_language_code, |
| 14 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
| 15 ProfileOAuth2TokenService* token_service, |
| 16 SigninManagerBase* signin_manager, |
| 17 BookmarkModel* bookmark_model, |
| 18 PrefService* pref_service, |
| 19 ProfileSyncService* sync_service) |
| 20 : BookmarkServerClusterService(application_language_code, |
| 21 request_context_getter, |
| 22 token_service, |
| 23 signin_manager, |
| 24 bookmark_model, |
| 25 pref_service), |
| 26 sync_service_(sync_service) { |
| 27 if (sync_service_) |
| 28 sync_service_->AddObserver(this); |
| 29 } |
| 30 |
| 31 ChromeBookmarkServerClusterService::~ChromeBookmarkServerClusterService() { |
| 32 if (sync_service_) |
| 33 sync_service_->RemoveObserver(this); |
| 34 } |
| 35 |
| 36 void ChromeBookmarkServerClusterService::OnStateChanged() { |
| 37 // Do nothing. |
| 38 } |
| 39 |
| 40 void ChromeBookmarkServerClusterService::OnSyncCycleCompleted() { |
| 41 if (bookmark_model_->loaded()) |
| 42 TriggerTokenRequest(false); |
| 43 } |
| 44 } // namespace enhanced_bookmarks |
OLD | NEW |