| 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/ui/views/ash/balloon_collection_impl_ash.h" | 5 #include "chrome/browser/ui/views/ash/balloon_collection_impl_ash.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/status_area_widget.h" | 9 #include "ash/system/status_area_widget.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/notifications/balloon.h" | 12 #include "chrome/browser/notifications/balloon.h" |
| 13 #include "chrome/browser/notifications/desktop_notification_service.h" | 13 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 14 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 14 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 15 #include "chrome/browser/notifications/notification.h" | 15 #include "chrome/browser/notifications/notification.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "chrome/browser/ui/browser_finder.h" | 17 #include "chrome/browser/ui/browser_finder.h" |
| 18 #include "chrome/browser/ui/views/ash/balloon_view_ash.h" | 18 #include "chrome/browser/ui/views/ash/balloon_view_ash.h" |
| 19 #include "chrome/browser/ui/views/notifications/balloon_view_host.h" | 19 #include "chrome/browser/ui/views/notifications/balloon_view_host.h" |
| 20 #include "chrome/browser/ui/views/notifications/balloon_view_views.h" | 20 #include "chrome/browser/ui/views/notifications/balloon_view_views.h" |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 bool IsAshNotifyEnabled() { | 24 bool IsAshNotifyEnabled() { |
| 25 return !CommandLine::ForCurrentProcess()->HasSwitch( | 25 return CommandLine::ForCurrentProcess()->HasSwitch(ash::switches::kAshNotify); |
| 26 ash::switches::kAshNotifyDisabled); | |
| 27 } | 26 } |
| 28 | 27 |
| 29 } // namespace | 28 } // namespace |
| 30 | 29 |
| 31 BalloonCollectionImplAsh::BalloonCollectionImplAsh() { | 30 BalloonCollectionImplAsh::BalloonCollectionImplAsh() { |
| 32 if (IsAshNotifyEnabled()) { | 31 if (IsAshNotifyEnabled()) { |
| 33 ash::Shell::GetInstance()->status_area_widget()-> | 32 ash::Shell::GetInstance()->status_area_widget()-> |
| 34 web_notification_tray()->SetDelegate(this); | 33 web_notification_tray()->SetDelegate(this); |
| 35 } | 34 } |
| 36 } | 35 } |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 167 } |
| 169 | 168 |
| 170 // For now, only use BalloonCollectionImplAsh on ChromeOS, until | 169 // For now, only use BalloonCollectionImplAsh on ChromeOS, until |
| 171 // system_notifications_ is replaced with status area notifications. | 170 // system_notifications_ is replaced with status area notifications. |
| 172 #if defined(OS_CHROMEOS) | 171 #if defined(OS_CHROMEOS) |
| 173 // static | 172 // static |
| 174 BalloonCollection* BalloonCollection::Create() { | 173 BalloonCollection* BalloonCollection::Create() { |
| 175 return new BalloonCollectionImplAsh(); | 174 return new BalloonCollectionImplAsh(); |
| 176 } | 175 } |
| 177 #endif | 176 #endif |
| OLD | NEW |