| OLD | NEW |
| 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 CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "google_apis/gaia/oauth2_token_service.h" | 41 #include "google_apis/gaia/oauth2_token_service.h" |
| 42 #include "net/base/backoff_entry.h" | 42 #include "net/base/backoff_entry.h" |
| 43 #include "sync/internal_api/public/base/model_type.h" | 43 #include "sync/internal_api/public/base/model_type.h" |
| 44 #include "sync/internal_api/public/engine/model_safe_worker.h" | 44 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 45 #include "sync/internal_api/public/sync_manager_factory.h" | 45 #include "sync/internal_api/public/sync_manager_factory.h" |
| 46 #include "sync/internal_api/public/util/experiments.h" | 46 #include "sync/internal_api/public/util/experiments.h" |
| 47 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" | 47 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" |
| 48 #include "sync/js/sync_js_controller.h" | 48 #include "sync/js/sync_js_controller.h" |
| 49 #include "url/gurl.h" | 49 #include "url/gurl.h" |
| 50 | 50 |
| 51 class ManagedUserSigninManagerWrapper; |
| 51 class Profile; | 52 class Profile; |
| 52 class ProfileOAuth2TokenService; | 53 class ProfileOAuth2TokenService; |
| 53 class ProfileSyncComponentsFactory; | 54 class ProfileSyncComponentsFactory; |
| 54 class SigninManagerBase; | 55 class SigninManagerBase; |
| 55 class SyncGlobalError; | 56 class SyncGlobalError; |
| 56 | 57 |
| 57 namespace browser_sync { | 58 namespace browser_sync { |
| 58 class BackendMigrator; | 59 class BackendMigrator; |
| 59 class ChangeProcessor; | 60 class ChangeProcessor; |
| 60 class DataTypeManager; | 61 class DataTypeManager; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 DATATYPES_NOT_INITIALIZED, | 253 DATATYPES_NOT_INITIALIZED, |
| 253 INITIALIZED, | 254 INITIALIZED, |
| 254 UNKNOWN_ERROR, | 255 UNKNOWN_ERROR, |
| 255 }; | 256 }; |
| 256 | 257 |
| 257 // Default sync server URL. | 258 // Default sync server URL. |
| 258 static const char* kSyncServerUrl; | 259 static const char* kSyncServerUrl; |
| 259 // Sync server URL for dev channel users | 260 // Sync server URL for dev channel users |
| 260 static const char* kDevServerUrl; | 261 static const char* kDevServerUrl; |
| 261 | 262 |
| 262 // Takes ownership of |factory|. | 263 // Takes ownership of |factory| and |signin_wrapper|. |
| 263 ProfileSyncService(ProfileSyncComponentsFactory* factory, | 264 ProfileSyncService(ProfileSyncComponentsFactory* factory, |
| 264 Profile* profile, | 265 Profile* profile, |
| 265 SigninManagerBase* signin, | 266 ManagedUserSigninManagerWrapper* signin_wrapper, |
| 266 ProfileOAuth2TokenService* oauth2_token_service, | 267 ProfileOAuth2TokenService* oauth2_token_service, |
| 267 StartBehavior start_behavior); | 268 StartBehavior start_behavior); |
| 268 virtual ~ProfileSyncService(); | 269 virtual ~ProfileSyncService(); |
| 269 | 270 |
| 270 // Initializes the object. This must be called at most once, and | 271 // Initializes the object. This must be called at most once, and |
| 271 // immediately after an object of this class is constructed. | 272 // immediately after an object of this class is constructed. |
| 272 void Initialize(); | 273 void Initialize(); |
| 273 | 274 |
| 274 virtual void SetSyncSetupCompleted(); | 275 virtual void SetSyncSetupCompleted(); |
| 275 | 276 |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 // this is based on the cryptographer's settings, so if the user has recently | 635 // this is based on the cryptographer's settings, so if the user has recently |
| 635 // requested encryption to be turned on, this may not be true yet. For that, | 636 // requested encryption to be turned on, this may not be true yet. For that, |
| 636 // encryption_pending() must be checked. | 637 // encryption_pending() must be checked. |
| 637 virtual bool EncryptEverythingEnabled() const; | 638 virtual bool EncryptEverythingEnabled() const; |
| 638 | 639 |
| 639 // Returns true if the syncer is waiting for new datatypes to be encrypted. | 640 // Returns true if the syncer is waiting for new datatypes to be encrypted. |
| 640 virtual bool encryption_pending() const; | 641 virtual bool encryption_pending() const; |
| 641 | 642 |
| 642 const GURL& sync_service_url() const { return sync_service_url_; } | 643 const GURL& sync_service_url() const { return sync_service_url_; } |
| 643 bool auto_start_enabled() const { return auto_start_enabled_; } | 644 bool auto_start_enabled() const { return auto_start_enabled_; } |
| 644 SigninManagerBase* signin() const { return signin_; } | 645 SigninManagerBase* signin() const; |
| 645 bool setup_in_progress() const { return setup_in_progress_; } | 646 bool setup_in_progress() const { return setup_in_progress_; } |
| 646 | 647 |
| 647 // Stops the sync backend and sets the flag for suppressing sync startup. | 648 // Stops the sync backend and sets the flag for suppressing sync startup. |
| 648 void StopAndSuppress(); | 649 void StopAndSuppress(); |
| 649 | 650 |
| 650 // Resets the flag for suppressing sync startup and starts the sync backend. | 651 // Resets the flag for suppressing sync startup and starts the sync backend. |
| 651 virtual void UnsuppressAndStart(); | 652 virtual void UnsuppressAndStart(); |
| 652 | 653 |
| 653 // Marks all currently registered types as "acknowledged" so we won't prompt | 654 // Marks all currently registered types as "acknowledged" so we won't prompt |
| 654 // the user about them any more. | 655 // the user about them any more. |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 // ProfileSyncService from starting backend till browser restarted or user | 927 // ProfileSyncService from starting backend till browser restarted or user |
| 927 // signed out. | 928 // signed out. |
| 928 bool sync_disabled_by_admin_; | 929 bool sync_disabled_by_admin_; |
| 929 | 930 |
| 930 // Set to true if a signin has completed but we're still waiting for the | 931 // Set to true if a signin has completed but we're still waiting for the |
| 931 // backend to refresh its credentials. | 932 // backend to refresh its credentials. |
| 932 bool is_auth_in_progress_; | 933 bool is_auth_in_progress_; |
| 933 | 934 |
| 934 // Encapsulates user signin - used to set/get the user's authenticated | 935 // Encapsulates user signin - used to set/get the user's authenticated |
| 935 // email address. | 936 // email address. |
| 936 SigninManagerBase* signin_; | 937 scoped_ptr<ManagedUserSigninManagerWrapper> signin_; |
| 937 | 938 |
| 938 // Information describing an unrecoverable error. | 939 // Information describing an unrecoverable error. |
| 939 UnrecoverableErrorReason unrecoverable_error_reason_; | 940 UnrecoverableErrorReason unrecoverable_error_reason_; |
| 940 std::string unrecoverable_error_message_; | 941 std::string unrecoverable_error_message_; |
| 941 tracked_objects::Location unrecoverable_error_location_; | 942 tracked_objects::Location unrecoverable_error_location_; |
| 942 | 943 |
| 943 // Manages the start and stop of the various data types. | 944 // Manages the start and stop of the various data types. |
| 944 scoped_ptr<browser_sync::DataTypeManager> data_type_manager_; | 945 scoped_ptr<browser_sync::DataTypeManager> data_type_manager_; |
| 945 | 946 |
| 946 ObserverList<ProfileSyncServiceBase::Observer> observers_; | 947 ObserverList<ProfileSyncServiceBase::Observer> observers_; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 scoped_ptr<syncer::NetworkResources> network_resources_; | 1043 scoped_ptr<syncer::NetworkResources> network_resources_; |
| 1043 | 1044 |
| 1044 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 1045 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 1045 }; | 1046 }; |
| 1046 | 1047 |
| 1047 bool ShouldShowActionOnUI( | 1048 bool ShouldShowActionOnUI( |
| 1048 const syncer::SyncProtocolError& error); | 1049 const syncer::SyncProtocolError& error); |
| 1049 | 1050 |
| 1050 | 1051 |
| 1051 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 1052 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |