| OLD | NEW |
| 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_GLUE_EXTENSION_CHANGE_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_EXTENSION_CHANGE_PROCESSOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_EXTENSION_CHANGE_PROCESSOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_EXTENSION_CHANGE_PROCESSOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "chrome/browser/sync/engine/syncapi.h" | 10 #include "chrome/browser/sync/engine/syncapi.h" |
| 11 #include "chrome/browser/sync/glue/change_processor.h" | 11 #include "chrome/browser/sync/glue/change_processor.h" |
| 12 #include "chrome/browser/sync/glue/extension_sync_traits.h" | 12 #include "chrome/browser/sync/glue/extension_sync_traits.h" |
| 13 #include "content/common/content_notification_types.h" |
| 13 #include "content/common/notification_observer.h" | 14 #include "content/common/notification_observer.h" |
| 14 #include "content/common/notification_registrar.h" | 15 #include "content/common/notification_registrar.h" |
| 15 #include "content/common/notification_type.h" | |
| 16 | 16 |
| 17 class ExtensionServiceInterface; | 17 class ExtensionServiceInterface; |
| 18 | 18 |
| 19 namespace browser_sync { | 19 namespace browser_sync { |
| 20 | 20 |
| 21 class UnrecoverableErrorHandler; | 21 class UnrecoverableErrorHandler; |
| 22 | 22 |
| 23 // This class is responsible for taking changes from the | 23 // This class is responsible for taking changes from the |
| 24 // ExtensionService and applying them to the sync_api 'syncable' | 24 // ExtensionService and applying them to the sync_api 'syncable' |
| 25 // model, and vice versa. All operations and use of this class are | 25 // model, and vice versa. All operations and use of this class are |
| 26 // from the UI thread. | 26 // from the UI thread. |
| 27 class ExtensionChangeProcessor : public ChangeProcessor, | 27 class ExtensionChangeProcessor : public ChangeProcessor, |
| 28 public NotificationObserver { | 28 public NotificationObserver { |
| 29 public: | 29 public: |
| 30 // Does not take ownership of |error_handler|. | 30 // Does not take ownership of |error_handler|. |
| 31 explicit ExtensionChangeProcessor(UnrecoverableErrorHandler* error_handler); | 31 explicit ExtensionChangeProcessor(UnrecoverableErrorHandler* error_handler); |
| 32 virtual ~ExtensionChangeProcessor(); | 32 virtual ~ExtensionChangeProcessor(); |
| 33 | 33 |
| 34 // NotificationObserver implementation. | 34 // NotificationObserver implementation. |
| 35 // BrowserExtensionProvider -> sync_api model change application. | 35 // BrowserExtensionProvider -> sync_api model change application. |
| 36 virtual void Observe(NotificationType type, | 36 virtual void Observe(int type, |
| 37 const NotificationSource& source, | 37 const NotificationSource& source, |
| 38 const NotificationDetails& details); | 38 const NotificationDetails& details); |
| 39 | 39 |
| 40 // ChangeProcessor implementation. | 40 // ChangeProcessor implementation. |
| 41 // sync_api model -> BrowserExtensionProvider change application. | 41 // sync_api model -> BrowserExtensionProvider change application. |
| 42 virtual void ApplyChangesFromSyncModel( | 42 virtual void ApplyChangesFromSyncModel( |
| 43 const sync_api::BaseTransaction* trans, | 43 const sync_api::BaseTransaction* trans, |
| 44 const sync_api::SyncManager::ChangeRecord* changes, | 44 const sync_api::SyncManager::ChangeRecord* changes, |
| 45 int change_count); | 45 int change_count); |
| 46 | 46 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 59 // Non-NULL iff |running()| is true. | 59 // Non-NULL iff |running()| is true. |
| 60 Profile* profile_; | 60 Profile* profile_; |
| 61 ExtensionServiceInterface* extension_service_; | 61 ExtensionServiceInterface* extension_service_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(ExtensionChangeProcessor); | 63 DISALLOW_COPY_AND_ASSIGN(ExtensionChangeProcessor); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace browser_sync | 66 } // namespace browser_sync |
| 67 | 67 |
| 68 #endif // CHROME_BROWSER_SYNC_GLUE_EXTENSION_CHANGE_PROCESSOR_H_ | 68 #endif // CHROME_BROWSER_SYNC_GLUE_EXTENSION_CHANGE_PROCESSOR_H_ |
| OLD | NEW |