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_PASSWORD_CHANGE_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_PASSWORD_CHANGE_PROCESSOR_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_PASSWORD_CHANGE_PROCESSOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_PASSWORD_CHANGE_PROCESSOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/sync/glue/change_processor.h" | 9 #include "chrome/browser/sync/glue/change_processor.h" |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "chrome/browser/sync/glue/password_model_associator.h" | 13 #include "chrome/browser/sync/glue/password_model_associator.h" |
14 #include "chrome/browser/sync/glue/sync_backend_host.h" | 14 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 15 #include "content/common/content_notification_types.h" |
15 #include "content/common/notification_observer.h" | 16 #include "content/common/notification_observer.h" |
16 #include "content/common/notification_registrar.h" | 17 #include "content/common/notification_registrar.h" |
17 #include "content/common/notification_type.h" | |
18 | 18 |
19 class PasswordStore; | 19 class PasswordStore; |
20 class MessageLoop; | 20 class MessageLoop; |
21 class NotificationService; | 21 class NotificationService; |
22 | 22 |
23 namespace browser_sync { | 23 namespace browser_sync { |
24 | 24 |
25 class UnrecoverableErrorHandler; | 25 class UnrecoverableErrorHandler; |
26 | 26 |
27 // This class is responsible for taking changes from the password backend and | 27 // This class is responsible for taking changes from the password backend and |
28 // applying them to the sync_api 'syncable' model, and vice versa. All | 28 // applying them to the sync_api 'syncable' model, and vice versa. All |
29 // operations and use of this class are from the DB thread on Windows and Linux, | 29 // operations and use of this class are from the DB thread on Windows and Linux, |
30 // or the password thread on Mac. | 30 // or the password thread on Mac. |
31 class PasswordChangeProcessor : public ChangeProcessor, | 31 class PasswordChangeProcessor : public ChangeProcessor, |
32 public NotificationObserver { | 32 public NotificationObserver { |
33 public: | 33 public: |
34 PasswordChangeProcessor(PasswordModelAssociator* model_associator, | 34 PasswordChangeProcessor(PasswordModelAssociator* model_associator, |
35 PasswordStore* password_store, | 35 PasswordStore* password_store, |
36 UnrecoverableErrorHandler* error_handler); | 36 UnrecoverableErrorHandler* error_handler); |
37 virtual ~PasswordChangeProcessor(); | 37 virtual ~PasswordChangeProcessor(); |
38 | 38 |
39 // NotificationObserver implementation. | 39 // NotificationObserver implementation. |
40 // Passwords -> sync_api model change application. | 40 // Passwords -> sync_api model change application. |
41 virtual void Observe(NotificationType type, | 41 virtual void Observe(int type, |
42 const NotificationSource& source, | 42 const NotificationSource& source, |
43 const NotificationDetails& details) OVERRIDE; | 43 const NotificationDetails& details) OVERRIDE; |
44 | 44 |
45 // sync_api model -> WebDataService change application. | 45 // sync_api model -> WebDataService change application. |
46 virtual void ApplyChangesFromSyncModel( | 46 virtual void ApplyChangesFromSyncModel( |
47 const sync_api::BaseTransaction* trans, | 47 const sync_api::BaseTransaction* trans, |
48 const sync_api::SyncManager::ChangeRecord* changes, | 48 const sync_api::SyncManager::ChangeRecord* changes, |
49 int change_count) OVERRIDE; | 49 int change_count) OVERRIDE; |
50 | 50 |
51 // Commit changes buffered during ApplyChanges. We must commit them to the | 51 // Commit changes buffered during ApplyChanges. We must commit them to the |
(...skipping 29 matching lines...) Expand all Loading... |
81 bool observing_; | 81 bool observing_; |
82 | 82 |
83 MessageLoop* expected_loop_; | 83 MessageLoop* expected_loop_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(PasswordChangeProcessor); | 85 DISALLOW_COPY_AND_ASSIGN(PasswordChangeProcessor); |
86 }; | 86 }; |
87 | 87 |
88 } // namespace browser_sync | 88 } // namespace browser_sync |
89 | 89 |
90 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_CHANGE_PROCESSOR_H_ | 90 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_CHANGE_PROCESSOR_H_ |
OLD | NEW |