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

Side by Side Diff: chrome/browser/extensions/app_notification_manager.cc

Issue 10694056: CPM Extension Uninstall Watching (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
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/extensions/app_notification_manager.h" 5 #include "chrome/browser/extensions/app_notification_manager.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 chrome::NOTIFICATION_APP_NOTIFICATION_STATE_CHANGED, 168 chrome::NOTIFICATION_APP_NOTIFICATION_STATE_CHANGED,
169 content::Source<Profile>(profile_), 169 content::Source<Profile>(profile_),
170 content::Details<const std::string>(&extension_id)); 170 content::Details<const std::string>(&extension_id));
171 } 171 }
172 172
173 void AppNotificationManager::Observe( 173 void AppNotificationManager::Observe(
174 int type, 174 int type,
175 const content::NotificationSource& source, 175 const content::NotificationSource& source,
176 const content::NotificationDetails& details) { 176 const content::NotificationDetails& details) {
177 CHECK(type == chrome::NOTIFICATION_EXTENSION_UNINSTALLED); 177 CHECK(type == chrome::NOTIFICATION_EXTENSION_UNINSTALLED);
178 ClearAll(*content::Details<const std::string>(details).ptr()); 178 ClearAll(content::Details<const extensions::Extension>(details).ptr()->id());
179 } 179 }
180 180
181 syncer::SyncDataList AppNotificationManager::GetAllSyncData( 181 syncer::SyncDataList AppNotificationManager::GetAllSyncData(
182 syncable::ModelType type) const { 182 syncable::ModelType type) const {
183 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 183 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
184 DCHECK(loaded()); 184 DCHECK(loaded());
185 DCHECK_EQ(syncable::APP_NOTIFICATIONS, type); 185 DCHECK_EQ(syncable::APP_NOTIFICATIONS, type);
186 syncer::SyncDataList data; 186 syncer::SyncDataList data;
187 for (NotificationMap::const_iterator iter = notifications_->begin(); 187 for (NotificationMap::const_iterator iter = notifications_->begin();
188 iter != notifications_->end(); ++iter) { 188 iter != notifications_->end(); ++iter) {
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 AppNotification* notification = new AppNotification( 570 AppNotification* notification = new AppNotification(
571 false, base::Time::FromInternalValue(specifics.creation_timestamp_ms()), 571 false, base::Time::FromInternalValue(specifics.creation_timestamp_ms()),
572 specifics.guid(), specifics.app_id(), 572 specifics.guid(), specifics.app_id(),
573 specifics.title(), specifics.body_text()); 573 specifics.title(), specifics.body_text());
574 if (specifics.has_link_text()) 574 if (specifics.has_link_text())
575 notification->set_link_text(specifics.link_text()); 575 notification->set_link_text(specifics.link_text());
576 if (specifics.has_link_url()) 576 if (specifics.has_link_url())
577 notification->set_link_url(GURL(specifics.link_url())); 577 notification->set_link_url(GURL(specifics.link_url()));
578 return notification; 578 return notification;
579 } 579 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698