| 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 "ash/system/web_notification/web_notification_tray.h" | 5 #include "ash/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/status_area_widget.h" | 8 #include "ash/system/status_area_widget.h" |
| 9 #include "ash/system/tray/tray_bubble_view.h" | 9 #include "ash/system/tray/tray_bubble_view.h" |
| 10 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 195 } |
| 196 | 196 |
| 197 bool WebNotificationTray::IsMessageCenterBubbleVisible() const { | 197 bool WebNotificationTray::IsMessageCenterBubbleVisible() const { |
| 198 return (message_center_bubble() && message_center_bubble_->IsVisible()); | 198 return (message_center_bubble() && message_center_bubble_->IsVisible()); |
| 199 } | 199 } |
| 200 | 200 |
| 201 bool WebNotificationTray::IsMouseInNotificationBubble() const { | 201 bool WebNotificationTray::IsMouseInNotificationBubble() const { |
| 202 if (!popup_bubble()) | 202 if (!popup_bubble()) |
| 203 return false; | 203 return false; |
| 204 return popup_bubble_->bubble_view()->GetBoundsInScreen().Contains( | 204 return popup_bubble_->bubble_view()->GetBoundsInScreen().Contains( |
| 205 gfx::Screen::GetCursorScreenPoint()); | 205 Shell::GetAshScreen()->GetCursorScreenPoint()); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) { | 208 void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) { |
| 209 if (alignment == shelf_alignment()) | 209 if (alignment == shelf_alignment()) |
| 210 return; | 210 return; |
| 211 internal::TrayBackgroundView::SetShelfAlignment(alignment); | 211 internal::TrayBackgroundView::SetShelfAlignment(alignment); |
| 212 // Destroy any existing bubble so that it will be rebuilt correctly. | 212 // Destroy any existing bubble so that it will be rebuilt correctly. |
| 213 HideMessageCenterBubble(); | 213 HideMessageCenterBubble(); |
| 214 HidePopupBubble(); | 214 HidePopupBubble(); |
| 215 } | 215 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 return message_center_bubble()->NumMessageViewsForTest(); | 378 return message_center_bubble()->NumMessageViewsForTest(); |
| 379 } | 379 } |
| 380 | 380 |
| 381 size_t WebNotificationTray::GetPopupNotificationCountForTest() const { | 381 size_t WebNotificationTray::GetPopupNotificationCountForTest() const { |
| 382 if (!popup_bubble()) | 382 if (!popup_bubble()) |
| 383 return 0; | 383 return 0; |
| 384 return popup_bubble()->NumMessageViewsForTest(); | 384 return popup_bubble()->NumMessageViewsForTest(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 } // namespace ash | 387 } // namespace ash |
| OLD | NEW |