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

Unified Diff: chrome/browser/notifications/balloon_collection_base.cc

Issue 20136004: Allow partial update for notification update API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add more tests per feedback Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/balloon_collection_base.cc
diff --git a/chrome/browser/notifications/balloon_collection_base.cc b/chrome/browser/notifications/balloon_collection_base.cc
index c7487390bb5dc8cecbe70e52268bc58d9c05cebe..b7f8669a8f924e75352accf6dc4dcadd5db69d47 100644
--- a/chrome/browser/notifications/balloon_collection_base.cc
+++ b/chrome/browser/notifications/balloon_collection_base.cc
@@ -35,13 +35,15 @@ void BalloonCollectionBase::Remove(Balloon* balloon) {
}
}
-bool BalloonCollectionBase::DoesIdExist(const std::string& id) {
- Balloons::iterator iter;
+const Notification* BalloonCollectionBase::FindById(
+ const std::string& id) const {
+ Balloons::const_iterator iter;
for (iter = balloons_.begin(); iter != balloons_.end(); ++iter) {
- if ((*iter)->notification().notification_id() == id)
- return true;
+ if ((*iter)->notification().notification_id() == id) {
+ return &((*iter)->notification());
+ }
}
- return false;
+ return NULL;
}
bool BalloonCollectionBase::CloseById(const std::string& id) {
« no previous file with comments | « chrome/browser/notifications/balloon_collection_base.h ('k') | chrome/browser/notifications/balloon_collection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698