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

Side by Side Diff: chrome/browser/notifications/sync_notifier/chrome_notifier_service.h

Issue 12717010: Widen Data Pipes and newer protobufs (Closed) Base URL: http://git.chromium.org/chromium/src.git@newProtobufs
Patch Set: Synced Notifications newer protobufs - improve unit test robustness Created 7 years, 9 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
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 #ifndef CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // Convert from internal representation to SyncData representation. 47 // Convert from internal representation to SyncData representation.
48 static syncer::SyncData CreateSyncDataFromNotification( 48 static syncer::SyncData CreateSyncDataFromNotification(
49 const SyncedNotification& notification); 49 const SyncedNotification& notification);
50 50
51 // Convert from SyncData representation to internal representation. 51 // Convert from SyncData representation to internal representation.
52 static scoped_ptr<SyncedNotification> CreateNotificationFromSyncData( 52 static scoped_ptr<SyncedNotification> CreateNotificationFromSyncData(
53 const syncer::SyncData& sync_data); 53 const syncer::SyncData& sync_data);
54 54
55 // Get a pointer to a notification. ChromeNotifierService owns this pointer. 55 // Get a pointer to a notification. ChromeNotifierService owns this pointer.
56 // The caller must not free it. 56 // The caller must not free it.
57 notifier::SyncedNotification* FindNotificationById(const std::string& id); 57 notifier::SyncedNotification* FindNotificationByKey(const std::string& key);
58 58
59 // Called when we dismiss a notification. 59 // Called when we dismiss a notification.
60 void MarkNotificationAsDismissed(const std::string& id); 60 void MarkNotificationAsDismissed(const std::string& id);
61 61
62 // functions for test 62 // functions for test
63 void AddForTest(scoped_ptr<notifier::SyncedNotification> notification) { 63 void AddForTest(scoped_ptr<notifier::SyncedNotification> notification) {
64 Add(notification.Pass()); 64 Add(notification.Pass());
65 } 65 }
66 66
67 private: 67 private:
(...skipping 11 matching lines...) Expand all
79 // TODO(petewil): consider whether a map would better suit our data. 79 // TODO(petewil): consider whether a map would better suit our data.
80 // If there are many entries, lookup time may trump locality of reference. 80 // If there are many entries, lookup time may trump locality of reference.
81 ScopedVector<notifier::SyncedNotification> notification_data_; 81 ScopedVector<notifier::SyncedNotification> notification_data_;
82 82
83 DISALLOW_COPY_AND_ASSIGN(ChromeNotifierService); 83 DISALLOW_COPY_AND_ASSIGN(ChromeNotifierService);
84 }; 84 };
85 85
86 } // namespace notifier 86 } // namespace notifier
87 87
88 #endif // CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_ 88 #endif // CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698