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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 // synced if Cryptographer has already been initialized and does not have | 562 // synced if Cryptographer has already been initialized and does not have |
563 // pending keys. | 563 // pending keys. |
564 bool ShouldEnablePasswordSyncForAndroid() const; | 564 bool ShouldEnablePasswordSyncForAndroid() const; |
565 #endif | 565 #endif |
566 | 566 |
567 // Returns true if the syncer is waiting for new datatypes to be encrypted. | 567 // Returns true if the syncer is waiting for new datatypes to be encrypted. |
568 virtual bool encryption_pending() const; | 568 virtual bool encryption_pending() const; |
569 | 569 |
570 const GURL& sync_service_url() const { return sync_service_url_; } | 570 const GURL& sync_service_url() const { return sync_service_url_; } |
571 bool auto_start_enabled() const { return auto_start_enabled_; } | 571 bool auto_start_enabled() const { return auto_start_enabled_; } |
572 SigninManager* signin() const { return signin_; } | 572 SigninManagerBase* signin() const { return signin_; } |
573 bool setup_in_progress() const { return setup_in_progress_; } | 573 bool setup_in_progress() const { return setup_in_progress_; } |
574 | 574 |
575 // Stops the sync backend and sets the flag for suppressing sync startup. | 575 // Stops the sync backend and sets the flag for suppressing sync startup. |
576 void StopAndSuppress(); | 576 void StopAndSuppress(); |
577 | 577 |
578 // Resets the flag for suppressing sync startup and starts the sync backend. | 578 // Resets the flag for suppressing sync startup and starts the sync backend. |
579 void UnsuppressAndStart(); | 579 void UnsuppressAndStart(); |
580 | 580 |
581 // Marks all currently registered types as "acknowledged" so we won't prompt | 581 // Marks all currently registered types as "acknowledged" so we won't prompt |
582 // the user about them any more. | 582 // the user about them any more. |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 | 839 |
840 // Whether the SyncBackendHost has been initialized. | 840 // Whether the SyncBackendHost has been initialized. |
841 bool backend_initialized_; | 841 bool backend_initialized_; |
842 | 842 |
843 // Set to true if a signin has completed but we're still waiting for the | 843 // Set to true if a signin has completed but we're still waiting for the |
844 // backend to refresh its credentials. | 844 // backend to refresh its credentials. |
845 bool is_auth_in_progress_; | 845 bool is_auth_in_progress_; |
846 | 846 |
847 // Encapsulates user signin - used to set/get the user's authenticated | 847 // Encapsulates user signin - used to set/get the user's authenticated |
848 // email address. | 848 // email address. |
849 SigninManager* signin_; | 849 SigninManagerBase* signin_; |
850 | 850 |
851 // Information describing an unrecoverable error. | 851 // Information describing an unrecoverable error. |
852 UnrecoverableErrorReason unrecoverable_error_reason_; | 852 UnrecoverableErrorReason unrecoverable_error_reason_; |
853 std::string unrecoverable_error_message_; | 853 std::string unrecoverable_error_message_; |
854 tracked_objects::Location unrecoverable_error_location_; | 854 tracked_objects::Location unrecoverable_error_location_; |
855 | 855 |
856 // Manages the start and stop of the various data types. | 856 // Manages the start and stop of the various data types. |
857 scoped_ptr<browser_sync::DataTypeManager> data_type_manager_; | 857 scoped_ptr<browser_sync::DataTypeManager> data_type_manager_; |
858 | 858 |
859 ObserverList<Observer> observers_; | 859 ObserverList<Observer> observers_; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; | 937 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; |
938 | 938 |
939 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 939 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
940 }; | 940 }; |
941 | 941 |
942 bool ShouldShowActionOnUI( | 942 bool ShouldShowActionOnUI( |
943 const syncer::SyncProtocolError& error); | 943 const syncer::SyncProtocolError& error); |
944 | 944 |
945 | 945 |
946 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 946 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |