| 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_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 stats_collector_(message_center), | 66 stats_collector_(message_center), |
| 67 google_now_stats_collector_(message_center) { | 67 google_now_stats_collector_(message_center) { |
| 68 #if defined(OS_WIN) | 68 #if defined(OS_WIN) |
| 69 first_run_pref_.Init(prefs::kMessageCenterShowedFirstRunBalloon, local_state); | 69 first_run_pref_.Init(prefs::kMessageCenterShowedFirstRunBalloon, local_state); |
| 70 #endif | 70 #endif |
| 71 | 71 |
| 72 message_center_->AddObserver(this); | 72 message_center_->AddObserver(this); |
| 73 message_center_->SetNotifierSettingsProvider(settings_provider_.get()); | 73 message_center_->SetNotifierSettingsProvider(settings_provider_.get()); |
| 74 | 74 |
| 75 #if defined(OS_CHROMEOS) | 75 #if defined(OS_CHROMEOS) |
| 76 #if !defined(USE_ATHENA) | |
| 77 // TODO(oshima|hashimoto): Support notification on athena. crbug.com/408755. | |
| 78 blockers_.push_back( | 76 blockers_.push_back( |
| 79 new LoginStateNotificationBlockerChromeOS(message_center)); | 77 new LoginStateNotificationBlockerChromeOS(message_center)); |
| 80 #endif | |
| 81 #else | 78 #else |
| 82 blockers_.push_back(new ScreenLockNotificationBlocker(message_center)); | 79 blockers_.push_back(new ScreenLockNotificationBlocker(message_center)); |
| 83 #endif | 80 #endif |
| 84 blockers_.push_back(new FullscreenNotificationBlocker(message_center)); | 81 blockers_.push_back(new FullscreenNotificationBlocker(message_center)); |
| 85 | 82 |
| 86 #if defined(OS_WIN) || defined(OS_MACOSX) \ | 83 #if defined(OS_WIN) || defined(OS_MACOSX) \ |
| 87 || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) | 84 || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| 88 // On Windows, Linux and Mac, the notification manager owns the tray icon and | 85 // On Windows, Linux and Mac, the notification manager owns the tray icon and |
| 89 // views.Other platforms have global ownership and Create will return NULL. | 86 // views.Other platforms have global ownership and Create will return NULL. |
| 90 tray_.reset(message_center::CreateMessageCenterTray()); | 87 tray_.reset(message_center::CreateMessageCenterTray()); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 it != registry->enabled_extensions().end(); | 402 it != registry->enabled_extensions().end(); |
| 406 ++it) { | 403 ++it) { |
| 407 if ((*it->get()).permissions_data()->HasAPIPermission( | 404 if ((*it->get()).permissions_data()->HasAPIPermission( |
| 408 extensions::APIPermission::ID::kNotificationProvider)) { | 405 extensions::APIPermission::ID::kNotificationProvider)) { |
| 409 extension_id = (*it->get()).id(); | 406 extension_id = (*it->get()).id(); |
| 410 return extension_id; | 407 return extension_id; |
| 411 } | 408 } |
| 412 } | 409 } |
| 413 return extension_id; | 410 return extension_id; |
| 414 } | 411 } |
| OLD | NEW |