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

Side by Side Diff: chrome/browser/api/sync/profile_sync_service_base.h

Issue 10910071: Extract abstract base to API directory for ProfileSyncService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More unit test fixes. Created 8 years, 3 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
« no previous file with comments | « chrome/browser/api/sync/OWNERS ('k') | chrome/browser/api/sync/profile_sync_service_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_API_SYNC_PROFILE_SYNC_SERVICE_BASE_H_
6 #define CHROME_BROWSER_API_SYNC_PROFILE_SYNC_SERVICE_BASE_H_
7
8 #include "chrome/browser/api/sync/profile_sync_service_observer.h"
9 #include "sync/internal_api/public/base/model_type.h"
10
11 namespace content {
12 class BrowserContext;
13 }
14
15 // API for ProfileSyncService.
16 class ProfileSyncServiceBase {
17 public:
18 // Retrieve the sync service to use in the given context.
19 // Returns NULL if sync is not enabled for the context.
20 static ProfileSyncServiceBase* ForContext(content::BrowserContext* context);
21
22 typedef ProfileSyncServiceObserver Observer;
23
24 virtual ~ProfileSyncServiceBase() {}
25
26 // Whether sync is enabled by user or not.
27 virtual bool HasSyncSetupCompleted() const = 0;
28
29 // Returns whether processing changes is allowed. Check this before doing
30 // any model-modifying operations.
31 virtual bool ShouldPushChanges() = 0;
32
33 // Get the set of currently enabled data types (as chosen or
34 // configured by the user). See class comment on ProfileSyncService
35 // for more on what it means for a datatype to be Preferred.
36 virtual syncer::ModelTypeSet GetPreferredDataTypes() const = 0;
37
38 // Adds/removes an observer. ProfileSyncServiceBase does not take
39 // ownership of the observer.
40 virtual void AddObserver(Observer* observer) = 0;
41 virtual void RemoveObserver(Observer* observer) = 0;
42
43 // Returns true if |observer| has already been added as an observer.
44 virtual bool HasObserver(Observer* observer) const = 0;
45 };
46
47 #endif // CHROME_BROWSER_API_SYNC_PROFILE_SYNC_SERVICE_BASE_H_
OLDNEW
« no previous file with comments | « chrome/browser/api/sync/OWNERS ('k') | chrome/browser/api/sync/profile_sync_service_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698