| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 content::Details<const syncer::ModelTypePayloadMap> | 63 content::Details<const syncer::ModelTypePayloadMap> |
| 63 payload_details(details); | 64 payload_details(details); |
| 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 |
| 73 // TODO(dcheng): I'm not entirely sure this is the right fix. |
| 72 observers_->Notify( | 74 observers_->Notify( |
| 73 &syncer::SyncNotifierObserver::OnIncomingNotification, | 75 &syncer::SyncNotifierObserver::OnIncomingNotification, |
| 74 payload_map, notification_source); | 76 ModelTypePayloadMapToObjectIdPayloadMap(payload_map), |
| 77 notification_source); |
| 75 } | 78 } |
| 76 | 79 |
| 77 } // namespace browser_sync | 80 } // namespace browser_sync |
| OLD | NEW |