| OLD | NEW |
| 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 Loading... |
| 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 syncer::ModelType type) const { | 182 syncer::ModelType type) const { |
| 183 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 183 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 184 DCHECK(loaded()); | 184 DCHECK(loaded()); |
| 185 DCHECK_EQ(syncer::APP_NOTIFICATIONS, type); | 185 DCHECK_EQ(syncer::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 Loading... |
| 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 } |
| OLD | NEW |