summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/app_notification_test_util.cc
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-18 21:44:44 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-18 21:44:44 +0000
commit5a1ad5c1ba4c5b9e86805e1c6fb7364492d6ac80 (patch)
tree471ff33ec7c19913601fc03dfaf63de606c21022 /chrome/browser/extensions/app_notification_test_util.cc
parent0b5781a63246fb4abf31f871b445a6d85970b19f (diff)
downloadchromium_src-5a1ad5c1ba4c5b9e86805e1c6fb7364492d6ac80.zip
chromium_src-5a1ad5c1ba4c5b9e86805e1c6fb7364492d6ac80.tar.gz
chromium_src-5a1ad5c1ba4c5b9e86805e1c6fb7364492d6ac80.tar.bz2
Revert 106110 - Implement SyncableService in AppNotificationsManager:
- Implement all methods of SyncableService - Modify existing methods that change the model (Add and ClearAll) to push changes to sync. - Add some extra properties to AppNotification: guid and extension id - Disallow operations on model until storage is loaded. - Ton of unit tests for sync methods There is anotehr part for the full notifications sync to work that will be done in a separate CL. Review URL: http://codereview.chromium.org/8263002 TBR=munjal@chromium.org Review URL: http://codereview.chromium.org/8345022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/app_notification_test_util.cc')
-rw-r--r--chrome/browser/extensions/app_notification_test_util.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/chrome/browser/extensions/app_notification_test_util.cc b/chrome/browser/extensions/app_notification_test_util.cc
index acef4e1..a148e50 100644
--- a/chrome/browser/extensions/app_notification_test_util.cc
+++ b/chrome/browser/extensions/app_notification_test_util.cc
@@ -21,15 +21,12 @@ void ExpectListsEqual(const AppNotificationList& one,
}
void AddNotifications(AppNotificationList* list,
- const std::string& extension_id,
int count,
- const std::string& prefix) {
+ std::string prefix) {
for (int i = 0; i < count; i++) {
- std::string guid = prefix + "_guid_" + IntToString(i);
std::string title = prefix + "_title_" + IntToString(i);
std::string body = prefix + "_body_" + IntToString(i);
- AppNotification* item = new AppNotification(
- true, guid, extension_id, title, body);
+ AppNotification* item = new AppNotification(title, body);
if (i % 2 == 0) {
item->set_link_url(GURL("http://www.example.com/" + prefix));
item->set_link_text(prefix + "_link_" + IntToString(i));
@@ -39,23 +36,20 @@ void AddNotifications(AppNotificationList* list,
}
AppNotification* CopyAppNotification(const AppNotification& source) {
- AppNotification* copy = new AppNotification(
- source.is_local(), source.guid(), source.extension_id(),
- source.title(), source.body());
+ AppNotification* copy = new AppNotification(source.title(), source.body());
copy->set_link_url(source.link_url());
copy->set_link_text(source.link_text());
return copy;
}
-bool AddCopiesFromList(AppNotificationManager* manager,
+void AddCopiesFromList(AppNotificationManager* manager,
+ const std::string& extension_id,
const AppNotificationList& list) {
- bool result = true;
for (AppNotificationList::const_iterator i = list.begin();
i != list.end();
++i) {
- result = result && manager->Add(CopyAppNotification(*(i->get())));
+ manager->Add(extension_id, CopyAppNotification(*(i->get())));
}
- return result;
}
} // namespace app_notification_test_util