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

Side by Side Diff: sync/internal_api/public/sync_manager.h

Issue 10805002: [Sync] Enable adding notifier observers from ProfileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 4 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 SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_
6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
13 #include "base/file_path.h" 13 #include "base/file_path.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/task_runner.h" 15 #include "base/task_runner.h"
16 #include "base/threading/thread_checker.h" 16 #include "base/threading/thread_checker.h"
17 #include "base/time.h" 17 #include "base/time.h"
18 #include "sync/internal_api/public/base/model_type.h" 18 #include "sync/internal_api/public/base/model_type.h"
19 #include "sync/internal_api/public/change_record.h" 19 #include "sync/internal_api/public/change_record.h"
20 #include "sync/internal_api/public/configure_reason.h" 20 #include "sync/internal_api/public/configure_reason.h"
21 #include "sync/internal_api/public/engine/model_safe_worker.h" 21 #include "sync/internal_api/public/engine/model_safe_worker.h"
22 #include "sync/internal_api/public/engine/sync_status.h" 22 #include "sync/internal_api/public/engine/sync_status.h"
23 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" 23 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h"
24 #include "sync/internal_api/public/util/weak_handle.h" 24 #include "sync/internal_api/public/util/weak_handle.h"
25 #include "sync/notifier/invalidation_util.h"
25 #include "sync/protocol/sync_protocol_error.h" 26 #include "sync/protocol/sync_protocol_error.h"
26 27
27 namespace syncer {
28 class Encryptor;
29 struct Experiments;
30 class ExtensionsActivityMonitor;
31 class InternalComponentsFactory;
32 class JsBackend;
33 class JsEventHandler;
34 class SyncScheduler;
35 class UnrecoverableErrorHandler;
36
37 namespace sessions {
38 class SyncSessionSnapshot;
39 } // namespace sessions
40 } // namespace syncer
41
42 namespace syncer {
43 class SyncNotifier;
44 } // namespace syncer
45
46 namespace sync_pb { 28 namespace sync_pb {
47 class EncryptedData; 29 class EncryptedData;
48 } // namespace sync_pb 30 } // namespace sync_pb
49 31
50 namespace syncer { 32 namespace syncer {
msw 2012/08/03 05:14:21 nit: if the syncer namespace contains more than ju
33 class BaseTransaction;
34 class Encryptor;
35 struct Experiments;
36 class ExtensionsActivityMonitor;
37 class HttpPostProviderFactory;
38 class InternalComponentsFactory;
39 class JsBackend;
40 class JsEventHandler;
41 class SyncNotifier;
42 class SyncNotifierObserver;
43 class SyncScheduler;
44 class UnrecoverableErrorHandler;
45 struct UserShare;
51 46
52 class BaseTransaction; 47 namespace sessions {
53 class HttpPostProviderFactory; 48 class SyncSessionSnapshot;
54 struct UserShare; 49 } // namespace sessions
55 50
56 // Used by SyncManager::OnConnectionStatusChange(). 51 // Used by SyncManager::OnConnectionStatusChange().
57 enum ConnectionStatus { 52 enum ConnectionStatus {
58 CONNECTION_OK, 53 CONNECTION_OK,
59 CONNECTION_AUTH_ERROR, 54 CONNECTION_AUTH_ERROR,
60 CONNECTION_SERVER_ERROR 55 CONNECTION_SERVER_ERROR
61 }; 56 };
62 57
63 // Reasons due to which Cryptographer might require a passphrase. 58 // Reasons due to which Cryptographer might require a passphrase.
64 enum PassphraseRequiredReason { 59 enum PassphraseRequiredReason {
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // Returns false if an error occurred, true otherwise. 399 // Returns false if an error occurred, true otherwise.
405 virtual bool PurgePartiallySyncedTypes() = 0; 400 virtual bool PurgePartiallySyncedTypes() = 0;
406 401
407 // Update tokens that we're using in Sync. Email must stay the same. 402 // Update tokens that we're using in Sync. Email must stay the same.
408 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0; 403 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0;
409 404
410 // Called when the user disables or enables a sync type. 405 // Called when the user disables or enables a sync type.
411 virtual void UpdateEnabledTypes( 406 virtual void UpdateEnabledTypes(
412 const ModelTypeSet& enabled_types) = 0; 407 const ModelTypeSet& enabled_types) = 0;
413 408
409 // Forwards to the underlying notifier (see
410 // SyncNotifier::UpdateRegisteredIds()).
411 virtual void UpdateRegisteredInvalidationIds(
412 SyncNotifierObserver* handler, const ObjectIdSet& ids) = 0;
msw 2012/08/03 05:14:21 The style guide dictates that these parameters sho
413
414 // Put the syncer in normal mode ready to perform nudges and polls. 414 // Put the syncer in normal mode ready to perform nudges and polls.
415 virtual void StartSyncingNormally( 415 virtual void StartSyncingNormally(
416 const ModelSafeRoutingInfo& routing_info) = 0; 416 const ModelSafeRoutingInfo& routing_info) = 0;
417 417
418 // Attempts to re-encrypt encrypted data types using the passphrase provided. 418 // Attempts to re-encrypt encrypted data types using the passphrase provided.
419 // Notifies observers of the result of the operation via OnPassphraseAccepted 419 // Notifies observers of the result of the operation via OnPassphraseAccepted
420 // or OnPassphraseRequired, updates the nigori node, and does re-encryption as 420 // or OnPassphraseRequired, updates the nigori node, and does re-encryption as
421 // appropriate. If an explicit password has been set previously, we drop 421 // appropriate. If an explicit password has been set previously, we drop
422 // subsequent requests to set a passphrase. If the cryptographer has pending 422 // subsequent requests to set a passphrase. If the cryptographer has pending
423 // keys, and a new implicit passphrase is provided, we try decrypting the 423 // keys, and a new implicit passphrase is provided, we try decrypting the
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 virtual bool ReceivedExperiment(Experiments* experiments) = 0; 520 virtual bool ReceivedExperiment(Experiments* experiments) = 0;
521 521
522 // Uses a read-only transaction to determine if the directory being synced has 522 // Uses a read-only transaction to determine if the directory being synced has
523 // any remaining unsynced items. May be called on any thread. 523 // any remaining unsynced items. May be called on any thread.
524 virtual bool HasUnsyncedItems() = 0; 524 virtual bool HasUnsyncedItems() = 0;
525 }; 525 };
526 526
527 } // namespace syncer 527 } // namespace syncer
528 528
529 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ 529 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698