 Chromium Code Reviews
 Chromium Code Reviews Issue 1408643002:
  [Sync] Componentize synced_tab_delegate  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1408643002:
  [Sync] Componentize synced_tab_delegate  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| OLD | NEW | 
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SYNC_CHROME_SYNC_CLIENT_H__ | 5 #ifndef CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__ | 
| 6 #define CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__ | 6 #define CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__ | 
| 7 | 7 | 
| 8 #include "components/sync_driver/sync_client.h" | 8 #include "components/sync_driver/sync_client.h" | 
| 9 #include "components/sync_sessions/sync_sessions_client.h" | |
| 9 | 10 | 
| 10 class Profile; | 11 class Profile; | 
| 11 | 12 | 
| 12 namespace sync_driver { | 13 namespace sync_driver { | 
| 13 class SyncApiComponentFactory; | 14 class SyncApiComponentFactory; | 
| 14 class SyncService; | 15 class SyncService; | 
| 15 } | 16 } | 
| 16 | 17 | 
| 17 namespace browser_sync { | 18 namespace browser_sync { | 
| 18 | 19 | 
| 20 class SyncSessionsClientImpl; | |
| 21 | |
| 19 class ChromeSyncClient : public sync_driver::SyncClient { | 22 class ChromeSyncClient : public sync_driver::SyncClient { | 
| 20 public: | 23 public: | 
| 21 ChromeSyncClient( | 24 ChromeSyncClient( | 
| 22 Profile* profile, | 25 Profile* profile, | 
| 23 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory); | 26 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory); | 
| 24 ~ChromeSyncClient() override; | 27 ~ChromeSyncClient() override; | 
| 25 | 28 | 
| 26 // Initializes the ChromeSyncClient internal state. | 29 // Initializes the ChromeSyncClient internal state. | 
| 27 void Initialize(sync_driver::SyncService* sync_service) override; | 30 void Initialize(sync_driver::SyncService* sync_service) override; | 
| 28 | 31 | 
| 29 // SyncClient implementation. | 32 // SyncClient implementation. | 
| 30 sync_driver::SyncService* GetSyncService() override; | 33 sync_driver::SyncService* GetSyncService() override; | 
| 31 PrefService* GetPrefService() override; | 34 PrefService* GetPrefService() override; | 
| 32 bookmarks::BookmarkModel* GetBookmarkModel() override; | 35 bookmarks::BookmarkModel* GetBookmarkModel() override; | 
| 33 favicon::FaviconService* GetFaviconService() override; | 36 favicon::FaviconService* GetFaviconService() override; | 
| 34 history::HistoryService* GetHistoryService() override; | 37 history::HistoryService* GetHistoryService() override; | 
| 35 scoped_refptr<password_manager::PasswordStore> GetPasswordStore() override; | 38 scoped_refptr<password_manager::PasswordStore> GetPasswordStore() override; | 
| 36 autofill::PersonalDataManager* GetPersonalDataManager() override; | 39 autofill::PersonalDataManager* GetPersonalDataManager() override; | 
| 37 scoped_refptr<autofill::AutofillWebDataService> GetWebDataService() override; | 40 scoped_refptr<autofill::AutofillWebDataService> GetWebDataService() override; | 
| 38 BookmarkUndoService* GetBookmarkUndoServiceIfExists() override; | 41 BookmarkUndoService* GetBookmarkUndoServiceIfExists() override; | 
| 42 sync_sessions::SyncSessionsClient* GetSyncSessionsClient() override; | |
| 39 base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( | 43 base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( | 
| 40 syncer::ModelType type) override; | 44 syncer::ModelType type) override; | 
| 41 | 45 | 
| 42 sync_driver::SyncApiComponentFactory* GetSyncApiComponentFactory() override; | 46 sync_driver::SyncApiComponentFactory* GetSyncApiComponentFactory() override; | 
| 43 | 47 | 
| 44 private: | 48 private: | 
| 45 Profile* const profile_; | 49 Profile* const profile_; | 
| 46 | 50 | 
| 47 // The sync api component factory in use by this client. | 51 // The sync api component factory in use by this client. | 
| 48 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory_; | 52 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory_; | 
| 49 | 53 | 
| 50 // Members that must be fetched on the UI thread but accessed on their | 54 // Members that must be fetched on the UI thread but accessed on their | 
| 51 // respective backend threads. | 55 // respective backend threads. | 
| 52 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; | 56 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; | 
| 53 scoped_refptr<password_manager::PasswordStore> password_store_; | 57 scoped_refptr<password_manager::PasswordStore> password_store_; | 
| 54 | 58 | 
| 59 scoped_ptr<SyncSessionsClientImpl> sync_sessions_client_; | |
| 
pavely
2015/10/16 21:55:20
You can hold pointer to SyncSessionClient, don't h
 
Nicolas Zea
2015/10/20 23:14:41
Good call, done.
 | |
| 60 | |
| 55 // TODO(zea): this is a member only because Typed URLs needs access to | 61 // TODO(zea): this is a member only because Typed URLs needs access to | 
| 56 // the UserShare and Cryptographer outside of the UI thread. Remove this | 62 // the UserShare and Cryptographer outside of the UI thread. Remove this | 
| 57 // once that's no longer the case. | 63 // once that's no longer the case. | 
| 58 // Note: not owned. | 64 // Note: not owned. | 
| 59 sync_driver::SyncService* sync_service_; | 65 sync_driver::SyncService* sync_service_; | 
| 60 }; | 66 }; | 
| 61 | 67 | 
| 62 } // namespace browser_sync | 68 } // namespace browser_sync | 
| 63 | 69 | 
| 64 #endif // CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__ | 70 #endif // CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__ | 
| OLD | NEW |