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

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

Issue 22470006: Process incoming updates and deletes properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates and deletes: CR feedback from DewittJ and Zea Created 7 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // of what we want without also trying to fetch bitmaps. Other tests will 84 // of what we want without also trying to fetch bitmaps. Other tests will
85 // cover bitmap fetching. 85 // cover bitmap fetching.
86 static void set_avoid_bitmap_fetching_for_test(bool avoid) { 86 static void set_avoid_bitmap_fetching_for_test(bool avoid) {
87 avoid_bitmap_fetching_for_test_ = avoid; 87 avoid_bitmap_fetching_for_test_ = avoid;
88 } 88 }
89 89
90 private: 90 private:
91 // Add a notification to our list. This takes ownership of the pointer. 91 // Add a notification to our list. This takes ownership of the pointer.
92 void Add(scoped_ptr<notifier::SyncedNotification> notification); 92 void Add(scoped_ptr<notifier::SyncedNotification> notification);
93 93
94 // Display this notification in the notification center, or remove it.
95 void UpdateInMessageCenter(notifier::SyncedNotification* notification);
96
94 // Display a notification in the notification center (eventually). 97 // Display a notification in the notification center (eventually).
95 void Display(notifier::SyncedNotification* notification); 98 void Display(notifier::SyncedNotification* notification);
96 99
100 // Remove a notification from our store.
101 void FreeNotificationById(const std::string& notification_id);
102
97 // Back pointer to the owning profile. 103 // Back pointer to the owning profile.
98 Profile* const profile_; 104 Profile* const profile_;
99 NotificationUIManager* const notification_manager_; 105 NotificationUIManager* const notification_manager_;
100 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; 106 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_;
101 std::vector<std::string> enabled_sending_services_; 107 std::vector<std::string> enabled_sending_services_;
102 static bool avoid_bitmap_fetching_for_test_; 108 static bool avoid_bitmap_fetching_for_test_;
103 109
104 // TODO(petewil): Consider whether a map would better suit our data. 110 // TODO(petewil): Consider whether a map would better suit our data.
105 // If there are many entries, lookup time may trump locality of reference. 111 // If there are many entries, lookup time may trump locality of reference.
106 ScopedVector<notifier::SyncedNotification> notification_data_; 112 ScopedVector<notifier::SyncedNotification> notification_data_;
107 113
108 friend class ChromeNotifierServiceTest; 114 friend class ChromeNotifierServiceTest;
109 115
110 DISALLOW_COPY_AND_ASSIGN(ChromeNotifierService); 116 DISALLOW_COPY_AND_ASSIGN(ChromeNotifierService);
111 }; 117 };
112 118
113 } // namespace notifier 119 } // namespace notifier
114 120
115 #endif // CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_ 121 #endif // CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698