[email protected] | 66761b95 | 2010-06-25 21:30:38 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 6 | #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 7 | #pragma once |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 8 | |
| 9 | #include <string> |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 10 | |
| 11 | #include "base/basictypes.h" |
[email protected] | 61b694a | 2010-06-10 10:40:46 | [diff] [blame] | 12 | #include "base/gtest_prod_util.h" |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 13 | #include "base/observer_list.h" |
| 14 | #include "base/scoped_ptr.h" |
[email protected] | 06614687 | 2010-08-05 00:55:08 | [diff] [blame] | 15 | #include "base/string16.h" |
[email protected] | 4aea04a | 2010-02-10 20:13:43 | [diff] [blame] | 16 | #include "base/time.h" |
[email protected] | 990de36 | 2010-10-13 17:55:50 | [diff] [blame] | 17 | #include "base/timer.h" |
[email protected] | 37858e5 | 2010-08-26 00:22:02 | [diff] [blame] | 18 | #include "chrome/browser/prefs/pref_member.h" |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 19 | #include "chrome/browser/sync/engine/syncapi.h" |
[email protected] | 72a31b4 | 2010-02-17 22:26:33 | [diff] [blame] | 20 | #include "chrome/browser/sync/glue/data_type_controller.h" |
[email protected] | e3e43d9 | 2010-02-26 22:02:38 | [diff] [blame] | 21 | #include "chrome/browser/sync/glue/data_type_manager.h" |
[email protected] | 5edb922 | 2010-08-18 00:23:29 | [diff] [blame] | 22 | #include "chrome/browser/sync/glue/session_model_associator.h" |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 23 | #include "chrome/browser/sync/glue/sync_backend_host.h" |
[email protected] | d3b98c8 | 2010-07-14 07:45:59 | [diff] [blame] | 24 | #include "chrome/browser/sync/profile_sync_service_observer.h" |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 25 | #include "chrome/browser/sync/signin_manager.h" |
[email protected] | d80033e | 2009-10-16 10:32:04 | [diff] [blame] | 26 | #include "chrome/browser/sync/sync_setup_wizard.h" |
[email protected] | 4aea04a | 2010-02-10 20:13:43 | [diff] [blame] | 27 | #include "chrome/browser/sync/syncable/model_type.h" |
[email protected] | eafb218 | 2010-03-03 00:46:31 | [diff] [blame] | 28 | #include "chrome/browser/sync/unrecoverable_error_handler.h" |
[email protected] | 99074c5 | 2010-08-19 18:44:19 | [diff] [blame] | 29 | #include "chrome/common/net/gaia/google_service_auth_error.h" |
[email protected] | c4c672a | 2010-03-23 21:47:04 | [diff] [blame] | 30 | #include "chrome/common/notification_observer.h" |
| 31 | #include "chrome/common/notification_registrar.h" |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 32 | #include "googleurl/src/gurl.h" |
[email protected] | 33cd004 | 2010-09-08 19:25:28 | [diff] [blame] | 33 | #include "jingle/notifier/base/notifier_options.h" |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 34 | |
[email protected] | c4c672a | 2010-03-23 21:47:04 | [diff] [blame] | 35 | class NotificationDetails; |
| 36 | class NotificationSource; |
| 37 | class NotificationType; |
[email protected] | 942690b13 | 2010-05-11 06:42:14 | [diff] [blame] | 38 | class Profile; |
| 39 | class ProfileSyncFactory; |
[email protected] | 22d3eff | 2011-01-08 01:45:18 | [diff] [blame] | 40 | class TabContents; |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 41 | class TokenMigrator; |
[email protected] | c4c672a | 2010-03-23 21:47:04 | [diff] [blame] | 42 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 43 | // ProfileSyncService is the layer between browser subsystems like bookmarks, |
[email protected] | a1c2aef6 | 2010-04-02 02:58:05 | [diff] [blame] | 44 | // and the sync backend. Each subsystem is logically thought of as being |
| 45 | // a sync datatype. |
| 46 | // |
| 47 | // Individual datatypes can, at any point, be in a variety of stages of being |
| 48 | // "enabled". Here are some specific terms for concepts used in this class: |
| 49 | // |
| 50 | // 'Registered' (feature suppression for a datatype) |
| 51 | // |
| 52 | // When a datatype is registered, the user has the option of syncing it. |
| 53 | // The sync opt-in UI will show only registered types; a checkbox should |
| 54 | // never be shown for an unregistered type, and nor should it ever be |
| 55 | // synced. |
| 56 | // |
| 57 | // A datatype is considered registered once RegisterDataTypeController |
| 58 | // has been called with that datatype's DataTypeController. |
| 59 | // |
| 60 | // 'Preferred' (user preferences and opt-out for a datatype) |
| 61 | // |
| 62 | // This means the user's opt-in or opt-out preference on a per-datatype |
| 63 | // basis. The sync service will try to make active exactly these types. |
| 64 | // If a user has opted out of syncing a particular datatype, it will |
| 65 | // be registered, but not preferred. |
| 66 | // |
| 67 | // This state is controlled by the ConfigurePreferredDataTypes and |
| 68 | // GetPreferredDataTypes. They are stored in the preferences system, |
| 69 | // and persist; though if a datatype is not registered, it cannot |
| 70 | // be a preferred datatype. |
| 71 | // |
| 72 | // 'Active' (run-time initialization of sync system for a datatype) |
| 73 | // |
| 74 | // An active datatype is a preferred datatype that is actively being |
| 75 | // synchronized: the syncer has been instructed to querying the server |
| 76 | // for this datatype, first-time merges have finished, and there is an |
| 77 | // actively installed ChangeProcessor that listens for changes to this |
| 78 | // datatype, propagating such changes into and out of the sync backend |
| 79 | // as necessary. |
| 80 | // |
| 81 | // When a datatype is in the process of becoming active, it may be |
| 82 | // in some intermediate state. Those finer-grained intermediate states |
| 83 | // are differentiated by the DataTypeController state. |
| 84 | // |
[email protected] | 4aea04a | 2010-02-10 20:13:43 | [diff] [blame] | 85 | class ProfileSyncService : public browser_sync::SyncFrontend, |
[email protected] | c4c672a | 2010-03-23 21:47:04 | [diff] [blame] | 86 | public browser_sync::UnrecoverableErrorHandler, |
| 87 | public NotificationObserver { |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 88 | public: |
| 89 | typedef ProfileSyncServiceObserver Observer; |
| 90 | typedef browser_sync::SyncBackendHost::Status Status; |
| 91 | |
[email protected] | 1f97a11 | 2009-08-11 02:17:06 | [diff] [blame] | 92 | enum SyncEventCodes { |
| 93 | MIN_SYNC_EVENT_CODE = 0, |
| 94 | |
| 95 | // Events starting the sync service. |
| 96 | START_FROM_NTP = 1, // Sync was started from the ad in NTP |
| 97 | START_FROM_WRENCH = 2, // Sync was started from the Wrench menu. |
| 98 | START_FROM_OPTIONS = 3, // Sync was started from Wrench->Options. |
[email protected] | b220d13f | 2009-10-09 04:12:46 | [diff] [blame] | 99 | START_FROM_BOOKMARK_MANAGER = 4, // Sync was started from Bookmark manager. |
[email protected] | 1f97a11 | 2009-08-11 02:17:06 | [diff] [blame] | 100 | |
[email protected] | a7ab833 | 2010-03-31 20:49:04 | [diff] [blame] | 101 | // Events regarding cancellation of the signon process of sync. |
[email protected] | 8ac2dc11 | 2009-10-01 23:19:13 | [diff] [blame] | 102 | CANCEL_FROM_SIGNON_WITHOUT_AUTH = 10, // Cancelled before submitting |
[email protected] | 1f97a11 | 2009-08-11 02:17:06 | [diff] [blame] | 103 | // username and password. |
| 104 | CANCEL_DURING_SIGNON = 11, // Cancelled after auth. |
[email protected] | c976938f | 2010-10-12 04:55:44 | [diff] [blame] | 105 | CANCEL_DURING_CONFIGURE = 12, // Cancelled before choosing data |
[email protected] | 8c94d63 | 2010-06-25 22:38:00 | [diff] [blame] | 106 | // types and clicking OK. |
[email protected] | 1f97a11 | 2009-08-11 02:17:06 | [diff] [blame] | 107 | // Events resulting in the stoppage of sync service. |
| 108 | STOP_FROM_OPTIONS = 20, // Sync was stopped from Wrench->Options. |
| 109 | |
| 110 | // Miscellaneous events caused by sync service. |
[email protected] | 1f97a11 | 2009-08-11 02:17:06 | [diff] [blame] | 111 | |
| 112 | MAX_SYNC_EVENT_CODE |
| 113 | }; |
| 114 | |
[email protected] | 689a7a7 | 2010-09-29 19:56:41 | [diff] [blame] | 115 | // Keep track of where we are when clearing server data. |
| 116 | enum ClearServerDataState { |
| 117 | CLEAR_NOT_STARTED = 1, |
| 118 | CLEAR_CLEARING = 2, |
| 119 | CLEAR_FAILED = 3, |
| 120 | CLEAR_SUCCEEDED = 4, |
| 121 | }; |
| 122 | |
[email protected] | f66bcdf | 2010-05-17 20:31:14 | [diff] [blame] | 123 | // Default sync server URL. |
| 124 | static const char* kSyncServerUrl; |
| 125 | // Sync server URL for dev channel users |
| 126 | static const char* kDevServerUrl; |
| 127 | |
[email protected] | e3e43d9 | 2010-02-26 22:02:38 | [diff] [blame] | 128 | ProfileSyncService(ProfileSyncFactory* factory_, |
| 129 | Profile* profile, |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 130 | const std::string& cros_user); |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 131 | virtual ~ProfileSyncService(); |
| 132 | |
| 133 | // Initializes the object. This should be called every time an object of this |
| 134 | // class is constructed. |
| 135 | void Initialize(); |
| 136 | |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 137 | void RegisterAuthNotifications(); |
| 138 | |
| 139 | // Return whether all sync tokens are loaded and |
| 140 | // available for the backend to start up. |
| 141 | bool AreCredentialsAvailable(); |
| 142 | |
| 143 | // Loads credentials migrated from the old user settings db. |
| 144 | void LoadMigratedCredentials(const std::string& username, |
| 145 | const std::string& token); |
| 146 | |
[email protected] | 4aea04a | 2010-02-10 20:13:43 | [diff] [blame] | 147 | // Registers a data type controller with the sync service. This |
| 148 | // makes the data type controller available for use, it does not |
| 149 | // enable or activate the synchronization of the data type (see |
| 150 | // ActivateDataType). Takes ownership of the pointer. |
| 151 | void RegisterDataTypeController( |
| 152 | browser_sync::DataTypeController* data_type_controller); |
| 153 | |
[email protected] | 5edb922 | 2010-08-18 00:23:29 | [diff] [blame] | 154 | // Returns the session model associator associated with this type, but only if |
| 155 | // the associator is running. If it is doing anything else, it will return |
| 156 | // null. |
| 157 | browser_sync::SessionModelAssociator* GetSessionModelAssociator(); |
| 158 | |
[email protected] | 689a7a7 | 2010-09-29 19:56:41 | [diff] [blame] | 159 | // Maintain state of where we are in a server clear operation. |
| 160 | void ResetClearServerDataState(); |
| 161 | ClearServerDataState GetClearServerDataState(); |
| 162 | |
[email protected] | a7ab833 | 2010-03-31 20:49:04 | [diff] [blame] | 163 | // Fills state_map with a map of current data types that are possible to |
| 164 | // sync, as well as their states. |
| 165 | void GetDataTypeControllerStates( |
| 166 | browser_sync::DataTypeController::StateMap* state_map) const; |
[email protected] | 4aea04a | 2010-02-10 20:13:43 | [diff] [blame] | 167 | |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 168 | // Disables sync for user. Use ShowLoginDialog to enable. |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 169 | virtual void DisableForUser(); |
| 170 | |
[email protected] | 1ce52aa | 2010-09-08 19:07:36 | [diff] [blame] | 171 | // Clears all Chromesync data from the server. |
| 172 | void ClearServerData(); |
| 173 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 174 | // Whether sync is enabled by user or not. |
[email protected] | 4772b07 | 2010-03-30 17:45:46 | [diff] [blame] | 175 | virtual bool HasSyncSetupCompleted() const; |
[email protected] | 2efebbbf | 2010-10-25 10:31:21 | [diff] [blame] | 176 | virtual void SetSyncSetupCompleted(); |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 177 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 178 | // SyncFrontend implementation. |
| 179 | virtual void OnBackendInitialized(); |
| 180 | virtual void OnSyncCycleCompleted(); |
| 181 | virtual void OnAuthError(); |
[email protected] | 7f8abea | 2010-07-14 01:31:36 | [diff] [blame] | 182 | virtual void OnStopSyncingPermanently(); |
[email protected] | 1ce52aa | 2010-09-08 19:07:36 | [diff] [blame] | 183 | virtual void OnClearServerDataFailed(); |
[email protected] | 990de36 | 2010-10-13 17:55:50 | [diff] [blame] | 184 | virtual void OnClearServerDataTimeout(); |
[email protected] | 1ce52aa | 2010-09-08 19:07:36 | [diff] [blame] | 185 | virtual void OnClearServerDataSucceeded(); |
[email protected] | 1a78769 | 2011-01-19 22:19:46 | [diff] [blame] | 186 | virtual void OnPassphraseRequired(bool for_decryption); |
| 187 | virtual void OnPassphraseAccepted(); |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 188 | |
| 189 | // Called when a user enters credentials through UI. |
| 190 | virtual void OnUserSubmittedAuth(const std::string& username, |
[email protected] | 1fc9b3f | 2009-11-12 21:22:09 | [diff] [blame] | 191 | const std::string& password, |
[email protected] | 96209ccd | 2010-10-11 21:57:27 | [diff] [blame] | 192 | const std::string& captcha, |
| 193 | const std::string& access_code); |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 194 | |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 195 | // Update the last auth error and notify observers of error state. |
| 196 | void UpdateAuthErrorState(const GoogleServiceAuthError& error); |
| 197 | |
[email protected] | af90949 | 2010-06-10 18:45:38 | [diff] [blame] | 198 | // Called when a user chooses which data types to sync as part of the sync |
| 199 | // setup wizard. |sync_everything| represents whether they chose the |
[email protected] | 8c94d63 | 2010-06-25 22:38:00 | [diff] [blame] | 200 | // "keep everything synced" option; if true, |chosen_types| will be ignored |
| 201 | // and all data types will be synced. |sync_everything| means "sync all |
| 202 | // current and future data types." |
[email protected] | af90949 | 2010-06-10 18:45:38 | [diff] [blame] | 203 | virtual void OnUserChoseDatatypes(bool sync_everything, |
[email protected] | 8c94d63 | 2010-06-25 22:38:00 | [diff] [blame] | 204 | const syncable::ModelTypeSet& chosen_types); |
[email protected] | af90949 | 2010-06-10 18:45:38 | [diff] [blame] | 205 | |
[email protected] | a7ab833 | 2010-03-31 20:49:04 | [diff] [blame] | 206 | // Called when a user cancels any setup dialog (login, etc). |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 207 | virtual void OnUserCancelledDialog(); |
| 208 | |
| 209 | // Get various information for displaying in the user interface. |
| 210 | browser_sync::SyncBackendHost::StatusSummary QuerySyncStatusSummary(); |
[email protected] | f1e6e021 | 2010-10-15 20:54:24 | [diff] [blame] | 211 | virtual browser_sync::SyncBackendHost::Status QueryDetailedSyncStatus(); |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 212 | |
[email protected] | 712257e | 2009-11-11 22:57:46 | [diff] [blame] | 213 | const GoogleServiceAuthError& GetAuthError() const { |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 214 | return last_auth_error_; |
| 215 | } |
| 216 | |
| 217 | // Displays a dialog for the user to enter GAIA credentials and attempt |
| 218 | // re-authentication, and returns true if it actually opened the dialog. |
| 219 | // Returns false if a dialog is already showing, an auth attempt is in |
| 220 | // progress, the sync system is already authenticated, or some error |
| 221 | // occurred preventing the action. We make it the duty of ProfileSyncService |
| 222 | // to open the dialog to easily ensure only one is ever showing. |
[email protected] | d688559 | 2010-10-11 19:38:24 | [diff] [blame] | 223 | virtual bool SetupInProgress() const; |
[email protected] | 44b78f90a | 2009-10-15 17:32:20 | [diff] [blame] | 224 | bool WizardIsVisible() const { |
| 225 | return wizard_.IsVisible(); |
| 226 | } |
[email protected] | d688559 | 2010-10-11 19:38:24 | [diff] [blame] | 227 | virtual void ShowLoginDialog(gfx::NativeWindow parent_window); |
[email protected] | 1c73847 | 2011-01-19 21:48:01 | [diff] [blame] | 228 | |
| 229 | // This method handles clicks on "sync error" UI, showing the appropriate |
| 230 | // dialog for the error condition (relogin / enter passphrase). |
| 231 | virtual void ShowErrorUI(gfx::NativeWindow parent_window); |
| 232 | |
[email protected] | 66d8100 | 2010-10-18 16:52:09 | [diff] [blame] | 233 | void ShowConfigure(gfx::NativeWindow parent_window); |
[email protected] | 22d3eff | 2011-01-08 01:45:18 | [diff] [blame] | 234 | void PromptForExistingPassphrase(gfx::NativeWindow parent_window); |
[email protected] | f0718a39 | 2011-01-21 23:52:56 | [diff] [blame] | 235 | void SigninForPassphraseMigration(gfx::NativeWindow parent_window); |
[email protected] | 8c94d63 | 2010-06-25 22:38:00 | [diff] [blame] | 236 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 237 | // Pretty-printed strings for a given StatusSummary. |
[email protected] | 06614687 | 2010-08-05 00:55:08 | [diff] [blame] | 238 | static std::string BuildSyncStatusSummaryText( |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 239 | const browser_sync::SyncBackendHost::StatusSummary& summary); |
| 240 | |
| 241 | // Returns true if the SyncBackendHost has told us it's ready to accept |
| 242 | // changes. |
[email protected] | cd2ec4b | 2011-01-06 00:09:36 | [diff] [blame] | 243 | // [REMARK] - it is safe to call this function only from the ui thread. |
| 244 | // because the variable is not thread safe and should only be accessed from |
| 245 | // single thread. If we want multiple threads to access this(and there is |
| 246 | // currently no need to do so) we need to protect this with a lock. |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 247 | // TODO(timsteele): What happens if the bookmark model is loaded, a change |
| 248 | // takes place, and the backend isn't initialized yet? |
| 249 | bool sync_initialized() const { return backend_initialized_; } |
[email protected] | ddb1e5a | 2010-12-13 20:10:45 | [diff] [blame] | 250 | virtual bool unrecoverable_error_detected() const; |
[email protected] | f6ec8b2 | 2010-06-08 23:40:06 | [diff] [blame] | 251 | const std::string& unrecoverable_error_message() { |
| 252 | return unrecoverable_error_message_; |
| 253 | } |
| 254 | tracked_objects::Location unrecoverable_error_location() { |
| 255 | return unrecoverable_error_location_.get() ? |
| 256 | *unrecoverable_error_location_.get() : tracked_objects::Location(); |
| 257 | } |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 258 | |
| 259 | bool UIShouldDepictAuthInProgress() const { |
| 260 | return is_auth_in_progress_; |
| 261 | } |
| 262 | |
[email protected] | 2e610e9 | 2011-01-13 23:39:45 | [diff] [blame] | 263 | bool tried_creating_explicit_passphrase() const { |
| 264 | return tried_creating_explicit_passphrase_; |
| 265 | } |
| 266 | |
| 267 | bool tried_setting_explicit_passphrase() const { |
| 268 | return tried_setting_explicit_passphrase_; |
| 269 | } |
| 270 | |
[email protected] | 66d8100 | 2010-10-18 16:52:09 | [diff] [blame] | 271 | bool observed_passphrase_required() const { |
| 272 | return observed_passphrase_required_; |
| 273 | } |
| 274 | |
[email protected] | fc52c42 | 2010-11-19 18:59:23 | [diff] [blame] | 275 | bool passphrase_required_for_decryption() const { |
| 276 | return passphrase_required_for_decryption_; |
| 277 | } |
| 278 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 279 | // A timestamp marking the last time the service observed a transition from |
| 280 | // the SYNCING state to the READY state. Note that this does not reflect the |
| 281 | // last time we polled the server to see if there were any changes; the |
| 282 | // timestamp is only snapped when syncing takes place and we download or |
| 283 | // upload some bookmark entity. |
| 284 | const base::Time& last_synced_time() const { return last_synced_time_; } |
| 285 | |
| 286 | // Returns a user-friendly string form of last synced time (in minutes). |
[email protected] | f1e6e021 | 2010-10-15 20:54:24 | [diff] [blame] | 287 | virtual string16 GetLastSyncedTimeString() const; |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 288 | |
| 289 | // Returns the authenticated username of the sync user, or empty if none |
| 290 | // exists. It will only exist if the authentication service provider (e.g |
| 291 | // GAIA) has confirmed the username is authentic. |
| 292 | virtual string16 GetAuthenticatedUsername() const; |
| 293 | |
| 294 | const std::string& last_attempted_user_email() const { |
| 295 | return last_attempted_user_email_; |
| 296 | } |
| 297 | |
| 298 | // The profile we are syncing for. |
[email protected] | c976938f | 2010-10-12 04:55:44 | [diff] [blame] | 299 | Profile* profile() const { return profile_; } |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 300 | |
| 301 | // Adds/removes an observer. ProfileSyncService does not take ownership of |
| 302 | // the observer. |
[email protected] | 4772b07 | 2010-03-30 17:45:46 | [diff] [blame] | 303 | virtual void AddObserver(Observer* observer); |
| 304 | virtual void RemoveObserver(Observer* observer); |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 305 | |
[email protected] | d1db1c33 | 2010-10-13 19:57:00 | [diff] [blame] | 306 | // Returns true if |observer| has already been added as an observer. |
| 307 | bool HasObserver(Observer* observer) const; |
| 308 | |
[email protected] | 1f97a11 | 2009-08-11 02:17:06 | [diff] [blame] | 309 | // Record stats on various events. |
| 310 | static void SyncEvent(SyncEventCodes code); |
| 311 | |
[email protected] | eec3bcfa | 2009-11-12 17:23:43 | [diff] [blame] | 312 | // Returns whether sync is enabled. Sync can be enabled/disabled both |
| 313 | // at compile time (e.g., on a per-OS basis) or at run time (e.g., |
| 314 | // command-line switches). |
| 315 | static bool IsSyncEnabled(); |
| 316 | |
[email protected] | d1db1c33 | 2010-10-13 19:57:00 | [diff] [blame] | 317 | // Returns whether sync is managed, i.e. controlled by configuration |
[email protected] | d3b98c8 | 2010-07-14 07:45:59 | [diff] [blame] | 318 | // management. If so, the user is not allowed to configure sync. |
| 319 | bool IsManaged(); |
| 320 | |
[email protected] | db1df0f | 2009-08-18 22:36:05 | [diff] [blame] | 321 | // UnrecoverableErrorHandler implementation. |
[email protected] | f6ec8b2 | 2010-06-08 23:40:06 | [diff] [blame] | 322 | virtual void OnUnrecoverableError( |
| 323 | const tracked_objects::Location& from_here, |
| 324 | const std::string& message); |
[email protected] | db1df0f | 2009-08-18 22:36:05 | [diff] [blame] | 325 | |
[email protected] | 42091493 | 2011-01-24 23:32:41 | [diff] [blame^] | 326 | // The functions below (until ActivateDataType()) should only be |
| 327 | // called if sync_initialized() is true. |
| 328 | |
| 329 | // TODO(akalin): This is called mostly by ModelAssociators and |
| 330 | // tests. Figure out how to pass the handle to the ModelAssociators |
| 331 | // directly, figure out how to expose this to tests, and remove this |
| 332 | // function. |
| 333 | sync_api::UserShare* GetUserShare() const; |
| 334 | |
| 335 | // TODO(akalin): These two functions are used only by |
| 336 | // ProfileSyncServiceHarness. Figure out a different way to expose |
| 337 | // this info to that class, and remove these functions. |
| 338 | |
| 339 | const browser_sync::sessions::SyncSessionSnapshot* |
| 340 | GetLastSessionSnapshot() const; |
| 341 | |
| 342 | // Returns whether or not the underlying sync engine has made any |
| 343 | // local changes to items that have not yet been synced with the |
| 344 | // server. |
| 345 | bool HasUnsyncedItems() const; |
| 346 | |
| 347 | // Get the current routing information for all enabled model types. |
| 348 | // If a model type is not enabled (that is, if the syncer should not |
| 349 | // be trying to sync it), it is not in this map. |
| 350 | // |
| 351 | // TODO(akalin): This function is used by |
| 352 | // sync_ui_util::ConstructAboutInformation() and by some test |
| 353 | // classes. Figure out a different way to expose this info and |
| 354 | // remove this function. |
| 355 | void GetModelSafeRoutingInfo(browser_sync::ModelSafeRoutingInfo* out); |
| 356 | |
| 357 | // TODO(akalin): Remove these four functions once we're done with |
| 358 | // autofill migration. |
| 359 | |
| 360 | syncable::AutofillMigrationState |
| 361 | GetAutofillMigrationState(); |
| 362 | |
| 363 | void SetAutofillMigrationState( |
| 364 | syncable::AutofillMigrationState state); |
| 365 | |
| 366 | syncable::AutofillMigrationDebugInfo |
| 367 | GetAutofillMigrationDebugInfo(); |
| 368 | |
| 369 | void SetAutofillMigrationDebugInfo( |
| 370 | syncable::AutofillMigrationDebugInfo::PropertyToSet property_to_set, |
| 371 | const syncable::AutofillMigrationDebugInfo& info); |
[email protected] | db1df0f | 2009-08-18 22:36:05 | [diff] [blame] | 372 | |
[email protected] | 4aea04a | 2010-02-10 20:13:43 | [diff] [blame] | 373 | virtual void ActivateDataType( |
| 374 | browser_sync::DataTypeController* data_type_controller, |
| 375 | browser_sync::ChangeProcessor* change_processor); |
| 376 | virtual void DeactivateDataType( |
| 377 | browser_sync::DataTypeController* data_type_controller, |
| 378 | browser_sync::ChangeProcessor* change_processor); |
| 379 | |
[email protected] | c4c672a | 2010-03-23 21:47:04 | [diff] [blame] | 380 | // NotificationObserver implementation. |
| 381 | virtual void Observe(NotificationType type, |
| 382 | const NotificationSource& source, |
| 383 | const NotificationDetails& details); |
| 384 | |
[email protected] | a1c2aef6 | 2010-04-02 02:58:05 | [diff] [blame] | 385 | // Changes which data types we're going to be syncing to |preferred_types|. |
| 386 | // If it is running, the DataTypeManager will be instructed to reconfigure |
| 387 | // the sync backend so that exactly these datatypes are actively synced. See |
| 388 | // class comment for more on what it means for a datatype to be Preferred. |
| 389 | virtual void ChangePreferredDataTypes( |
| 390 | const syncable::ModelTypeSet& preferred_types); |
| 391 | |
| 392 | // Get the set of currently enabled data types (as chosen or configured by |
| 393 | // the user). See class comment for more on what it means for a datatype |
| 394 | // to be Preferred. |
| 395 | virtual void GetPreferredDataTypes( |
| 396 | syncable::ModelTypeSet* preferred_types) const; |
| 397 | |
| 398 | // Gets the set of all data types that could be allowed (the set that |
| 399 | // should be advertised to the user). These will typically only change |
| 400 | // via a command-line option. See class comment for more on what it means |
| 401 | // for a datatype to be Registered. |
| 402 | virtual void GetRegisteredDataTypes( |
| 403 | syncable::ModelTypeSet* registered_types) const; |
[email protected] | a7ab833 | 2010-03-31 20:49:04 | [diff] [blame] | 404 | |
[email protected] | ff0aa75 | 2010-06-10 22:40:52 | [diff] [blame] | 405 | // Checks whether the Cryptographer is ready to encrypt and decrypt updates |
| 406 | // for sensitive data types. |
| 407 | virtual bool IsCryptographerReady() const; |
| 408 | |
[email protected] | c976938f | 2010-10-12 04:55:44 | [diff] [blame] | 409 | // Returns true if a secondary passphrase is being used. |
| 410 | virtual bool IsUsingSecondaryPassphrase() const; |
| 411 | |
[email protected] | ee1adf4b | 2010-10-11 03:48:48 | [diff] [blame] | 412 | // Sets the Cryptographer's passphrase, or caches it until that is possible. |
| 413 | // This will check asynchronously whether the passphrase is valid and notify |
[email protected] | dc39dd1b | 2010-10-07 18:08:11 | [diff] [blame] | 414 | // ProfileSyncServiceObservers via the NotificationService when the outcome |
| 415 | // is known. |
[email protected] | 954b108 | 2010-11-10 20:22:50 | [diff] [blame] | 416 | // |is_explicit| is true if the call is in response to the user explicitly |
| 417 | // setting a passphrase as opposed to implicitly (from the users' perspective) |
| 418 | // using their Google Account password. An implicit SetPassphrase will *not* |
| 419 | // *not* override an explicit passphrase set previously. |
[email protected] | 2e610e9 | 2011-01-13 23:39:45 | [diff] [blame] | 420 | // |is_creation| is true if the call is in response to the user setting |
| 421 | // up a new passphrase, and false if it's being set in response to a prompt |
| 422 | // for an existing passphrase. |
| 423 | virtual void SetPassphrase(const std::string& passphrase, |
| 424 | bool is_explicit, |
| 425 | bool is_creation); |
[email protected] | bb899b3f | 2010-06-23 21:35:32 | [diff] [blame] | 426 | |
[email protected] | 5edb922 | 2010-08-18 00:23:29 | [diff] [blame] | 427 | // Returns whether processing changes is allowed. Check this before doing |
| 428 | // any model-modifying operations. |
| 429 | bool ShouldPushChanges(); |
| 430 | |
[email protected] | 9a127f2 | 2010-09-17 21:05:16 | [diff] [blame] | 431 | const GURL& sync_service_url() const { return sync_service_url_; } |
[email protected] | bb868b4 | 2010-11-18 22:33:00 | [diff] [blame] | 432 | SigninManager* signin() { return signin_.get(); } |
| 433 | const std::string& cros_user() const { return cros_user_; } |
[email protected] | 9a127f2 | 2010-09-17 21:05:16 | [diff] [blame] | 434 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 435 | protected: |
[email protected] | 82d9d295 | 2010-05-15 00:36:16 | [diff] [blame] | 436 | // Used by ProfileSyncServiceMock only. |
| 437 | // |
| 438 | // TODO(akalin): Separate this class out into an abstract |
| 439 | // ProfileSyncService interface and a ProfileSyncServiceImpl class |
| 440 | // so we don't need this hack anymore. |
| 441 | ProfileSyncService(); |
| 442 | |
[email protected] | 42091493 | 2011-01-24 23:32:41 | [diff] [blame^] | 443 | // Used by test classes that derive from ProfileSyncService. |
| 444 | virtual browser_sync::SyncBackendHost* GetBackendForTest(); |
| 445 | |
[email protected] | 7cef1c44 | 2010-07-07 17:05:22 | [diff] [blame] | 446 | // Helper to install and configure a data type manager. |
| 447 | void ConfigureDataTypeManager(); |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 448 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 449 | // Starts up the backend sync components. |
| 450 | void StartUp(); |
| 451 | // Shuts down the backend sync components. |
| 452 | // |sync_disabled| indicates if syncing is being disabled or not. |
| 453 | void Shutdown(bool sync_disabled); |
| 454 | |
[email protected] | 48352c1 | 2009-08-15 01:19:11 | [diff] [blame] | 455 | // Methods to register and remove preferences. |
| 456 | void RegisterPreferences(); |
| 457 | void ClearPreferences(); |
| 458 | |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 459 | // Return SyncCredentials from the TokenService. |
| 460 | sync_api::SyncCredentials GetCredentials(); |
| 461 | |
[email protected] | 18af9a2 | 2010-08-11 00:47:19 | [diff] [blame] | 462 | // Test need to override this to create backends that allow setting up |
| 463 | // initial conditions, such as populating sync nodes. |
[email protected] | 42091493 | 2011-01-24 23:32:41 | [diff] [blame^] | 464 | // |
| 465 | // TODO(akalin): Figure out a better way to do this. Ideally, we'd |
| 466 | // construct the backend outside this class and pass it in to the |
| 467 | // contructor or Initialize(). |
[email protected] | 18af9a2 | 2010-08-11 00:47:19 | [diff] [blame] | 468 | virtual void CreateBackend(); |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 469 | |
[email protected] | 7cef1c44 | 2010-07-07 17:05:22 | [diff] [blame] | 470 | const browser_sync::DataTypeController::TypeMap& data_type_controllers() { |
| 471 | return data_type_controllers_; |
| 472 | } |
| 473 | |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 474 | // The wizard will try to read the auth state out of the profile sync |
| 475 | // service using this member. Captcha and error state are reflected. |
[email protected] | 712257e | 2009-11-11 22:57:46 | [diff] [blame] | 476 | GoogleServiceAuthError last_auth_error_; |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 477 | |
[email protected] | 7cef1c44 | 2010-07-07 17:05:22 | [diff] [blame] | 478 | // Our asynchronous backend to communicate with sync components living on |
| 479 | // other threads. |
| 480 | scoped_ptr<browser_sync::SyncBackendHost> backend_; |
| 481 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 482 | // Cache of the last name the client attempted to authenticate. |
| 483 | std::string last_attempted_user_email_; |
| 484 | |
[email protected] | 2e610e9 | 2011-01-13 23:39:45 | [diff] [blame] | 485 | // Whether the user has tried creating an explicit passphrase on this |
| 486 | // machine. |
| 487 | bool tried_creating_explicit_passphrase_; |
| 488 | |
| 489 | // Whether the user has tried setting an explicit passphrase on this |
| 490 | // machine. |
| 491 | bool tried_setting_explicit_passphrase_; |
| 492 | |
[email protected] | 66d8100 | 2010-10-18 16:52:09 | [diff] [blame] | 493 | // Whether we have seen a SYNC_PASSPHRASE_REQUIRED since initializing the |
| 494 | // backend, telling us that it is safe to send a passphrase down ASAP. |
| 495 | bool observed_passphrase_required_; |
| 496 | |
[email protected] | fc52c42 | 2010-11-19 18:59:23 | [diff] [blame] | 497 | // Was the last SYNC_PASSPHRASE_REQUIRED notification sent because it |
| 498 | // was required for decryption? |
| 499 | bool passphrase_required_for_decryption_; |
| 500 | |
[email protected] | f0718a39 | 2011-01-21 23:52:56 | [diff] [blame] | 501 | // Is the user in a passphrase migration? |
| 502 | bool passphrase_migration_in_progress_; |
| 503 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 504 | private: |
[email protected] | 4f5732a4 | 2010-09-21 22:39:09 | [diff] [blame] | 505 | friend class ProfileSyncServicePasswordTest; |
[email protected] | 42091493 | 2011-01-24 23:32:41 | [diff] [blame^] | 506 | friend class TestProfileSyncService; |
[email protected] | 61b694a | 2010-06-10 10:40:46 | [diff] [blame] | 507 | FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTest, InitialState); |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 508 | |
[email protected] | 18af9a2 | 2010-08-11 00:47:19 | [diff] [blame] | 509 | // If |delete_sync_data_folder| is true, then this method will delete all |
| 510 | // previous "Sync Data" folders. (useful if the folder is partial/corrupt). |
| 511 | void InitializeBackend(bool delete_sync_data_folder); |
| 512 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 513 | // Initializes the various settings from the command line. |
| 514 | void InitSettings(); |
| 515 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 516 | // Sets the last synced time to the current time. |
| 517 | void UpdateLastSyncedTime(); |
| 518 | |
[email protected] | 1a78769 | 2011-01-19 22:19:46 | [diff] [blame] | 519 | void NotifyObservers(); |
| 520 | |
[email protected] | 57ecc4b | 2010-08-11 03:02:51 | [diff] [blame] | 521 | static const char* GetPrefNameForDataType(syncable::ModelType data_type); |
[email protected] | a1c2aef6 | 2010-04-02 02:58:05 | [diff] [blame] | 522 | |
[email protected] | cb4c06e | 2009-08-22 00:24:39 | [diff] [blame] | 523 | // Time at which we begin an attempt a GAIA authorization. |
| 524 | base::TimeTicks auth_start_time_; |
| 525 | |
| 526 | // Time at which error UI is presented for the new tab page. |
[email protected] | 1f97a11 | 2009-08-11 02:17:06 | [diff] [blame] | 527 | base::TimeTicks auth_error_time_; |
| 528 | |
[email protected] | e3e43d9 | 2010-02-26 22:02:38 | [diff] [blame] | 529 | // Factory used to create various dependent objects. |
| 530 | ProfileSyncFactory* factory_; |
| 531 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 532 | // The profile whose data we are synchronizing. |
| 533 | Profile* profile_; |
| 534 | |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 535 | // Email for the ChromiumOS user, if we're running under ChromiumOS. |
| 536 | std::string cros_user_; |
[email protected] | 72a31b4 | 2010-02-17 22:26:33 | [diff] [blame] | 537 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 538 | // TODO(ncarter): Put this in a profile, once there is UI for it. |
| 539 | // This specifies where to find the sync server. |
| 540 | GURL sync_service_url_; |
| 541 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 542 | // The last time we detected a successful transition from SYNCING state. |
| 543 | // Our backend notifies us whenever we should take a new snapshot. |
| 544 | base::Time last_synced_time_; |
| 545 | |
[email protected] | 4aea04a | 2010-02-10 20:13:43 | [diff] [blame] | 546 | // List of available data type controllers. |
[email protected] | 72a31b4 | 2010-02-17 22:26:33 | [diff] [blame] | 547 | browser_sync::DataTypeController::TypeMap data_type_controllers_; |
[email protected] | db1df0f | 2009-08-18 22:36:05 | [diff] [blame] | 548 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 549 | // Whether the SyncBackendHost has been initialized. |
| 550 | bool backend_initialized_; |
| 551 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 552 | // Various pieces of UI query this value to determine if they should show |
| 553 | // an "Authenticating.." type of message. We are the only central place |
| 554 | // all auth attempts funnel through, so it makes sense to provide this. |
| 555 | // As its name suggests, this should NOT be used for anything other than UI. |
| 556 | bool is_auth_in_progress_; |
| 557 | |
[email protected] | 44b78f90a | 2009-10-15 17:32:20 | [diff] [blame] | 558 | SyncSetupWizard wizard_; |
| 559 | |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 560 | // Encapsulates user signin with TokenService. |
[email protected] | bb868b4 | 2010-11-18 22:33:00 | [diff] [blame] | 561 | scoped_ptr<SigninManager> signin_; |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 562 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 563 | // True if an unrecoverable error (e.g. violation of an assumed invariant) |
| 564 | // occurred during syncer operation. This value should be checked before |
| 565 | // doing any work that might corrupt things further. |
| 566 | bool unrecoverable_error_detected_; |
| 567 | |
[email protected] | f6ec8b2 | 2010-06-08 23:40:06 | [diff] [blame] | 568 | // A message sent when an unrecoverable error occurred. |
| 569 | std::string unrecoverable_error_message_; |
| 570 | scoped_ptr<tracked_objects::Location> unrecoverable_error_location_; |
| 571 | |
[email protected] | 33cd004 | 2010-09-08 19:25:28 | [diff] [blame] | 572 | // Contains options specific to how sync clients send and listen to |
| 573 | // notifications. |
| 574 | notifier::NotifierOptions notifier_options_; |
[email protected] | 93d960ce | 2010-02-11 04:27:00 | [diff] [blame] | 575 | |
[email protected] | e3e43d9 | 2010-02-26 22:02:38 | [diff] [blame] | 576 | // Manages the start and stop of the various data types. |
| 577 | scoped_ptr<browser_sync::DataTypeManager> data_type_manager_; |
| 578 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 579 | ObserverList<Observer> observers_; |
| 580 | |
[email protected] | c4c672a | 2010-03-23 21:47:04 | [diff] [blame] | 581 | NotificationRegistrar registrar_; |
| 582 | |
[email protected] | 2be7bf2 | 2010-04-23 21:02:37 | [diff] [blame] | 583 | ScopedRunnableMethodFactory<ProfileSyncService> |
[email protected] | 954b108 | 2010-11-10 20:22:50 | [diff] [blame] | 584 | scoped_runnable_method_factory_; |
[email protected] | 2be7bf2 | 2010-04-23 21:02:37 | [diff] [blame] | 585 | |
[email protected] | d3b98c8 | 2010-07-14 07:45:59 | [diff] [blame] | 586 | // The preference that controls whether sync is under control by configuration |
| 587 | // management. |
| 588 | BooleanPrefMember pref_sync_managed_; |
| 589 | |
[email protected] | a47eeb5 | 2010-07-15 17:54:25 | [diff] [blame] | 590 | // This allows us to gracefully handle an ABORTED return code from the |
| 591 | // DataTypeManager in the event that the server informed us to cease and |
| 592 | // desist syncing immediately. |
| 593 | bool expect_sync_configuration_aborted_; |
| 594 | |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 595 | scoped_ptr<TokenMigrator> token_migrator_; |
| 596 | |
[email protected] | 48a98b3 | 2010-09-17 20:26:59 | [diff] [blame] | 597 | // Sometimes we need to temporarily hold on to a passphrase because we don't |
| 598 | // yet have a backend to send it to. This happens during initialization as |
| 599 | // we don't StartUp until we have a valid token, which happens after valid |
| 600 | // credentials were provided. |
[email protected] | 954b108 | 2010-11-10 20:22:50 | [diff] [blame] | 601 | struct CachedPassphrase { |
| 602 | std::string value; |
| 603 | bool is_explicit; |
[email protected] | 2e610e9 | 2011-01-13 23:39:45 | [diff] [blame] | 604 | bool is_creation; |
| 605 | CachedPassphrase() : is_explicit(false), is_creation(false) {} |
[email protected] | 954b108 | 2010-11-10 20:22:50 | [diff] [blame] | 606 | }; |
| 607 | CachedPassphrase cached_passphrase_; |
| 608 | |
| 609 | // TODO(tim): Remove this once new 'explicit passphrase' code flushes through |
| 610 | // dev channel. See bug 62103. |
| 611 | // To "migrate" early adopters of password sync on dev channel to the new |
| 612 | // model that stores their secondary passphrase preference in the cloud, we |
| 613 | // need some extra state since this cloud pref will be empty for all of them |
| 614 | // regardless of how they set up sync, and we can't trust |
| 615 | // kSyncUsingSecondaryPassphrase due to bugs in that implementation. |
| 616 | bool tried_implicit_gaia_remove_when_bug_62103_fixed_; |
[email protected] | 48a98b3 | 2010-09-17 20:26:59 | [diff] [blame] | 617 | |
[email protected] | 689a7a7 | 2010-09-29 19:56:41 | [diff] [blame] | 618 | // Keep track of where we are in a server clear operation |
| 619 | ClearServerDataState clear_server_data_state_; |
| 620 | |
[email protected] | 990de36 | 2010-10-13 17:55:50 | [diff] [blame] | 621 | // Timeout for the clear data command. This timeout is a temporary hack |
[email protected] | 954b108 | 2010-11-10 20:22:50 | [diff] [blame] | 622 | // and is necessary because the nudge sync framework can drop nudges for |
[email protected] | 990de36 | 2010-10-13 17:55:50 | [diff] [blame] | 623 | // a wide variety of sync-related conditions (throttling, connections issues, |
| 624 | // syncer paused, etc.). It can only be removed correctly when the framework |
| 625 | // is reworked to allow one-shot commands like clearing server data. |
| 626 | base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; |
| 627 | |
[email protected] | 132c8565 | 2009-08-05 01:18:27 | [diff] [blame] | 628 | DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 629 | }; |
| 630 | |
| 631 | #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |