OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GLUE_SYNC_BACKEND_HOST_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 // SyncFrontend is the interface used by SyncBackendHost to communicate with | 49 // SyncFrontend is the interface used by SyncBackendHost to communicate with |
50 // the entity that created it and, presumably, is interested in sync-related | 50 // the entity that created it and, presumably, is interested in sync-related |
51 // activity. | 51 // activity. |
52 // NOTE: All methods will be invoked by a SyncBackendHost on the same thread | 52 // NOTE: All methods will be invoked by a SyncBackendHost on the same thread |
53 // used to create that SyncBackendHost. | 53 // used to create that SyncBackendHost. |
54 class SyncFrontend { | 54 class SyncFrontend { |
55 public: | 55 public: |
56 SyncFrontend() {} | 56 SyncFrontend() {} |
57 | 57 |
58 // The backend has completed initialization and it is now ready to accept and | 58 // The backend has completed initialization and it is now ready to |
59 // process changes. If success is false, initialization wasn't able to be | 59 // accept and process changes. If success is false, initialization |
60 // completed and should be retried. | 60 // wasn't able to be completed and should be retried. |
| 61 // |
| 62 // |js_backend| is what about:sync interacts with; it's different |
| 63 // from the 'Backend' in 'OnBackendInitialized' (unfortunately). It |
| 64 // is initialized only if |success| is true. |
61 virtual void OnBackendInitialized( | 65 virtual void OnBackendInitialized( |
62 const WeakHandle<JsBackend>& js_backend, bool success) = 0; | 66 const WeakHandle<JsBackend>& js_backend, bool success) = 0; |
63 | 67 |
64 // The backend queried the server recently and received some updates. | 68 // The backend queried the server recently and received some updates. |
65 virtual void OnSyncCycleCompleted() = 0; | 69 virtual void OnSyncCycleCompleted() = 0; |
66 | 70 |
67 // The backend encountered an authentication problem and requests new | 71 // The backend encountered an authentication problem and requests new |
68 // credentials to be provided. See SyncBackendHost::Authenticate for details. | 72 // credentials to be provided. See SyncBackendHost::Authenticate for details. |
69 virtual void OnAuthError() = 0; | 73 virtual void OnAuthError() = 0; |
70 | 74 |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 | 610 |
607 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 611 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
608 scoped_ptr<sessions::SyncSessionSnapshot> last_snapshot_; | 612 scoped_ptr<sessions::SyncSessionSnapshot> last_snapshot_; |
609 | 613 |
610 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 614 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
611 }; | 615 }; |
612 | 616 |
613 } // namespace browser_sync | 617 } // namespace browser_sync |
614 | 618 |
615 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 619 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
OLD | NEW |