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

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

Issue 137753012: [sync]: add ManagedUserSigninManagerWrapper and pass to ProfileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 30 matching lines...) Expand all
41 #include "google_apis/gaia/oauth2_token_service.h" 41 #include "google_apis/gaia/oauth2_token_service.h"
42 #include "net/base/backoff_entry.h" 42 #include "net/base/backoff_entry.h"
43 #include "sync/internal_api/public/base/model_type.h" 43 #include "sync/internal_api/public/base/model_type.h"
44 #include "sync/internal_api/public/engine/model_safe_worker.h" 44 #include "sync/internal_api/public/engine/model_safe_worker.h"
45 #include "sync/internal_api/public/sync_manager_factory.h" 45 #include "sync/internal_api/public/sync_manager_factory.h"
46 #include "sync/internal_api/public/util/experiments.h" 46 #include "sync/internal_api/public/util/experiments.h"
47 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" 47 #include "sync/internal_api/public/util/unrecoverable_error_handler.h"
48 #include "sync/js/sync_js_controller.h" 48 #include "sync/js/sync_js_controller.h"
49 #include "url/gurl.h" 49 #include "url/gurl.h"
50 50
51 class ManagedUserSigninManagerWrapper;
51 class Profile; 52 class Profile;
52 class ProfileOAuth2TokenService; 53 class ProfileOAuth2TokenService;
53 class ProfileSyncComponentsFactory; 54 class ProfileSyncComponentsFactory;
54 class SigninManagerBase; 55 class SigninManagerBase;
55 class SyncGlobalError; 56 class SyncGlobalError;
56 57
57 namespace browser_sync { 58 namespace browser_sync {
58 class BackendMigrator; 59 class BackendMigrator;
59 class ChangeProcessor; 60 class ChangeProcessor;
60 class DataTypeManager; 61 class DataTypeManager;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 DATATYPES_NOT_INITIALIZED, 253 DATATYPES_NOT_INITIALIZED,
253 INITIALIZED, 254 INITIALIZED,
254 UNKNOWN_ERROR, 255 UNKNOWN_ERROR,
255 }; 256 };
256 257
257 // Default sync server URL. 258 // Default sync server URL.
258 static const char* kSyncServerUrl; 259 static const char* kSyncServerUrl;
259 // Sync server URL for dev channel users 260 // Sync server URL for dev channel users
260 static const char* kDevServerUrl; 261 static const char* kDevServerUrl;
261 262
262 // Takes ownership of |factory|. 263 // Takes ownership of |factory| and |signin_wrapper|.
263 ProfileSyncService(ProfileSyncComponentsFactory* factory, 264 ProfileSyncService(ProfileSyncComponentsFactory* factory,
264 Profile* profile, 265 Profile* profile,
265 SigninManagerBase* signin, 266 ManagedUserSigninManagerWrapper* signin_wrapper,
266 ProfileOAuth2TokenService* oauth2_token_service, 267 ProfileOAuth2TokenService* oauth2_token_service,
267 StartBehavior start_behavior); 268 StartBehavior start_behavior);
268 virtual ~ProfileSyncService(); 269 virtual ~ProfileSyncService();
269 270
270 // Initializes the object. This must be called at most once, and 271 // Initializes the object. This must be called at most once, and
271 // immediately after an object of this class is constructed. 272 // immediately after an object of this class is constructed.
272 void Initialize(); 273 void Initialize();
273 274
274 virtual void SetSyncSetupCompleted(); 275 virtual void SetSyncSetupCompleted();
275 276
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 // this is based on the cryptographer's settings, so if the user has recently 633 // this is based on the cryptographer's settings, so if the user has recently
633 // requested encryption to be turned on, this may not be true yet. For that, 634 // requested encryption to be turned on, this may not be true yet. For that,
634 // encryption_pending() must be checked. 635 // encryption_pending() must be checked.
635 virtual bool EncryptEverythingEnabled() const; 636 virtual bool EncryptEverythingEnabled() const;
636 637
637 // Returns true if the syncer is waiting for new datatypes to be encrypted. 638 // Returns true if the syncer is waiting for new datatypes to be encrypted.
638 virtual bool encryption_pending() const; 639 virtual bool encryption_pending() const;
639 640
640 const GURL& sync_service_url() const { return sync_service_url_; } 641 const GURL& sync_service_url() const { return sync_service_url_; }
641 bool auto_start_enabled() const { return auto_start_enabled_; } 642 bool auto_start_enabled() const { return auto_start_enabled_; }
642 SigninManagerBase* signin() const { return signin_; } 643 SigninManagerBase* signin() const;
643 bool setup_in_progress() const { return setup_in_progress_; } 644 bool setup_in_progress() const { return setup_in_progress_; }
644 645
645 // Stops the sync backend and sets the flag for suppressing sync startup. 646 // Stops the sync backend and sets the flag for suppressing sync startup.
646 void StopAndSuppress(); 647 void StopAndSuppress();
647 648
648 // Resets the flag for suppressing sync startup and starts the sync backend. 649 // Resets the flag for suppressing sync startup and starts the sync backend.
649 virtual void UnsuppressAndStart(); 650 virtual void UnsuppressAndStart();
650 651
651 // Marks all currently registered types as "acknowledged" so we won't prompt 652 // Marks all currently registered types as "acknowledged" so we won't prompt
652 // the user about them any more. 653 // the user about them any more.
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 // ProfileSyncService from starting backend till browser restarted or user 925 // ProfileSyncService from starting backend till browser restarted or user
925 // signed out. 926 // signed out.
926 bool sync_disabled_by_admin_; 927 bool sync_disabled_by_admin_;
927 928
928 // Set to true if a signin has completed but we're still waiting for the 929 // Set to true if a signin has completed but we're still waiting for the
929 // backend to refresh its credentials. 930 // backend to refresh its credentials.
930 bool is_auth_in_progress_; 931 bool is_auth_in_progress_;
931 932
932 // Encapsulates user signin - used to set/get the user's authenticated 933 // Encapsulates user signin - used to set/get the user's authenticated
933 // email address. 934 // email address.
934 SigninManagerBase* signin_; 935 scoped_ptr<ManagedUserSigninManagerWrapper> signin_;
935 936
936 // Information describing an unrecoverable error. 937 // Information describing an unrecoverable error.
937 UnrecoverableErrorReason unrecoverable_error_reason_; 938 UnrecoverableErrorReason unrecoverable_error_reason_;
938 std::string unrecoverable_error_message_; 939 std::string unrecoverable_error_message_;
939 tracked_objects::Location unrecoverable_error_location_; 940 tracked_objects::Location unrecoverable_error_location_;
940 941
941 // Manages the start and stop of the various data types. 942 // Manages the start and stop of the various data types.
942 scoped_ptr<browser_sync::DataTypeManager> data_type_manager_; 943 scoped_ptr<browser_sync::DataTypeManager> data_type_manager_;
943 944
944 ObserverList<ProfileSyncServiceBase::Observer> observers_; 945 ObserverList<ProfileSyncServiceBase::Observer> observers_;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 scoped_ptr<syncer::NetworkResources> network_resources_; 1041 scoped_ptr<syncer::NetworkResources> network_resources_;
1041 1042
1042 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 1043 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
1043 }; 1044 };
1044 1045
1045 bool ShouldShowActionOnUI( 1046 bool ShouldShowActionOnUI(
1046 const syncer::SyncProtocolError& error); 1047 const syncer::SyncProtocolError& error);
1047 1048
1048 1049
1049 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 1050 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698