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

Side by Side Diff: chrome/browser/sync/profile_sync_service.h

Issue 10698014: [Sync] Rename csync namespace to syncer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 5 months 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 | Annotate | Revision Log
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 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 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 #include <string> 10 #include <string>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 namespace browser_sync { 47 namespace browser_sync {
48 class BackendMigrator; 48 class BackendMigrator;
49 class ChangeProcessor; 49 class ChangeProcessor;
50 class DataTypeManager; 50 class DataTypeManager;
51 class JsController; 51 class JsController;
52 class SessionModelAssociator; 52 class SessionModelAssociator;
53 namespace sessions { class SyncSessionSnapshot; } 53 namespace sessions { class SyncSessionSnapshot; }
54 } 54 }
55 55
56 namespace csync { 56 namespace syncer {
57 class BaseTransaction; 57 class BaseTransaction;
58 struct SyncCredentials; 58 struct SyncCredentials;
59 struct UserShare; 59 struct UserShare;
60 } 60 }
61 61
62 namespace sync_pb { 62 namespace sync_pb {
63 class EncryptedData; 63 class EncryptedData;
64 } // namespace sync_pb 64 } // namespace sync_pb
65 65
66 // ProfileSyncService is the layer between browser subsystems like bookmarks, 66 // ProfileSyncService is the layer between browser subsystems like bookmarks,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // When SetSyncSetupCompleted() == false, but SetSetupInProgress(true) has 140 // When SetSyncSetupCompleted() == false, but SetSetupInProgress(true) has
141 // been called, then the sync engine knows not to download any user data. 141 // been called, then the sync engine knows not to download any user data.
142 // 142 //
143 // When initial sync is complete, the UI code should call 143 // When initial sync is complete, the UI code should call
144 // SetSyncSetupCompleted() followed by SetSetupInProgress(false) - this will 144 // SetSyncSetupCompleted() followed by SetSetupInProgress(false) - this will
145 // tell the sync engine that setup is completed and it can begin downloading 145 // tell the sync engine that setup is completed and it can begin downloading
146 // data from the sync server. 146 // data from the sync server.
147 // 147 //
148 class ProfileSyncService : public browser_sync::SyncFrontend, 148 class ProfileSyncService : public browser_sync::SyncFrontend,
149 public browser_sync::SyncPrefObserver, 149 public browser_sync::SyncPrefObserver,
150 public csync::UnrecoverableErrorHandler, 150 public syncer::UnrecoverableErrorHandler,
151 public content::NotificationObserver, 151 public content::NotificationObserver,
152 public ProfileKeyedService { 152 public ProfileKeyedService {
153 public: 153 public:
154 typedef ProfileSyncServiceObserver Observer; 154 typedef ProfileSyncServiceObserver Observer;
155 typedef browser_sync::SyncBackendHost::Status Status; 155 typedef browser_sync::SyncBackendHost::Status Status;
156 156
157 enum SyncEventCodes { 157 enum SyncEventCodes {
158 MIN_SYNC_EVENT_CODE = 0, 158 MIN_SYNC_EVENT_CODE = 0,
159 159
160 // Events starting the sync service. 160 // Events starting the sync service.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 // Disables sync for user. Use ShowLoginDialog to enable. 248 // Disables sync for user. Use ShowLoginDialog to enable.
249 virtual void DisableForUser(); 249 virtual void DisableForUser();
250 250
251 // Whether sync is enabled by user or not. 251 // Whether sync is enabled by user or not.
252 virtual bool HasSyncSetupCompleted() const; 252 virtual bool HasSyncSetupCompleted() const;
253 virtual void SetSyncSetupCompleted(); 253 virtual void SetSyncSetupCompleted();
254 254
255 // SyncFrontend implementation. 255 // SyncFrontend implementation.
256 virtual void OnBackendInitialized( 256 virtual void OnBackendInitialized(
257 const csync::WeakHandle<csync::JsBackend>& js_backend, 257 const syncer::WeakHandle<syncer::JsBackend>& js_backend,
258 bool success) OVERRIDE; 258 bool success) OVERRIDE;
259 virtual void OnSyncCycleCompleted() OVERRIDE; 259 virtual void OnSyncCycleCompleted() OVERRIDE;
260 virtual void OnSyncConfigureRetry() OVERRIDE; 260 virtual void OnSyncConfigureRetry() OVERRIDE;
261 virtual void OnConnectionStatusChange( 261 virtual void OnConnectionStatusChange(
262 csync::ConnectionStatus status) OVERRIDE; 262 syncer::ConnectionStatus status) OVERRIDE;
263 virtual void OnStopSyncingPermanently() OVERRIDE; 263 virtual void OnStopSyncingPermanently() OVERRIDE;
264 virtual void OnPassphraseRequired( 264 virtual void OnPassphraseRequired(
265 csync::PassphraseRequiredReason reason, 265 syncer::PassphraseRequiredReason reason,
266 const sync_pb::EncryptedData& pending_keys) OVERRIDE; 266 const sync_pb::EncryptedData& pending_keys) OVERRIDE;
267 virtual void OnPassphraseAccepted() OVERRIDE; 267 virtual void OnPassphraseAccepted() OVERRIDE;
268 virtual void OnEncryptedTypesChanged( 268 virtual void OnEncryptedTypesChanged(
269 syncable::ModelTypeSet encrypted_types, 269 syncable::ModelTypeSet encrypted_types,
270 bool encrypt_everything) OVERRIDE; 270 bool encrypt_everything) OVERRIDE;
271 virtual void OnEncryptionComplete() OVERRIDE; 271 virtual void OnEncryptionComplete() OVERRIDE;
272 virtual void OnMigrationNeededForTypes( 272 virtual void OnMigrationNeededForTypes(
273 syncable::ModelTypeSet types) OVERRIDE; 273 syncable::ModelTypeSet types) OVERRIDE;
274 virtual void OnExperimentsChanged( 274 virtual void OnExperimentsChanged(
275 const csync::Experiments& experiments) OVERRIDE; 275 const syncer::Experiments& experiments) OVERRIDE;
276 virtual void OnActionableError( 276 virtual void OnActionableError(
277 const csync::SyncProtocolError& error) OVERRIDE; 277 const syncer::SyncProtocolError& error) OVERRIDE;
278 278
279 // Update the last auth error and notify observers of error state. 279 // Update the last auth error and notify observers of error state.
280 void UpdateAuthErrorState(const GoogleServiceAuthError& error); 280 void UpdateAuthErrorState(const GoogleServiceAuthError& error);
281 281
282 // Called when a user chooses which data types to sync as part of the sync 282 // Called when a user chooses which data types to sync as part of the sync
283 // setup wizard. |sync_everything| represents whether they chose the 283 // setup wizard. |sync_everything| represents whether they chose the
284 // "keep everything synced" option; if true, |chosen_types| will be ignored 284 // "keep everything synced" option; if true, |chosen_types| will be ignored
285 // and all data types will be synced. |sync_everything| means "sync all 285 // and all data types will be synced. |sync_everything| means "sync all
286 // current and future data types." 286 // current and future data types."
287 virtual void OnUserChoseDatatypes(bool sync_everything, 287 virtual void OnUserChoseDatatypes(bool sync_everything,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 return unrecoverable_error_location_; 326 return unrecoverable_error_location_;
327 } 327 }
328 328
329 // Returns true if OnPassphraseRequired has been called for any reason. 329 // Returns true if OnPassphraseRequired has been called for any reason.
330 virtual bool IsPassphraseRequired() const; 330 virtual bool IsPassphraseRequired() const;
331 331
332 // Returns true if OnPassphraseRequired has been called for decryption and 332 // Returns true if OnPassphraseRequired has been called for decryption and
333 // we have an encrypted data type enabled. 333 // we have an encrypted data type enabled.
334 virtual bool IsPassphraseRequiredForDecryption() const; 334 virtual bool IsPassphraseRequiredForDecryption() const;
335 335
336 csync::PassphraseRequiredReason passphrase_required_reason() const { 336 syncer::PassphraseRequiredReason passphrase_required_reason() const {
337 return passphrase_required_reason_; 337 return passphrase_required_reason_;
338 } 338 }
339 339
340 // Returns a user-friendly string form of last synced time (in minutes). 340 // Returns a user-friendly string form of last synced time (in minutes).
341 virtual string16 GetLastSyncedTimeString() const; 341 virtual string16 GetLastSyncedTimeString() const;
342 342
343 ProfileSyncComponentsFactory* factory() { return factory_.get(); } 343 ProfileSyncComponentsFactory* factory() { return factory_.get(); }
344 344
345 // The profile we are syncing for. 345 // The profile we are syncing for.
346 Profile* profile() const { return profile_; } 346 Profile* profile() const { return profile_; }
347 347
348 // Adds/removes an observer. ProfileSyncService does not take ownership of 348 // Adds/removes an observer. ProfileSyncService does not take ownership of
349 // the observer. 349 // the observer.
350 virtual void AddObserver(Observer* observer); 350 virtual void AddObserver(Observer* observer);
351 virtual void RemoveObserver(Observer* observer); 351 virtual void RemoveObserver(Observer* observer);
352 352
353 // Returns true if |observer| has already been added as an observer. 353 // Returns true if |observer| has already been added as an observer.
354 bool HasObserver(Observer* observer) const; 354 bool HasObserver(Observer* observer) const;
355 355
356 // Returns a weak pointer to the service's JsController. 356 // Returns a weak pointer to the service's JsController.
357 // Overrideable for testing purposes. 357 // Overrideable for testing purposes.
358 virtual base::WeakPtr<csync::JsController> GetJsController(); 358 virtual base::WeakPtr<syncer::JsController> GetJsController();
359 359
360 // Record stats on various events. 360 // Record stats on various events.
361 static void SyncEvent(SyncEventCodes code); 361 static void SyncEvent(SyncEventCodes code);
362 362
363 // Returns whether sync is enabled. Sync can be enabled/disabled both 363 // Returns whether sync is enabled. Sync can be enabled/disabled both
364 // at compile time (e.g., on a per-OS basis) or at run time (e.g., 364 // at compile time (e.g., on a per-OS basis) or at run time (e.g.,
365 // command-line switches). 365 // command-line switches).
366 static bool IsSyncEnabled(); 366 static bool IsSyncEnabled();
367 367
368 // Returns whether sync is managed, i.e. controlled by configuration 368 // Returns whether sync is managed, i.e. controlled by configuration
369 // management. If so, the user is not allowed to configure sync. 369 // management. If so, the user is not allowed to configure sync.
370 bool IsManaged() const; 370 bool IsManaged() const;
371 371
372 // csync::UnrecoverableErrorHandler implementation. 372 // syncer::UnrecoverableErrorHandler implementation.
373 virtual void OnUnrecoverableError( 373 virtual void OnUnrecoverableError(
374 const tracked_objects::Location& from_here, 374 const tracked_objects::Location& from_here,
375 const std::string& message) OVERRIDE; 375 const std::string& message) OVERRIDE;
376 376
377 // Called when a datatype wishes to disable itself due to having hit an 377 // Called when a datatype wishes to disable itself due to having hit an
378 // unrecoverable error. 378 // unrecoverable error.
379 virtual void DisableBrokenDatatype( 379 virtual void DisableBrokenDatatype(
380 syncable::ModelType type, 380 syncable::ModelType type,
381 const tracked_objects::Location& from_here, 381 const tracked_objects::Location& from_here,
382 std::string message); 382 std::string message);
383 383
384 // The functions below (until ActivateDataType()) should only be 384 // The functions below (until ActivateDataType()) should only be
385 // called if sync_initialized() is true. 385 // called if sync_initialized() is true.
386 386
387 // TODO(akalin): This is called mostly by ModelAssociators and 387 // TODO(akalin): This is called mostly by ModelAssociators and
388 // tests. Figure out how to pass the handle to the ModelAssociators 388 // tests. Figure out how to pass the handle to the ModelAssociators
389 // directly, figure out how to expose this to tests, and remove this 389 // directly, figure out how to expose this to tests, and remove this
390 // function. 390 // function.
391 virtual csync::UserShare* GetUserShare() const; 391 virtual syncer::UserShare* GetUserShare() const;
392 392
393 // TODO(akalin): These two functions are used only by 393 // TODO(akalin): These two functions are used only by
394 // ProfileSyncServiceHarness. Figure out a different way to expose 394 // ProfileSyncServiceHarness. Figure out a different way to expose
395 // this info to that class, and remove these functions. 395 // this info to that class, and remove these functions.
396 396
397 virtual csync::sessions::SyncSessionSnapshot 397 virtual syncer::sessions::SyncSessionSnapshot
398 GetLastSessionSnapshot() const; 398 GetLastSessionSnapshot() const;
399 399
400 // Returns whether or not the underlying sync engine has made any 400 // Returns whether or not the underlying sync engine has made any
401 // local changes to items that have not yet been synced with the 401 // local changes to items that have not yet been synced with the
402 // server. 402 // server.
403 bool HasUnsyncedItems() const; 403 bool HasUnsyncedItems() const;
404 404
405 // Used by ProfileSyncServiceHarness. May return NULL. 405 // Used by ProfileSyncServiceHarness. May return NULL.
406 browser_sync::BackendMigrator* GetBackendMigratorForTest(); 406 browser_sync::BackendMigrator* GetBackendMigratorForTest();
407 407
408 // TODO(sync): This is only used in tests. Can we remove it? 408 // TODO(sync): This is only used in tests. Can we remove it?
409 void GetModelSafeRoutingInfo(csync::ModelSafeRoutingInfo* out) const; 409 void GetModelSafeRoutingInfo(syncer::ModelSafeRoutingInfo* out) const;
410 410
411 // Returns a ListValue indicating the status of all registered types. 411 // Returns a ListValue indicating the status of all registered types.
412 // 412 //
413 // The format is: 413 // The format is:
414 // [ {"name": <name>, "value": <value>, "status": <status> }, ... ] 414 // [ {"name": <name>, "value": <value>, "status": <status> }, ... ]
415 // where <name> is a type's name, <value> is a string providing details for 415 // where <name> is a type's name, <value> is a string providing details for
416 // the type's status, and <status> is one of "error", "warning" or "ok" 416 // the type's status, and <status> is one of "error", "warning" or "ok"
417 // dpending on the type's current status. 417 // dpending on the type's current status.
418 // 418 //
419 // This function is used by sync_ui_util.cc to help populate the about:sync 419 // This function is used by sync_ui_util.cc to help populate the about:sync
420 // page. It returns a ListValue rather than a DictionaryValye in part to make 420 // page. It returns a ListValue rather than a DictionaryValye in part to make
421 // it easier to iterate over its elements when constructing that page. 421 // it easier to iterate over its elements when constructing that page.
422 Value* GetTypeStatusMap() const; 422 Value* GetTypeStatusMap() const;
423 423
424 // Overridden by tests. 424 // Overridden by tests.
425 // TODO(zea): Remove these and have the dtc's call directly into the SBH. 425 // TODO(zea): Remove these and have the dtc's call directly into the SBH.
426 virtual void ActivateDataType( 426 virtual void ActivateDataType(
427 syncable::ModelType type, csync::ModelSafeGroup group, 427 syncable::ModelType type, syncer::ModelSafeGroup group,
428 browser_sync::ChangeProcessor* change_processor); 428 browser_sync::ChangeProcessor* change_processor);
429 virtual void DeactivateDataType(syncable::ModelType type); 429 virtual void DeactivateDataType(syncable::ModelType type);
430 430
431 // SyncPrefObserver implementation. 431 // SyncPrefObserver implementation.
432 virtual void OnSyncManagedPrefChange(bool is_sync_managed) OVERRIDE; 432 virtual void OnSyncManagedPrefChange(bool is_sync_managed) OVERRIDE;
433 433
434 // content::NotificationObserver implementation. 434 // content::NotificationObserver implementation.
435 virtual void Observe(int type, 435 virtual void Observe(int type,
436 const content::NotificationSource& source, 436 const content::NotificationSource& source,
437 const content::NotificationDetails& details) OVERRIDE; 437 const content::NotificationDetails& details) OVERRIDE;
(...skipping 13 matching lines...) Expand all
451 // Gets the set of all data types that could be allowed (the set that 451 // Gets the set of all data types that could be allowed (the set that
452 // should be advertised to the user). These will typically only change 452 // should be advertised to the user). These will typically only change
453 // via a command-line option. See class comment for more on what it means 453 // via a command-line option. See class comment for more on what it means
454 // for a datatype to be Registered. 454 // for a datatype to be Registered.
455 virtual syncable::ModelTypeSet GetRegisteredDataTypes() const; 455 virtual syncable::ModelTypeSet GetRegisteredDataTypes() const;
456 456
457 // Checks whether the Cryptographer is ready to encrypt and decrypt updates 457 // Checks whether the Cryptographer is ready to encrypt and decrypt updates
458 // for sensitive data types. Caller must be holding a 458 // for sensitive data types. Caller must be holding a
459 // syncapi::BaseTransaction to ensure thread safety. 459 // syncapi::BaseTransaction to ensure thread safety.
460 virtual bool IsCryptographerReady( 460 virtual bool IsCryptographerReady(
461 const csync::BaseTransaction* trans) const; 461 const syncer::BaseTransaction* trans) const;
462 462
463 // Returns true if a secondary passphrase is being used. It is not legal 463 // Returns true if a secondary passphrase is being used. It is not legal
464 // to call this method before the backend is initialized. 464 // to call this method before the backend is initialized.
465 virtual bool IsUsingSecondaryPassphrase() const; 465 virtual bool IsUsingSecondaryPassphrase() const;
466 466
467 // Note about setting passphrases: There are different scenarios under which 467 // Note about setting passphrases: There are different scenarios under which
468 // we might want to apply a passphrase. It could be for first-time encryption, 468 // we might want to apply a passphrase. It could be for first-time encryption,
469 // re-encryption, or for decryption by clients that sign in at a later time. 469 // re-encryption, or for decryption by clients that sign in at a later time.
470 // In addition, encryption can either be done using a custom passphrase, or by 470 // In addition, encryption can either be done using a custom passphrase, or by
471 // reusing the GAIA password. Depending on what is happening in the system, 471 // reusing the GAIA password. Depending on what is happening in the system,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 // Helper to install and configure a data type manager. 546 // Helper to install and configure a data type manager.
547 void ConfigureDataTypeManager(); 547 void ConfigureDataTypeManager();
548 548
549 // Starts up the backend sync components. 549 // Starts up the backend sync components.
550 void StartUp(); 550 void StartUp();
551 // Shuts down the backend sync components. 551 // Shuts down the backend sync components.
552 // |sync_disabled| indicates if syncing is being disabled or not. 552 // |sync_disabled| indicates if syncing is being disabled or not.
553 void ShutdownImpl(bool sync_disabled); 553 void ShutdownImpl(bool sync_disabled);
554 554
555 // Return SyncCredentials from the TokenService. 555 // Return SyncCredentials from the TokenService.
556 csync::SyncCredentials GetCredentials(); 556 syncer::SyncCredentials GetCredentials();
557 557
558 // Test need to override this to create backends that allow setting up 558 // Test need to override this to create backends that allow setting up
559 // initial conditions, such as populating sync nodes. 559 // initial conditions, such as populating sync nodes.
560 // 560 //
561 // TODO(akalin): Figure out a better way to do this. Ideally, we'd 561 // TODO(akalin): Figure out a better way to do this. Ideally, we'd
562 // construct the backend outside this class and pass it in to the 562 // construct the backend outside this class and pass it in to the
563 // contructor or Initialize(). 563 // contructor or Initialize().
564 virtual void CreateBackend(); 564 virtual void CreateBackend();
565 565
566 const browser_sync::DataTypeController::TypeMap& data_type_controllers() { 566 const browser_sync::DataTypeController::TypeMap& data_type_controllers() {
(...skipping 16 matching lines...) Expand all
583 // user. 583 // user.
584 GoogleServiceAuthError last_auth_error_; 584 GoogleServiceAuthError last_auth_error_;
585 585
586 // Our asynchronous backend to communicate with sync components living on 586 // Our asynchronous backend to communicate with sync components living on
587 // other threads. 587 // other threads.
588 scoped_ptr<browser_sync::SyncBackendHost> backend_; 588 scoped_ptr<browser_sync::SyncBackendHost> backend_;
589 589
590 // Was the last SYNC_PASSPHRASE_REQUIRED notification sent because it 590 // Was the last SYNC_PASSPHRASE_REQUIRED notification sent because it
591 // was required for encryption, decryption with a cached passphrase, or 591 // was required for encryption, decryption with a cached passphrase, or
592 // because a new passphrase is required? 592 // because a new passphrase is required?
593 csync::PassphraseRequiredReason passphrase_required_reason_; 593 syncer::PassphraseRequiredReason passphrase_required_reason_;
594 594
595 private: 595 private:
596 enum UnrecoverableErrorReason { 596 enum UnrecoverableErrorReason {
597 ERROR_REASON_UNSET, 597 ERROR_REASON_UNSET,
598 ERROR_REASON_SYNCER, 598 ERROR_REASON_SYNCER,
599 ERROR_REASON_BACKEND_INIT_FAILURE, 599 ERROR_REASON_BACKEND_INIT_FAILURE,
600 ERROR_REASON_CONFIGURATION_RETRY, 600 ERROR_REASON_CONFIGURATION_RETRY,
601 ERROR_REASON_CONFIGURATION_FAILURE, 601 ERROR_REASON_CONFIGURATION_FAILURE,
602 ERROR_REASON_ACTIONABLE_ERROR, 602 ERROR_REASON_ACTIONABLE_ERROR,
603 ERROR_REASON_LIMIT 603 ERROR_REASON_LIMIT
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 // Information describing an unrecoverable error. 727 // Information describing an unrecoverable error.
728 UnrecoverableErrorReason unrecoverable_error_reason_; 728 UnrecoverableErrorReason unrecoverable_error_reason_;
729 std::string unrecoverable_error_message_; 729 std::string unrecoverable_error_message_;
730 tracked_objects::Location unrecoverable_error_location_; 730 tracked_objects::Location unrecoverable_error_location_;
731 731
732 // Manages the start and stop of the various data types. 732 // Manages the start and stop of the various data types.
733 scoped_ptr<browser_sync::DataTypeManager> data_type_manager_; 733 scoped_ptr<browser_sync::DataTypeManager> data_type_manager_;
734 734
735 ObserverList<Observer> observers_; 735 ObserverList<Observer> observers_;
736 736
737 csync::SyncJsController sync_js_controller_; 737 syncer::SyncJsController sync_js_controller_;
738 738
739 content::NotificationRegistrar registrar_; 739 content::NotificationRegistrar registrar_;
740 740
741 base::WeakPtrFactory<ProfileSyncService> weak_factory_; 741 base::WeakPtrFactory<ProfileSyncService> weak_factory_;
742 742
743 // This allows us to gracefully handle an ABORTED return code from the 743 // This allows us to gracefully handle an ABORTED return code from the
744 // DataTypeManager in the event that the server informed us to cease and 744 // DataTypeManager in the event that the server informed us to cease and
745 // desist syncing immediately. 745 // desist syncing immediately.
746 bool expect_sync_configuration_aborted_; 746 bool expect_sync_configuration_aborted_;
747 747
748 // Sometimes we need to temporarily hold on to a passphrase because we don't 748 // Sometimes we need to temporarily hold on to a passphrase because we don't
749 // yet have a backend to send it to. This happens during initialization as 749 // yet have a backend to send it to. This happens during initialization as
750 // we don't StartUp until we have a valid token, which happens after valid 750 // we don't StartUp until we have a valid token, which happens after valid
751 // credentials were provided. 751 // credentials were provided.
752 std::string cached_passphrase_; 752 std::string cached_passphrase_;
753 753
754 // The current set of encrypted types. Always a superset of 754 // The current set of encrypted types. Always a superset of
755 // csync::Cryptographer::SensitiveTypes(). 755 // syncer::Cryptographer::SensitiveTypes().
756 syncable::ModelTypeSet encrypted_types_; 756 syncable::ModelTypeSet encrypted_types_;
757 757
758 // Whether we want to encrypt everything. 758 // Whether we want to encrypt everything.
759 bool encrypt_everything_; 759 bool encrypt_everything_;
760 760
761 // Whether we're waiting for an attempt to encryption all sync data to 761 // Whether we're waiting for an attempt to encryption all sync data to
762 // complete. We track this at this layer in order to allow the user to cancel 762 // complete. We track this at this layer in order to allow the user to cancel
763 // if they e.g. don't remember their explicit passphrase. 763 // if they e.g. don't remember their explicit passphrase.
764 bool encryption_pending_; 764 bool encryption_pending_;
765 765
766 // If true, we want to automatically start sync signin whenever we have 766 // If true, we want to automatically start sync signin whenever we have
767 // credentials (user doesn't need to go through the startup flow). This is 767 // credentials (user doesn't need to go through the startup flow). This is
768 // typically enabled on platforms (like ChromeOS) that have their own 768 // typically enabled on platforms (like ChromeOS) that have their own
769 // distinct signin flow. 769 // distinct signin flow.
770 const bool auto_start_enabled_; 770 const bool auto_start_enabled_;
771 771
772 scoped_ptr<browser_sync::BackendMigrator> migrator_; 772 scoped_ptr<browser_sync::BackendMigrator> migrator_;
773 773
774 // This is the last |SyncProtocolError| we received from the server that had 774 // This is the last |SyncProtocolError| we received from the server that had
775 // an action set on it. 775 // an action set on it.
776 csync::SyncProtocolError last_actionable_error_; 776 syncer::SyncProtocolError last_actionable_error_;
777 777
778 // This is used to show sync errors in the wrench menu. 778 // This is used to show sync errors in the wrench menu.
779 scoped_ptr<SyncGlobalError> sync_global_error_; 779 scoped_ptr<SyncGlobalError> sync_global_error_;
780 780
781 // keeps track of data types that failed to load. 781 // keeps track of data types that failed to load.
782 FailedDatatypesHandler failed_datatypes_handler_; 782 FailedDatatypesHandler failed_datatypes_handler_;
783 783
784 scoped_ptr<browser_sync::BackendUnrecoverableErrorHandler> 784 scoped_ptr<browser_sync::BackendUnrecoverableErrorHandler>
785 backend_unrecoverable_error_handler_; 785 backend_unrecoverable_error_handler_;
786 786
787 browser_sync::DataTypeManager::ConfigureStatus configure_status_; 787 browser_sync::DataTypeManager::ConfigureStatus configure_status_;
788 788
789 // If |true|, there is setup UI visible so we should not start downloading 789 // If |true|, there is setup UI visible so we should not start downloading
790 // data types. 790 // data types.
791 bool setup_in_progress_; 791 bool setup_in_progress_;
792 792
793 // The set of currently enabled sync experiments. 793 // The set of currently enabled sync experiments.
794 csync::Experiments current_experiments; 794 syncer::Experiments current_experiments;
795 795
796 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 796 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
797 }; 797 };
798 798
799 bool ShouldShowActionOnUI( 799 bool ShouldShowActionOnUI(
800 const csync::SyncProtocolError& error); 800 const syncer::SyncProtocolError& error);
801 801
802 802
803 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 803 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_components_factory_mock.h ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698