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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // On Windows, Linux and Mac, the notification manager owns the tray icon and | 71 // On Windows, Linux and Mac, the notification manager owns the tray icon and |
72 // views.Other platforms have global ownership and Create will return NULL. | 72 // views.Other platforms have global ownership and Create will return NULL. |
73 tray_.reset(message_center::CreateMessageCenterTray()); | 73 tray_.reset(message_center::CreateMessageCenterTray()); |
74 #endif | 74 #endif |
75 } | 75 } |
76 | 76 |
77 MessageCenterNotificationManager::~MessageCenterNotificationManager() { | 77 MessageCenterNotificationManager::~MessageCenterNotificationManager() { |
78 message_center_->SetNotifierSettingsProvider(NULL); | 78 message_center_->SetNotifierSettingsProvider(NULL); |
79 message_center_->RemoveObserver(this); | 79 message_center_->RemoveObserver(this); |
80 | 80 |
81 STLDeleteContainerPairSecondPointers(profile_notifications_.begin(), | 81 base::STLDeleteContainerPairSecondPointers(profile_notifications_.begin(), |
82 profile_notifications_.end()); | 82 profile_notifications_.end()); |
83 profile_notifications_.clear(); | 83 profile_notifications_.clear(); |
84 } | 84 } |
85 | 85 |
86 //////////////////////////////////////////////////////////////////////////////// | 86 //////////////////////////////////////////////////////////////////////////////// |
87 // NotificationUIManager | 87 // NotificationUIManager |
88 | 88 |
89 void MessageCenterNotificationManager::Add(const Notification& notification, | 89 void MessageCenterNotificationManager::Add(const Notification& notification, |
90 Profile* profile) { | 90 Profile* profile) { |
91 if (Update(notification, profile)) | 91 if (Update(notification, profile)) |
92 return; | 92 return; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 it != registry->enabled_extensions().end(); | 379 it != registry->enabled_extensions().end(); |
380 ++it) { | 380 ++it) { |
381 if ((*it->get()).permissions_data()->HasAPIPermission( | 381 if ((*it->get()).permissions_data()->HasAPIPermission( |
382 extensions::APIPermission::ID::kNotificationProvider)) { | 382 extensions::APIPermission::ID::kNotificationProvider)) { |
383 extension_id = (*it->get()).id(); | 383 extension_id = (*it->get()).id(); |
384 return extension_id; | 384 return extension_id; |
385 } | 385 } |
386 } | 386 } |
387 return extension_id; | 387 return extension_id; |
388 } | 388 } |
OLD | NEW |