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

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

Issue 2494873003: [Sync] Allow sync start without sign-in if the local sync backend is on. (Closed)
Patch Set: Remove ifdefs around include. Created 4 years 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>
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 std::unique_ptr<SigninManagerWrapper> signin_wrapper; 238 std::unique_ptr<SigninManagerWrapper> signin_wrapper;
239 ProfileOAuth2TokenService* oauth2_token_service = nullptr; 239 ProfileOAuth2TokenService* oauth2_token_service = nullptr;
240 GaiaCookieManagerService* gaia_cookie_manager_service = nullptr; 240 GaiaCookieManagerService* gaia_cookie_manager_service = nullptr;
241 StartBehavior start_behavior = MANUAL_START; 241 StartBehavior start_behavior = MANUAL_START;
242 syncer::NetworkTimeUpdateCallback network_time_update_callback; 242 syncer::NetworkTimeUpdateCallback network_time_update_callback;
243 base::FilePath base_directory; 243 base::FilePath base_directory;
244 scoped_refptr<net::URLRequestContextGetter> url_request_context; 244 scoped_refptr<net::URLRequestContextGetter> url_request_context;
245 std::string debug_identifier; 245 std::string debug_identifier;
246 version_info::Channel channel = version_info::Channel::UNKNOWN; 246 version_info::Channel channel = version_info::Channel::UNKNOWN;
247 base::SequencedWorkerPool* blocking_pool = nullptr; 247 base::SequencedWorkerPool* blocking_pool = nullptr;
248 base::FilePath local_sync_backend_folder;
248 249
249 private: 250 private:
250 DISALLOW_COPY_AND_ASSIGN(InitParams); 251 DISALLOW_COPY_AND_ASSIGN(InitParams);
251 }; 252 };
252 253
253 explicit ProfileSyncService(InitParams init_params); 254 explicit ProfileSyncService(InitParams init_params);
254 255
255 ~ProfileSyncService() override; 256 ~ProfileSyncService() override;
256 257
257 // Initializes the object. This must be called at most once, and 258 // Initializes the object. This must be called at most once, and
258 // immediately after an object of this class is constructed. 259 // immediately after an object of this class is constructed.
259 void Initialize(); 260 void Initialize();
260 261
261 // syncer::SyncService implementation 262 // syncer::SyncService implementation
262 bool IsFirstSetupComplete() const override; 263 bool IsFirstSetupComplete() const override;
263 bool IsSyncAllowed() const override; 264 bool IsSyncAllowed() const override;
264 bool IsSyncActive() const override; 265 bool IsSyncActive() const override;
266 bool IsLocalSyncEnabled() const override;
265 void TriggerRefresh(const syncer::ModelTypeSet& types) override; 267 void TriggerRefresh(const syncer::ModelTypeSet& types) override;
266 void OnDataTypeRequestsSyncStartup(syncer::ModelType type) override; 268 void OnDataTypeRequestsSyncStartup(syncer::ModelType type) override;
267 bool CanSyncStart() const override; 269 bool CanSyncStart() const override;
268 void RequestStop(SyncStopDataFate data_fate) override; 270 void RequestStop(SyncStopDataFate data_fate) override;
269 void RequestStart() override; 271 void RequestStart() override;
270 syncer::ModelTypeSet GetActiveDataTypes() const override; 272 syncer::ModelTypeSet GetActiveDataTypes() const override;
271 syncer::SyncClient* GetSyncClient() const override; 273 syncer::SyncClient* GetSyncClient() const override;
272 syncer::ModelTypeSet GetPreferredDataTypes() const override; 274 syncer::ModelTypeSet GetPreferredDataTypes() const override;
273 void OnUserChoseDatatypes(bool sync_everything, 275 void OnUserChoseDatatypes(bool sync_everything,
274 syncer::ModelTypeSet chosen_types) override; 276 syncer::ModelTypeSet chosen_types) override;
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 809
808 // Set when sync receives DISABLED_BY_ADMIN error from server. Prevents 810 // Set when sync receives DISABLED_BY_ADMIN error from server. Prevents
809 // ProfileSyncService from starting engine till browser restarted or user 811 // ProfileSyncService from starting engine till browser restarted or user
810 // signed out. 812 // signed out.
811 bool sync_disabled_by_admin_; 813 bool sync_disabled_by_admin_;
812 814
813 // Set to true if a signin has completed but we're still waiting for the 815 // Set to true if a signin has completed but we're still waiting for the
814 // engine to refresh its credentials. 816 // engine to refresh its credentials.
815 bool is_auth_in_progress_; 817 bool is_auth_in_progress_;
816 818
819 // The location where the local sync backend stores its data.
820 base::FilePath local_sync_backend_folder_;
821
817 // Information describing an unrecoverable error. 822 // Information describing an unrecoverable error.
818 UnrecoverableErrorReason unrecoverable_error_reason_; 823 UnrecoverableErrorReason unrecoverable_error_reason_;
819 std::string unrecoverable_error_message_; 824 std::string unrecoverable_error_message_;
820 tracked_objects::Location unrecoverable_error_location_; 825 tracked_objects::Location unrecoverable_error_location_;
821 826
822 // Manages the start and stop of the data types. 827 // Manages the start and stop of the data types.
823 std::unique_ptr<syncer::DataTypeManager> data_type_manager_; 828 std::unique_ptr<syncer::DataTypeManager> data_type_manager_;
824 829
825 base::ObserverList<syncer::SyncServiceObserver> observers_; 830 base::ObserverList<syncer::SyncServiceObserver> observers_;
826 base::ObserverList<syncer::ProtocolEventObserver> protocol_event_observers_; 831 base::ObserverList<syncer::ProtocolEventObserver> protocol_event_observers_;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 base::WeakPtrFactory<ProfileSyncService> weak_factory_; 960 base::WeakPtrFactory<ProfileSyncService> weak_factory_;
956 961
957 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 962 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
958 }; 963 };
959 964
960 bool ShouldShowActionOnUI(const syncer::SyncProtocolError& error); 965 bool ShouldShowActionOnUI(const syncer::SyncProtocolError& error);
961 966
962 } // namespace browser_sync 967 } // namespace browser_sync
963 968
964 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 969 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/sync/sync_promo_ui.cc ('k') | components/browser_sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698