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

Side by Side Diff: chrome/browser/sync/glue/app_change_processor.h

Issue 7564037: Apps/Extensions Sync refactoring -- delete most of the old glue, implement new sync API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Release build warning :-/ Created 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SYNC_GLUE_APP_CHANGE_PROCESSOR_H_
6 #define CHROME_BROWSER_SYNC_GLUE_APP_CHANGE_PROCESSOR_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "chrome/browser/sync/glue/change_processor.h"
11 #include "chrome/browser/sync/glue/extension_sync_traits.h"
12 #include "chrome/browser/sync/internal_api/sync_manager.h"
13 #include "content/common/content_notification_types.h"
14 #include "content/common/notification_observer.h"
15 #include "content/common/notification_registrar.h"
16
17 class ExtensionServiceInterface;
18
19 namespace browser_sync {
20
21 class UnrecoverableErrorHandler;
22
23 // This class is responsible for taking changes from the
24 // ExtensionService and applying them to the sync_api 'syncable'
25 // model, and vice versa. All operations and use of this class are
26 // from the UI thread.
27 class AppChangeProcessor : public ChangeProcessor,
28 public NotificationObserver {
29 public:
30 // Does not take ownership of |error_handler|.
31 explicit AppChangeProcessor(UnrecoverableErrorHandler* error_handler);
32 virtual ~AppChangeProcessor();
33
34 // NotificationObserver implementation.
35 // BrowserExtensionProvider -> sync_api model change application.
36 virtual void Observe(int type,
37 const NotificationSource& source,
38 const NotificationDetails& details);
39
40 // ChangeProcessor implementation.
41 // sync_api model -> BrowserExtensionProvider change application.
42 virtual void ApplyChangesFromSyncModel(
43 const sync_api::BaseTransaction* trans,
44 const sync_api::SyncManager::ChangeRecord* changes,
45 int change_count);
46
47 protected:
48 // ChangeProcessor implementation.
49 virtual void StartImpl(Profile* profile);
50 virtual void StopImpl();
51
52 private:
53 void StartObserving();
54 void StopObserving();
55
56 NotificationRegistrar notification_registrar_;
57 const ExtensionSyncTraits traits_;
58
59 // Non-NULL iff |running()| is true.
60 Profile* profile_;
61 ExtensionServiceInterface* extension_service_;
62
63 DISALLOW_COPY_AND_ASSIGN(AppChangeProcessor);
64 };
65
66 } // namespace browser_sync
67
68 #endif // CHROME_BROWSER_SYNC_GLUE_APP_CHANGE_PROCESSOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/test_extension_service.cc ('k') | chrome/browser/sync/glue/app_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698