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 | 10 |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 return configure_status_; | 545 return configure_status_; |
546 } | 546 } |
547 | 547 |
548 // If true, the ProfileSyncService has detected that a new GAIA signin has | 548 // If true, the ProfileSyncService has detected that a new GAIA signin has |
549 // succeeded, and is waiting for initialization to complete. This is used by | 549 // succeeded, and is waiting for initialization to complete. This is used by |
550 // the UI to differentiate between a new auth error (encountered as part of | 550 // the UI to differentiate between a new auth error (encountered as part of |
551 // the initialization process) and a pre-existing auth error that just hasn't | 551 // the initialization process) and a pre-existing auth error that just hasn't |
552 // been cleared yet. Virtual for testing purposes. | 552 // been cleared yet. Virtual for testing purposes. |
553 virtual bool waiting_for_auth() const; | 553 virtual bool waiting_for_auth() const; |
554 | 554 |
555 // Updates the set of ObjectIds associated with a given |handler|. | 555 // Sets the invalidation handler for the given name. Pass in NULL for |
556 // Passing an empty ObjectIdSet will unregister |handler|. | 556 // |handler| if you want to remove the handler for the given name. (This |
557 // There should be at most one handler registered per object id. | 557 // doesn't unregister the IDs for the given name, though.) A handler must be |
| 558 // set for at most one name. |
558 // | 559 // |
559 // The handler -> registered ids map is persisted across restarts of | 560 // The handler name -> handler map is persisted across restarts of sync. |
| 561 void SetInvalidationHandler(const std::string& handler_name, |
| 562 syncer::SyncNotifierObserver* handler); |
| 563 |
| 564 // Updates the set of ObjectIds associated with a given invalidation handler |
| 565 // (via its name). An ID must be registered for at most one handler. |
| 566 // |
| 567 // The handler name -> registered ids map is persisted across restarts of |
560 // sync. | 568 // sync. |
561 void UpdateRegisteredInvalidationIds(syncer::SyncNotifierObserver* handler, | 569 void UpdateRegisteredInvalidationIds(const std::string& handler_name, |
562 const syncer::ObjectIdSet& ids); | 570 const syncer::ObjectIdSet& ids); |
563 | 571 |
564 // ProfileKeyedService implementation. | 572 // ProfileKeyedService implementation. |
565 virtual void Shutdown() OVERRIDE; | 573 virtual void Shutdown() OVERRIDE; |
566 | 574 |
567 protected: | 575 protected: |
568 // Used by test classes that derive from ProfileSyncService. | 576 // Used by test classes that derive from ProfileSyncService. |
569 virtual browser_sync::SyncBackendHost* GetBackendForTest(); | 577 virtual browser_sync::SyncBackendHost* GetBackendForTest(); |
570 | 578 |
571 // Helper to install and configure a data type manager. | 579 // Helper to install and configure a data type manager. |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 // If |true|, there is setup UI visible so we should not start downloading | 836 // If |true|, there is setup UI visible so we should not start downloading |
829 // data types. | 837 // data types. |
830 bool setup_in_progress_; | 838 bool setup_in_progress_; |
831 | 839 |
832 // The set of currently enabled sync experiments. | 840 // The set of currently enabled sync experiments. |
833 syncer::Experiments current_experiments; | 841 syncer::Experiments current_experiments; |
834 | 842 |
835 // Factory the backend will use to build the SyncManager. | 843 // Factory the backend will use to build the SyncManager. |
836 syncer::SyncManagerFactory sync_manager_factory_; | 844 syncer::SyncManagerFactory sync_manager_factory_; |
837 | 845 |
838 // The set of all registered IDs. | |
839 syncer::ObjectIdSet all_registered_ids_; | |
840 | |
841 // Dispatches invalidations to handlers. | 846 // Dispatches invalidations to handlers. |
842 syncer::SyncNotifierHelper notifier_helper_; | 847 syncer::SyncNotifierHelper notifier_helper_; |
843 | 848 |
844 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 849 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
845 }; | 850 }; |
846 | 851 |
847 bool ShouldShowActionOnUI( | 852 bool ShouldShowActionOnUI( |
848 const syncer::SyncProtocolError& error); | 853 const syncer::SyncProtocolError& error); |
849 | 854 |
850 | 855 |
851 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 856 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |