| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
| 37 #include "chrome/browser/notifications/login_state_notification_blocker_chromeos
.h" | 37 #include "chrome/browser/notifications/login_state_notification_blocker_chromeos
.h" |
| 38 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 38 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 #if defined(USE_ASH) | 41 #if defined(USE_ASH) |
| 42 #include "ash/shell.h" | 42 #include "ash/shell.h" |
| 43 #include "ash/system/web_notification/web_notification_tray.h" | 43 #include "ash/system/web_notification/web_notification_tray.h" |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 // Mac does support native notifications and defines this method |
| 47 // in notification_ui_manager_mac.mm |
| 48 #if !defined(OS_MACOSX) |
| 49 // static |
| 50 NotificationUIManager* |
| 51 NotificationUIManager::CreateNativeNotificationManager() { |
| 52 return nullptr; |
| 53 } |
| 54 #endif |
| 55 |
| 46 MessageCenterNotificationManager::MessageCenterNotificationManager( | 56 MessageCenterNotificationManager::MessageCenterNotificationManager( |
| 47 message_center::MessageCenter* message_center, | 57 message_center::MessageCenter* message_center, |
| 48 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider) | 58 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider) |
| 49 : message_center_(message_center), | 59 : message_center_(message_center), |
| 50 settings_provider_(std::move(settings_provider)), | 60 settings_provider_(std::move(settings_provider)), |
| 51 system_observer_(this), | 61 system_observer_(this), |
| 52 stats_collector_(message_center), | 62 stats_collector_(message_center), |
| 53 google_now_stats_collector_(message_center) | 63 google_now_stats_collector_(message_center) { |
| 54 { | |
| 55 message_center_->AddObserver(this); | 64 message_center_->AddObserver(this); |
| 56 message_center_->SetNotifierSettingsProvider(settings_provider_.get()); | 65 message_center_->SetNotifierSettingsProvider(settings_provider_.get()); |
| 57 | 66 |
| 58 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
| 59 blockers_.push_back(make_scoped_ptr( | 68 blockers_.push_back(make_scoped_ptr( |
| 60 new LoginStateNotificationBlockerChromeOS(message_center))); | 69 new LoginStateNotificationBlockerChromeOS(message_center))); |
| 61 #else | 70 #else |
| 62 blockers_.push_back(make_scoped_ptr( | 71 blockers_.push_back(make_scoped_ptr( |
| 63 new ScreenLockNotificationBlocker(message_center))); | 72 new ScreenLockNotificationBlocker(message_center))); |
| 64 #endif | 73 #endif |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 it != registry->enabled_extensions().end(); | 385 it != registry->enabled_extensions().end(); |
| 377 ++it) { | 386 ++it) { |
| 378 if ((*it->get()).permissions_data()->HasAPIPermission( | 387 if ((*it->get()).permissions_data()->HasAPIPermission( |
| 379 extensions::APIPermission::ID::kNotificationProvider)) { | 388 extensions::APIPermission::ID::kNotificationProvider)) { |
| 380 extension_id = (*it->get()).id(); | 389 extension_id = (*it->get()).id(); |
| 381 return extension_id; | 390 return extension_id; |
| 382 } | 391 } |
| 383 } | 392 } |
| 384 return extension_id; | 393 return extension_id; |
| 385 } | 394 } |
| OLD | NEW |