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

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

Issue 8332023: Add support for temporarily disabling sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplified startup condition for sync Created 9 years, 1 month 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) 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_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>
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 virtual bool encryption_pending() const; 473 virtual bool encryption_pending() const;
474 474
475 // Returns whether processing changes is allowed. Check this before doing 475 // Returns whether processing changes is allowed. Check this before doing
476 // any model-modifying operations. 476 // any model-modifying operations.
477 bool ShouldPushChanges(); 477 bool ShouldPushChanges();
478 478
479 const GURL& sync_service_url() const { return sync_service_url_; } 479 const GURL& sync_service_url() const { return sync_service_url_; }
480 SigninManager* signin() { return signin_.get(); } 480 SigninManager* signin() { return signin_.get(); }
481 const std::string& cros_user() const { return cros_user_; } 481 const std::string& cros_user() const { return cros_user_; }
482 482
483 // Stops the sync backend and sets the flag for suppressing sync startup.
484 virtual void StopSyncAndSuppressStartUp();
akalin 2011/10/26 18:53:09 Does this need to be virtual? What do you think a
485
486 // Resets the flag for suppressing sync startup and starts the sync backend.
487 virtual void DisableSyncSuppressionAndStartUpSync();
akalin 2011/10/26 18:53:09 Does this need to be virtual? What do you think a
488
483 // 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
484 // the user about them any more. 490 // the user about them any more.
485 void AcknowledgeSyncedTypes(); 491 void AcknowledgeSyncedTypes();
486 492
487 SyncGlobalError* sync_global_error() { return sync_global_error_.get(); } 493 SyncGlobalError* sync_global_error() { return sync_global_error_.get(); }
488 494
489 virtual const FailedDatatypesHandler& failed_datatypes_handler(); 495 virtual const FailedDatatypesHandler& failed_datatypes_handler();
490 496
491 protected: 497 protected:
492 // Used by test classes that derive from ProfileSyncService. 498 // Used by test classes that derive from ProfileSyncService.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 // was required for encryption, decryption with a cached passphrase, or 540 // was required for encryption, decryption with a cached passphrase, or
535 // because a new passphrase is required? 541 // because a new passphrase is required?
536 sync_api::PassphraseRequiredReason passphrase_required_reason_; 542 sync_api::PassphraseRequiredReason passphrase_required_reason_;
537 543
538 private: 544 private:
539 friend class ProfileSyncServicePasswordTest; 545 friend class ProfileSyncServicePasswordTest;
540 friend class TestProfileSyncService; 546 friend class TestProfileSyncService;
541 friend class ProfileSyncServiceForWizardTest; 547 friend class ProfileSyncServiceForWizardTest;
542 FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTest, InitialState); 548 FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTest, InitialState);
543 549
550 // Starts up sync. Called from Initialize() and
551 // DisableSyncSuppressionAndStartUpSync().
552 void StartUpIfNotSuppressed();
akalin 2011/10/26 18:53:09 what about just "StartIfNotSuppressed()" or maybe
553
544 // Called when we've determined that we don't need a passphrase (either 554 // Called when we've determined that we don't need a passphrase (either
545 // because OnPassphraseAccepted() was called, or because we've gotten a 555 // because OnPassphraseAccepted() was called, or because we've gotten a
546 // OnPassphraseRequired() but no data types are enabled). 556 // OnPassphraseRequired() but no data types are enabled).
547 void ResolvePassphraseRequired(); 557 void ResolvePassphraseRequired();
548 558
549 // If |delete_sync_data_folder| is true, then this method will delete all 559 // If |delete_sync_data_folder| is true, then this method will delete all
550 // previous "Sync Data" folders. (useful if the folder is partial/corrupt). 560 // previous "Sync Data" folders. (useful if the folder is partial/corrupt).
551 void InitializeBackend(bool delete_sync_data_folder); 561 void InitializeBackend(bool delete_sync_data_folder);
552 562
553 // Initializes the various settings from the command line. 563 // Initializes the various settings from the command line.
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 FailedDatatypesHandler failed_datatypes_handler_; 713 FailedDatatypesHandler failed_datatypes_handler_;
704 714
705 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 715 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
706 }; 716 };
707 717
708 bool ShouldShowActionOnUI( 718 bool ShouldShowActionOnUI(
709 const browser_sync::SyncProtocolError& error); 719 const browser_sync::SyncProtocolError& error);
710 720
711 721
712 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 722 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service.cc » ('j') | chrome/browser/sync/profile_sync_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698