| 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/notifications/message_center_notification_manager.h" | 5 #include "chrome/browser/notifications/message_center_notification_manager.h" | 
| 6 | 6 | 
| 7 #include "base/logging.h" | 7 #include "base/logging.h" | 
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" | 
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" | 
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" | 
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 358 } | 358 } | 
| 359 | 359 | 
| 360 void MessageCenterNotificationManager::ProfileNotification::StartDownloads() { | 360 void MessageCenterNotificationManager::ProfileNotification::StartDownloads() { | 
| 361   downloads_->StartDownloads(notification_); | 361   downloads_->StartDownloads(notification_); | 
| 362 } | 362 } | 
| 363 | 363 | 
| 364 std::string | 364 std::string | 
| 365     MessageCenterNotificationManager::ProfileNotification::GetExtensionId() { | 365     MessageCenterNotificationManager::ProfileNotification::GetExtensionId() { | 
| 366   const ExtensionURLInfo url(notification().origin_url()); | 366   const ExtensionURLInfo url(notification().origin_url()); | 
| 367   const ExtensionService* service = profile()->GetExtensionService(); | 367   const ExtensionService* service = profile()->GetExtensionService(); | 
| 368   const extensions::Extension* extension = | 368   const extensions::Extension* extension = service ? | 
| 369       service->extensions()->GetExtensionOrAppByURL(url); | 369       service->extensions()->GetExtensionOrAppByURL(url) : NULL; | 
| 370   return extension ? extension->id() : std::string(); | 370   return extension ? extension->id() : std::string(); | 
| 371 } | 371 } | 
| 372 | 372 | 
| 373 //////////////////////////////////////////////////////////////////////////////// | 373 //////////////////////////////////////////////////////////////////////////////// | 
| 374 // private | 374 // private | 
| 375 | 375 | 
| 376 void MessageCenterNotificationManager::AddProfileNotification( | 376 void MessageCenterNotificationManager::AddProfileNotification( | 
| 377     ProfileNotification* profile_notification) { | 377     ProfileNotification* profile_notification) { | 
| 378   const Notification& notification = profile_notification->notification(); | 378   const Notification& notification = profile_notification->notification(); | 
| 379   std::string id = notification.notification_id(); | 379   std::string id = notification.notification_id(); | 
| (...skipping 24 matching lines...) Expand all  Loading... | 
| 404 | 404 | 
| 405 MessageCenterNotificationManager::ProfileNotification* | 405 MessageCenterNotificationManager::ProfileNotification* | 
| 406     MessageCenterNotificationManager::FindProfileNotification( | 406     MessageCenterNotificationManager::FindProfileNotification( | 
| 407         const std::string& id) const { | 407         const std::string& id) const { | 
| 408   NotificationMap::const_iterator iter = profile_notifications_.find(id); | 408   NotificationMap::const_iterator iter = profile_notifications_.find(id); | 
| 409   // If the notification is shown in UI, it must be in the map. | 409   // If the notification is shown in UI, it must be in the map. | 
| 410   DCHECK(iter != profile_notifications_.end()); | 410   DCHECK(iter != profile_notifications_.end()); | 
| 411   DCHECK((*iter).second); | 411   DCHECK((*iter).second); | 
| 412   return (*iter).second; | 412   return (*iter).second; | 
| 413 } | 413 } | 
| OLD | NEW | 
|---|