OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/sync/glue/chrome_sync_notification_bridge.h" | 5 #include "chrome/browser/sync/glue/chrome_sync_notification_bridge.h" |
6 | 6 |
7 #include "chrome/common/chrome_notification_types.h" | 7 #include "chrome/common/chrome_notification_types.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/notification_service.h" | 9 #include "content/public/browser/notification_service.h" |
| 10 #include "sync/internal_api/public/base/model_type_payload_map.h" |
10 #include "sync/notifier/sync_notifier_observer.h" | 11 #include "sync/notifier/sync_notifier_observer.h" |
11 | 12 |
12 using content::BrowserThread; | 13 using content::BrowserThread; |
13 | 14 |
14 namespace browser_sync { | 15 namespace browser_sync { |
15 | 16 |
16 ChromeSyncNotificationBridge::ChromeSyncNotificationBridge( | 17 ChromeSyncNotificationBridge::ChromeSyncNotificationBridge( |
17 const Profile* profile) | 18 const Profile* profile) |
18 : observers_( | 19 : observers_( |
19 new ObserverListThreadSafe<syncer::SyncNotifierObserver>()) { | 20 new ObserverListThreadSafe<syncer::SyncNotifierObserver>()) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 syncer::ModelTypePayloadMap payload_map = *(payload_details.ptr()); | 65 syncer::ModelTypePayloadMap payload_map = *(payload_details.ptr()); |
65 | 66 |
66 if (payload_map.empty()) { | 67 if (payload_map.empty()) { |
67 // No model types to invalidate, invalidating all enabled types. | 68 // No model types to invalidate, invalidating all enabled types. |
68 payload_map = | 69 payload_map = |
69 syncer::ModelTypePayloadMapFromEnumSet(enabled_types_, std::string()); | 70 syncer::ModelTypePayloadMapFromEnumSet(enabled_types_, std::string()); |
70 } | 71 } |
71 | 72 |
72 observers_->Notify( | 73 observers_->Notify( |
73 &syncer::SyncNotifierObserver::OnIncomingNotification, | 74 &syncer::SyncNotifierObserver::OnIncomingNotification, |
74 payload_map, notification_source); | 75 ModelTypePayloadMapToObjectIdPayloadMap(payload_map), |
| 76 notification_source); |
75 } | 77 } |
76 | 78 |
77 } // namespace browser_sync | 79 } // namespace browser_sync |
OLD | NEW |