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

Side by Side Diff: components/browser_sync/profile_sync_service.h

Issue 2910773003: [Sync] Replace manual DI with SetTestingFactory. (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 5 #ifndef COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
6 #define COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 6 #define COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/gtest_prod_util.h" 15 #include "base/gtest_prod_util.h"
16 #include "base/location.h" 16 #include "base/location.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/memory/memory_pressure_listener.h" 18 #include "base/memory/memory_pressure_listener.h"
19 #include "base/memory/weak_ptr.h" 19 #include "base/memory/weak_ptr.h"
20 #include "base/message_loop/message_loop.h" 20 #include "base/message_loop/message_loop.h"
21 #include "base/observer_list.h" 21 #include "base/observer_list.h"
22 #include "base/strings/string16.h" 22 #include "base/strings/string16.h"
23 #include "base/threading/sequenced_worker_pool.h" 23 #include "base/threading/sequenced_worker_pool.h"
24 #include "base/threading/thread.h" 24 #include "base/threading/thread.h"
25 #include "base/time/time.h" 25 #include "base/time/time.h"
26 #include "base/timer/timer.h" 26 #include "base/timer/timer.h"
27 #include "build/build_config.h" 27 #include "build/build_config.h"
28 #include "components/keyed_service/core/keyed_service.h"
29 #include "components/signin/core/browser/gaia_cookie_manager_service.h" 28 #include "components/signin/core/browser/gaia_cookie_manager_service.h"
30 #include "components/signin/core/browser/signin_manager_base.h" 29 #include "components/signin/core/browser/signin_manager_base.h"
31 #include "components/sync/base/experiments.h" 30 #include "components/sync/base/experiments.h"
32 #include "components/sync/base/model_type.h" 31 #include "components/sync/base/model_type.h"
33 #include "components/sync/base/sync_prefs.h" 32 #include "components/sync/base/sync_prefs.h"
34 #include "components/sync/base/unrecoverable_error_handler.h" 33 #include "components/sync/base/unrecoverable_error_handler.h"
35 #include "components/sync/device_info/local_device_info_provider.h" 34 #include "components/sync/device_info/local_device_info_provider.h"
36 #include "components/sync/driver/data_type_controller.h" 35 #include "components/sync/driver/data_type_controller.h"
37 #include "components/sync/driver/data_type_manager.h" 36 #include "components/sync/driver/data_type_manager.h"
38 #include "components/sync/driver/data_type_manager_observer.h" 37 #include "components/sync/driver/data_type_manager_observer.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // be called while the user is actively configuring their account. The handle 162 // be called while the user is actively configuring their account. The handle
164 // should be deleted once configuration is complete. 163 // should be deleted once configuration is complete.
165 // 164 //
166 // Once first setup has completed and there are no outstanding 165 // Once first setup has completed and there are no outstanding
167 // setup-in-progress handles, CanConfigureDataTypes() will return true and 166 // setup-in-progress handles, CanConfigureDataTypes() will return true and
168 // datatype configuration can begin. 167 // datatype configuration can begin.
169 class ProfileSyncService : public syncer::SyncServiceBase, 168 class ProfileSyncService : public syncer::SyncServiceBase,
170 public syncer::SyncPrefObserver, 169 public syncer::SyncPrefObserver,
171 public syncer::DataTypeManagerObserver, 170 public syncer::DataTypeManagerObserver,
172 public syncer::UnrecoverableErrorHandler, 171 public syncer::UnrecoverableErrorHandler,
173 public KeyedService,
174 public OAuth2TokenService::Consumer, 172 public OAuth2TokenService::Consumer,
175 public OAuth2TokenService::Observer, 173 public OAuth2TokenService::Observer,
176 public SigninManagerBase::Observer, 174 public SigninManagerBase::Observer,
177 public GaiaCookieManagerService::Observer { 175 public GaiaCookieManagerService::Observer {
178 public: 176 public:
179 using Status = syncer::SyncEngine::Status; 177 using Status = syncer::SyncEngine::Status;
180 using PlatformSyncAllowedProvider = base::Callback<bool(void)>; 178 using PlatformSyncAllowedProvider = base::Callback<bool(void)>;
181 179
182 enum SyncEventCodes { 180 enum SyncEventCodes {
183 MIN_SYNC_EVENT_CODE = 0, 181 MIN_SYNC_EVENT_CODE = 0,
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 base::WeakPtrFactory<ProfileSyncService> weak_factory_; 892 base::WeakPtrFactory<ProfileSyncService> weak_factory_;
895 893
896 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 894 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
897 }; 895 };
898 896
899 bool ShouldShowActionOnUI(const syncer::SyncProtocolError& error); 897 bool ShouldShowActionOnUI(const syncer::SyncProtocolError& error);
900 898
901 } // namespace browser_sync 899 } // namespace browser_sync
902 900
903 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 901 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sync_internals_message_handler_unittest.cc ('k') | components/sync/driver/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698