| 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/balloon_notification_ui_manager.h" | 5 #include "chrome/browser/notifications/balloon_notification_ui_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 "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/fullscreen.h" | 12 #include "chrome/browser/fullscreen.h" |
| 13 #include "chrome/browser/idle.h" | 13 #include "chrome/browser/idle.h" |
| 14 #include "chrome/browser/notifications/balloon_collection.h" | 14 #include "chrome/browser/notifications/balloon_collection.h" |
| 15 #include "chrome/browser/notifications/notification.h" | 15 #include "chrome/browser/notifications/notification.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/common/chrome_notification_types.h" | 17 #include "chrome/common/chrome_notification_types.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "content/public/browser/notification_service.h" | 19 #include "content/public/browser/notification_service.h" |
| 20 | 20 |
| 21 BalloonNotificationUIManager::BalloonNotificationUIManager( | 21 BalloonNotificationUIManager::BalloonNotificationUIManager( |
| 22 PrefService* local_state) | 22 PrefService* local_state) |
| 23 : NotificationUIManagerImpl(), | 23 : NotificationUIManagerImpl(), NotificationPrefsManager(local_state) { |
| 24 NotificationPrefsManager(local_state), | |
| 25 balloon_collection_(NULL) { | |
| 26 position_pref_.Init( | 24 position_pref_.Init( |
| 27 prefs::kDesktopNotificationPosition, | 25 prefs::kDesktopNotificationPosition, |
| 28 local_state, | 26 local_state, |
| 29 base::Bind( | 27 base::Bind( |
| 30 &BalloonNotificationUIManager::OnDesktopNotificationPositionChanged, | 28 &BalloonNotificationUIManager::OnDesktopNotificationPositionChanged, |
| 31 base::Unretained(this))); | 29 base::Unretained(this))); |
| 32 } | 30 } |
| 33 | 31 |
| 34 BalloonNotificationUIManager::~BalloonNotificationUIManager() { | 32 BalloonNotificationUIManager::~BalloonNotificationUIManager() { |
| 35 } | 33 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 BalloonNotificationUIManager::GetInstanceForTesting() { | 166 BalloonNotificationUIManager::GetInstanceForTesting() { |
| 169 if (NotificationUIManager::DelegatesToMessageCenter()) { | 167 if (NotificationUIManager::DelegatesToMessageCenter()) { |
| 170 LOG(ERROR) << "Attempt to run a test that requires " | 168 LOG(ERROR) << "Attempt to run a test that requires " |
| 171 << "BalloonNotificationUIManager while delegating to a " | 169 << "BalloonNotificationUIManager while delegating to a " |
| 172 << "native MessageCenter. Test will fail. Ask dimich@"; | 170 << "native MessageCenter. Test will fail. Ask dimich@"; |
| 173 return NULL; | 171 return NULL; |
| 174 } | 172 } |
| 175 return static_cast<BalloonNotificationUIManager*>( | 173 return static_cast<BalloonNotificationUIManager*>( |
| 176 g_browser_process->notification_ui_manager()); | 174 g_browser_process->notification_ui_manager()); |
| 177 } | 175 } |
| OLD | NEW |