Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/browser/sync/glue/chrome_sync_notification_bridge.cc

Issue 10702074: Refactor sync-specific parts out of SyncNotifier/SyncNotifierObserver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor cleanup Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698