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 <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "googleurl/src/gurl.h" | 40 #include "googleurl/src/gurl.h" |
41 #include "sync/internal_api/public/base/model_type.h" | 41 #include "sync/internal_api/public/base/model_type.h" |
42 #include "sync/internal_api/public/engine/model_safe_worker.h" | 42 #include "sync/internal_api/public/engine/model_safe_worker.h" |
43 #include "sync/internal_api/public/sync_manager_factory.h" | 43 #include "sync/internal_api/public/sync_manager_factory.h" |
44 #include "sync/internal_api/public/util/experiments.h" | 44 #include "sync/internal_api/public/util/experiments.h" |
45 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" | 45 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" |
46 #include "sync/js/sync_js_controller.h" | 46 #include "sync/js/sync_js_controller.h" |
47 | 47 |
48 class Profile; | 48 class Profile; |
49 class ProfileSyncComponentsFactory; | 49 class ProfileSyncComponentsFactory; |
50 class SigninManager; | 50 class SigninManagerBase; |
51 class SyncGlobalError; | 51 class SyncGlobalError; |
52 | 52 |
53 namespace browser_sync { | 53 namespace browser_sync { |
54 class BackendMigrator; | 54 class BackendMigrator; |
55 class ChangeProcessor; | 55 class ChangeProcessor; |
56 class DeviceInfo; | 56 class DeviceInfo; |
57 class DataTypeManager; | 57 class DataTypeManager; |
58 class JsController; | 58 class JsController; |
59 class SessionModelAssociator; | 59 class SessionModelAssociator; |
60 | 60 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 }; | 212 }; |
213 | 213 |
214 // Default sync server URL. | 214 // Default sync server URL. |
215 static const char* kSyncServerUrl; | 215 static const char* kSyncServerUrl; |
216 // Sync server URL for dev channel users | 216 // Sync server URL for dev channel users |
217 static const char* kDevServerUrl; | 217 static const char* kDevServerUrl; |
218 | 218 |
219 // Takes ownership of |factory|. | 219 // Takes ownership of |factory|. |
220 ProfileSyncService(ProfileSyncComponentsFactory* factory, | 220 ProfileSyncService(ProfileSyncComponentsFactory* factory, |
221 Profile* profile, | 221 Profile* profile, |
222 SigninManager* signin, | 222 SigninManagerBase* signin, |
223 StartBehavior start_behavior); | 223 StartBehavior start_behavior); |
224 virtual ~ProfileSyncService(); | 224 virtual ~ProfileSyncService(); |
225 | 225 |
226 // Initializes the object. This must be called at most once, and | 226 // Initializes the object. This must be called at most once, and |
227 // immediately after an object of this class is constructed. | 227 // immediately after an object of this class is constructed. |
228 void Initialize(); | 228 void Initialize(); |
229 | 229 |
230 virtual void SetSyncSetupCompleted(); | 230 virtual void SetSyncSetupCompleted(); |
231 | 231 |
232 // ProfileSyncServiceBase implementation. | 232 // ProfileSyncServiceBase implementation. |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 // synced if Cryptographer has already been initialized and does not have | 556 // synced if Cryptographer has already been initialized and does not have |
557 // pending keys. | 557 // pending keys. |
558 bool ShouldEnablePasswordSyncForAndroid() const; | 558 bool ShouldEnablePasswordSyncForAndroid() const; |
559 #endif | 559 #endif |
560 | 560 |
561 // Returns true if the syncer is waiting for new datatypes to be encrypted. | 561 // Returns true if the syncer is waiting for new datatypes to be encrypted. |
562 virtual bool encryption_pending() const; | 562 virtual bool encryption_pending() const; |
563 | 563 |
564 const GURL& sync_service_url() const { return sync_service_url_; } | 564 const GURL& sync_service_url() const { return sync_service_url_; } |
565 bool auto_start_enabled() const { return auto_start_enabled_; } | 565 bool auto_start_enabled() const { return auto_start_enabled_; } |
566 SigninManager* signin() const { return signin_; } | 566 SigninManagerBase* signin() const { return signin_; } |
567 bool setup_in_progress() const { return setup_in_progress_; } | 567 bool setup_in_progress() const { return setup_in_progress_; } |
568 | 568 |
569 // Stops the sync backend and sets the flag for suppressing sync startup. | 569 // Stops the sync backend and sets the flag for suppressing sync startup. |
570 void StopAndSuppress(); | 570 void StopAndSuppress(); |
571 | 571 |
572 // Resets the flag for suppressing sync startup and starts the sync backend. | 572 // Resets the flag for suppressing sync startup and starts the sync backend. |
573 void UnsuppressAndStart(); | 573 void UnsuppressAndStart(); |
574 | 574 |
575 // Marks all currently registered types as "acknowledged" so we won't prompt | 575 // Marks all currently registered types as "acknowledged" so we won't prompt |
576 // the user about them any more. | 576 // the user about them any more. |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 | 833 |
834 // Whether the SyncBackendHost has been initialized. | 834 // Whether the SyncBackendHost has been initialized. |
835 bool backend_initialized_; | 835 bool backend_initialized_; |
836 | 836 |
837 // Set to true if a signin has completed but we're still waiting for the | 837 // Set to true if a signin has completed but we're still waiting for the |
838 // backend to refresh its credentials. | 838 // backend to refresh its credentials. |
839 bool is_auth_in_progress_; | 839 bool is_auth_in_progress_; |
840 | 840 |
841 // Encapsulates user signin - used to set/get the user's authenticated | 841 // Encapsulates user signin - used to set/get the user's authenticated |
842 // email address. | 842 // email address. |
843 SigninManager* signin_; | 843 SigninManagerBase* signin_; |
844 | 844 |
845 // Information describing an unrecoverable error. | 845 // Information describing an unrecoverable error. |
846 UnrecoverableErrorReason unrecoverable_error_reason_; | 846 UnrecoverableErrorReason unrecoverable_error_reason_; |
847 std::string unrecoverable_error_message_; | 847 std::string unrecoverable_error_message_; |
848 tracked_objects::Location unrecoverable_error_location_; | 848 tracked_objects::Location unrecoverable_error_location_; |
849 | 849 |
850 // Manages the start and stop of the various data types. | 850 // Manages the start and stop of the various data types. |
851 scoped_ptr<browser_sync::DataTypeManager> data_type_manager_; | 851 scoped_ptr<browser_sync::DataTypeManager> data_type_manager_; |
852 | 852 |
853 ObserverList<Observer> observers_; | 853 ObserverList<Observer> observers_; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; | 931 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; |
932 | 932 |
933 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 933 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
934 }; | 934 }; |
935 | 935 |
936 bool ShouldShowActionOnUI( | 936 bool ShouldShowActionOnUI( |
937 const syncer::SyncProtocolError& error); | 937 const syncer::SyncProtocolError& error); |
938 | 938 |
939 | 939 |
940 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 940 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |