| 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_THEME_CHANGE_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_THEME_CHANGE_PROCESSOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_THEME_CHANGE_PROCESSOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_THEME_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 "content/common/content_notification_types.h" |
| 12 #include "content/common/notification_observer.h" | 13 #include "content/common/notification_observer.h" |
| 13 #include "content/common/notification_registrar.h" | 14 #include "content/common/notification_registrar.h" |
| 14 #include "content/common/notification_type.h" | |
| 15 | 15 |
| 16 class NotificationDetails; | 16 class NotificationDetails; |
| 17 class NotificationSource; | 17 class NotificationSource; |
| 18 class Profile; | 18 class Profile; |
| 19 | 19 |
| 20 namespace browser_sync { | 20 namespace browser_sync { |
| 21 | 21 |
| 22 class UnrecoverableErrorHandler; | 22 class UnrecoverableErrorHandler; |
| 23 | 23 |
| 24 // This class is responsible for taking changes from the | 24 // This class is responsible for taking changes from the |
| 25 // ThemeService and applying them to the sync_api 'syncable' | 25 // ThemeService and applying them to the sync_api 'syncable' |
| 26 // model, and vice versa. All operations and use of this class are | 26 // model, and vice versa. All operations and use of this class are |
| 27 // from the UI thread. | 27 // from the UI thread. |
| 28 class ThemeChangeProcessor : public ChangeProcessor, | 28 class ThemeChangeProcessor : public ChangeProcessor, |
| 29 public NotificationObserver { | 29 public NotificationObserver { |
| 30 public: | 30 public: |
| 31 explicit ThemeChangeProcessor(UnrecoverableErrorHandler* error_handler); | 31 explicit ThemeChangeProcessor(UnrecoverableErrorHandler* error_handler); |
| 32 virtual ~ThemeChangeProcessor(); | 32 virtual ~ThemeChangeProcessor(); |
| 33 | 33 |
| 34 // NotificationObserver implementation. | 34 // NotificationObserver implementation. |
| 35 // ThemeService -> sync_api model change application. | 35 // ThemeService -> 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 -> ThemeService change application. | 41 // sync_api model -> ThemeService 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 10 matching lines...) Expand all Loading... |
| 57 // Profile associated with the ThemeService. Non-NULL iff |running()| is | 57 // Profile associated with the ThemeService. Non-NULL iff |running()| is |
| 58 // true. | 58 // true. |
| 59 Profile* profile_; | 59 Profile* profile_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(ThemeChangeProcessor); | 61 DISALLOW_COPY_AND_ASSIGN(ThemeChangeProcessor); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace browser_sync | 64 } // namespace browser_sync |
| 65 | 65 |
| 66 #endif // CHROME_BROWSER_SYNC_GLUE_THEME_CHANGE_PROCESSOR_H_ | 66 #endif // CHROME_BROWSER_SYNC_GLUE_THEME_CHANGE_PROCESSOR_H_ |
| OLD | NEW |