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 // NOTE(akalin): Invalidations that come in during browser shutdown may get |
556 // Passing an empty ObjectIdSet will unregister |handler|. | 556 // dropped. This won't matter once we have an Acknowledge API, though: see |
557 // There should be at most one handler registered per object id. | 557 // http://crbug.com/78462 and http://crbug.com/124149. |
558 | |
559 // Sets the invalidation handler for the given name. Pass in NULL for | |
560 // |handler| if you want to remove the handler for the given name. (This | |
561 // doesn't unregister the IDs for the given name, though.) A handler must be | |
562 // set for at most one name. | |
558 // | 563 // |
559 // The handler -> registered ids map is persisted across restarts of | 564 // The handler name -> handler map is persisted across restarts of sync. |
565 void SetInvalidationHandler(const std::string& handler_name, | |
msw
2012/08/07 20:09:30
I'm wondering if using strings is a necessity to a
| |
566 syncer::SyncNotifierObserver* handler); | |
567 | |
568 // Updates the set of ObjectIds associated with a given invalidation handler | |
569 // (via its name). An ID must be registered for at most one handler. | |
570 // | |
571 // The handler name -> registered ids map is persisted across restarts of | |
560 // sync. | 572 // sync. |
561 void UpdateRegisteredInvalidationIds(syncer::SyncNotifierObserver* handler, | 573 void UpdateRegisteredInvalidationIds(const std::string& handler_name, |
562 const syncer::ObjectIdSet& ids); | 574 const syncer::ObjectIdSet& ids); |
563 | 575 |
564 // ProfileKeyedService implementation. | 576 // ProfileKeyedService implementation. |
565 virtual void Shutdown() OVERRIDE; | 577 virtual void Shutdown() OVERRIDE; |
566 | 578 |
567 protected: | 579 protected: |
568 // Used by test classes that derive from ProfileSyncService. | 580 // Used by test classes that derive from ProfileSyncService. |
569 virtual browser_sync::SyncBackendHost* GetBackendForTest(); | 581 virtual browser_sync::SyncBackendHost* GetBackendForTest(); |
570 | 582 |
571 // Helper to install and configure a data type manager. | 583 // 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 | 840 // If |true|, there is setup UI visible so we should not start downloading |
829 // data types. | 841 // data types. |
830 bool setup_in_progress_; | 842 bool setup_in_progress_; |
831 | 843 |
832 // The set of currently enabled sync experiments. | 844 // The set of currently enabled sync experiments. |
833 syncer::Experiments current_experiments; | 845 syncer::Experiments current_experiments; |
834 | 846 |
835 // Factory the backend will use to build the SyncManager. | 847 // Factory the backend will use to build the SyncManager. |
836 syncer::SyncManagerFactory sync_manager_factory_; | 848 syncer::SyncManagerFactory sync_manager_factory_; |
837 | 849 |
838 // The set of all registered IDs. | |
839 syncer::ObjectIdSet all_registered_ids_; | |
840 | |
841 // Dispatches invalidations to handlers. | 850 // Dispatches invalidations to handlers. |
842 syncer::SyncNotifierHelper notifier_helper_; | 851 syncer::SyncNotifierHelper notifier_helper_; |
843 | 852 |
844 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 853 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
845 }; | 854 }; |
846 | 855 |
847 bool ShouldShowActionOnUI( | 856 bool ShouldShowActionOnUI( |
848 const syncer::SyncProtocolError& error); | 857 const syncer::SyncProtocolError& error); |
849 | 858 |
850 | 859 |
851 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 860 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |