| 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/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 message_center_bubble()->bubble()->IsVisible()); | 242 message_center_bubble()->bubble()->IsVisible()); |
| 243 } | 243 } |
| 244 | 244 |
| 245 bool WebNotificationTray::IsMouseInNotificationBubble() const { | 245 bool WebNotificationTray::IsMouseInNotificationBubble() const { |
| 246 if (!popup_bubble()) | 246 if (!popup_bubble()) |
| 247 return false; | 247 return false; |
| 248 return popup_bubble()->bubble_view()->GetBoundsInScreen().Contains( | 248 return popup_bubble()->bubble_view()->GetBoundsInScreen().Contains( |
| 249 Shell::GetScreen()->GetCursorScreenPoint()); | 249 Shell::GetScreen()->GetCursorScreenPoint()); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void WebNotificationTray::ShowMessageCenterBubble() { |
| 253 if (!IsMessageCenterBubbleVisible()) |
| 254 message_center_tray_->ShowMessageCenterBubble(); |
| 255 } |
| 256 |
| 252 void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) { | 257 void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) { |
| 253 if (alignment == shelf_alignment()) | 258 if (alignment == shelf_alignment()) |
| 254 return; | 259 return; |
| 255 internal::TrayBackgroundView::SetShelfAlignment(alignment); | 260 internal::TrayBackgroundView::SetShelfAlignment(alignment); |
| 256 // Destroy any existing bubble so that it will be rebuilt correctly. | 261 // Destroy any existing bubble so that it will be rebuilt correctly. |
| 257 message_center_tray_->HideMessageCenterBubble(); | 262 message_center_tray_->HideMessageCenterBubble(); |
| 258 message_center_tray_->HidePopupBubble(); | 263 message_center_tray_->HidePopupBubble(); |
| 259 } | 264 } |
| 260 | 265 |
| 261 void WebNotificationTray::AnchorUpdated() { | 266 void WebNotificationTray::AnchorUpdated() { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 | 419 |
| 415 message_center::MessagePopupBubble* | 420 message_center::MessagePopupBubble* |
| 416 WebNotificationTray::GetPopupBubbleForTest() { | 421 WebNotificationTray::GetPopupBubbleForTest() { |
| 417 if (!popup_bubble()) | 422 if (!popup_bubble()) |
| 418 return NULL; | 423 return NULL; |
| 419 return static_cast<message_center::MessagePopupBubble*>( | 424 return static_cast<message_center::MessagePopupBubble*>( |
| 420 popup_bubble()->bubble()); | 425 popup_bubble()->bubble()); |
| 421 } | 426 } |
| 422 | 427 |
| 423 } // namespace ash | 428 } // namespace ash |
| OLD | NEW |