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

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

Issue 9235040: [Sync] Handle errors during first sync gracefully. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload before commit. Created 8 years, 10 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>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/gtest_prod_util.h" 14 #include "base/gtest_prod_util.h"
15 #include "base/location.h" 15 #include "base/location.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/observer_list.h" 18 #include "base/observer_list.h"
19 #include "base/string16.h" 19 #include "base/string16.h"
20 #include "base/time.h" 20 #include "base/time.h"
21 #include "base/timer.h" 21 #include "base/timer.h"
22 #include "chrome/browser/profiles/profile_keyed_service.h" 22 #include "chrome/browser/profiles/profile_keyed_service.h"
23 #include "chrome/browser/sync/backend_unrecoverable_error_handler.h" 23 #include "chrome/browser/sync/backend_unrecoverable_error_handler.h"
24 #include "chrome/browser/sync/engine/model_safe_worker.h" 24 #include "chrome/browser/sync/engine/model_safe_worker.h"
25 #include "chrome/browser/sync/failed_datatypes_handler.h" 25 #include "chrome/browser/sync/failed_datatypes_handler.h"
26 #include "chrome/browser/sync/glue/data_type_controller.h" 26 #include "chrome/browser/sync/glue/data_type_controller.h"
27 #include "chrome/browser/sync/glue/data_type_manager.h"
27 #include "chrome/browser/sync/glue/sync_backend_host.h" 28 #include "chrome/browser/sync/glue/sync_backend_host.h"
28 #include "chrome/browser/sync/internal_api/includes/unrecoverable_error_handler. h" 29 #include "chrome/browser/sync/internal_api/includes/unrecoverable_error_handler. h"
29 #include "chrome/browser/sync/internal_api/sync_manager.h" 30 #include "chrome/browser/sync/internal_api/sync_manager.h"
30 #include "chrome/browser/sync/profile_sync_service_observer.h" 31 #include "chrome/browser/sync/profile_sync_service_observer.h"
31 #include "chrome/browser/sync/syncable/model_type.h" 32 #include "chrome/browser/sync/syncable/model_type.h"
32 #include "chrome/browser/sync/sync_js_controller.h" 33 #include "chrome/browser/sync/sync_js_controller.h"
33 #include "chrome/browser/sync/sync_prefs.h" 34 #include "chrome/browser/sync/sync_prefs.h"
34 #include "chrome/browser/sync/sync_setup_wizard.h" 35 #include "chrome/browser/sync/sync_setup_wizard.h"
35 #include "chrome/common/net/gaia/google_service_auth_error.h" 36 #include "chrome/common/net/gaia/google_service_auth_error.h"
36 #include "content/public/browser/notification_observer.h" 37 #include "content/public/browser/notification_observer.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 210
210 // Whether sync is enabled by user or not. 211 // Whether sync is enabled by user or not.
211 virtual bool HasSyncSetupCompleted() const; 212 virtual bool HasSyncSetupCompleted() const;
212 virtual void SetSyncSetupCompleted(); 213 virtual void SetSyncSetupCompleted();
213 214
214 // SyncFrontend implementation. 215 // SyncFrontend implementation.
215 virtual void OnBackendInitialized( 216 virtual void OnBackendInitialized(
216 const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend, 217 const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend,
217 bool success) OVERRIDE; 218 bool success) OVERRIDE;
218 virtual void OnSyncCycleCompleted() OVERRIDE; 219 virtual void OnSyncCycleCompleted() OVERRIDE;
220 virtual void OnSyncConfigureRetry() OVERRIDE;
219 virtual void OnAuthError() OVERRIDE; 221 virtual void OnAuthError() OVERRIDE;
220 virtual void OnStopSyncingPermanently() OVERRIDE; 222 virtual void OnStopSyncingPermanently() OVERRIDE;
221 virtual void OnClearServerDataFailed() OVERRIDE; 223 virtual void OnClearServerDataFailed() OVERRIDE;
222 virtual void OnClearServerDataSucceeded() OVERRIDE; 224 virtual void OnClearServerDataSucceeded() OVERRIDE;
223 virtual void OnPassphraseRequired( 225 virtual void OnPassphraseRequired(
224 sync_api::PassphraseRequiredReason reason, 226 sync_api::PassphraseRequiredReason reason,
225 const sync_pb::EncryptedData& pending_keys) OVERRIDE; 227 const sync_pb::EncryptedData& pending_keys) OVERRIDE;
226 virtual void OnPassphraseAccepted() OVERRIDE; 228 virtual void OnPassphraseAccepted() OVERRIDE;
227 virtual void OnEncryptedTypesChanged( 229 virtual void OnEncryptedTypesChanged(
228 syncable::ModelTypeSet encrypted_types, 230 syncable::ModelTypeSet encrypted_types,
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 void UnsuppressAndStart(); 487 void UnsuppressAndStart();
486 488
487 // Marks all currently registered types as "acknowledged" so we won't prompt 489 // Marks all currently registered types as "acknowledged" so we won't prompt
488 // the user about them any more. 490 // the user about them any more.
489 void AcknowledgeSyncedTypes(); 491 void AcknowledgeSyncedTypes();
490 492
491 SyncGlobalError* sync_global_error() { return sync_global_error_.get(); } 493 SyncGlobalError* sync_global_error() { return sync_global_error_.get(); }
492 494
493 virtual const FailedDatatypesHandler& failed_datatypes_handler(); 495 virtual const FailedDatatypesHandler& failed_datatypes_handler();
494 496
497 browser_sync::DataTypeManager::ConfigureStatus configure_status() {
498 return configure_status_;
499 }
500
495 // ProfileKeyedService implementation. 501 // ProfileKeyedService implementation.
496 virtual void Shutdown() OVERRIDE; 502 virtual void Shutdown() OVERRIDE;
497 503
498 protected: 504 protected:
499 // Used by test classes that derive from ProfileSyncService. 505 // Used by test classes that derive from ProfileSyncService.
500 virtual browser_sync::SyncBackendHost* GetBackendForTest(); 506 virtual browser_sync::SyncBackendHost* GetBackendForTest();
501 507
502 // Helper to install and configure a data type manager. 508 // Helper to install and configure a data type manager.
503 void ConfigureDataTypeManager(); 509 void ConfigureDataTypeManager();
504 510
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 711
706 // This is used to show sync errors in the wrench menu. 712 // This is used to show sync errors in the wrench menu.
707 scoped_ptr<SyncGlobalError> sync_global_error_; 713 scoped_ptr<SyncGlobalError> sync_global_error_;
708 714
709 // keeps track of data types that failed to load. 715 // keeps track of data types that failed to load.
710 FailedDatatypesHandler failed_datatypes_handler_; 716 FailedDatatypesHandler failed_datatypes_handler_;
711 717
712 scoped_ptr<browser_sync::BackendUnrecoverableErrorHandler> 718 scoped_ptr<browser_sync::BackendUnrecoverableErrorHandler>
713 backend_unrecoverable_error_handler_; 719 backend_unrecoverable_error_handler_;
714 720
721 browser_sync::DataTypeManager::ConfigureStatus configure_status_;
722
715 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 723 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
716 }; 724 };
717 725
718 bool ShouldShowActionOnUI( 726 bool ShouldShowActionOnUI(
719 const browser_sync::SyncProtocolError& error); 727 const browser_sync::SyncProtocolError& error);
720 728
721 729
722 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 730 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/js/js_sync_manager_observer_unittest.cc ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698