| 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/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 new message_center::MessagePopupBubble(message_center()); | 192 new message_center::MessagePopupBubble(message_center()); |
| 193 popup_bubble_.reset(new internal::WebNotificationBubbleWrapper( | 193 popup_bubble_.reset(new internal::WebNotificationBubbleWrapper( |
| 194 this, popup_bubble)); | 194 this, popup_bubble)); |
| 195 } | 195 } |
| 196 return true; | 196 return true; |
| 197 } | 197 } |
| 198 | 198 |
| 199 void WebNotificationTray::UpdatePopups() { | 199 void WebNotificationTray::UpdatePopups() { |
| 200 if (popup_bubble()) | 200 if (popup_bubble()) |
| 201 popup_bubble()->bubble()->ScheduleUpdate(); | 201 popup_bubble()->bubble()->ScheduleUpdate(); |
| 202 if (popup_collection_.get()) | |
| 203 popup_collection_->UpdatePopups(); | |
| 204 }; | 202 }; |
| 205 | 203 |
| 206 void WebNotificationTray::HidePopups() { | 204 void WebNotificationTray::HidePopups() { |
| 207 popup_bubble_.reset(); | 205 popup_bubble_.reset(); |
| 208 popup_collection_.reset(); | 206 popup_collection_.reset(); |
| 209 } | 207 } |
| 210 | 208 |
| 211 // Private methods. | 209 // Private methods. |
| 212 | 210 |
| 213 bool WebNotificationTray::ShouldShowMessageCenter() { | 211 bool WebNotificationTray::ShouldShowMessageCenter() { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 message_center_tray_->HidePopupBubble(); | 296 message_center_tray_->HidePopupBubble(); |
| 299 } | 297 } |
| 300 | 298 |
| 301 void WebNotificationTray::AnchorUpdated() { | 299 void WebNotificationTray::AnchorUpdated() { |
| 302 if (popup_bubble()) { | 300 if (popup_bubble()) { |
| 303 popup_bubble()->bubble_view()->UpdateBubble(); | 301 popup_bubble()->bubble_view()->UpdateBubble(); |
| 304 // Ensure that the notification buble is above the launcher/status area. | 302 // Ensure that the notification buble is above the launcher/status area. |
| 305 popup_bubble()->bubble_view()->GetWidget()->StackAtTop(); | 303 popup_bubble()->bubble_view()->GetWidget()->StackAtTop(); |
| 306 UpdateBubbleViewArrow(popup_bubble()->bubble_view()); | 304 UpdateBubbleViewArrow(popup_bubble()->bubble_view()); |
| 307 } | 305 } |
| 308 if (popup_collection_.get()) | |
| 309 popup_collection_->UpdatePopups(); | |
| 310 if (message_center_bubble()) { | 306 if (message_center_bubble()) { |
| 311 message_center_bubble()->bubble_view()->UpdateBubble(); | 307 message_center_bubble()->bubble_view()->UpdateBubble(); |
| 312 UpdateBubbleViewArrow(message_center_bubble()->bubble_view()); | 308 UpdateBubbleViewArrow(message_center_bubble()->bubble_view()); |
| 313 } | 309 } |
| 314 } | 310 } |
| 315 | 311 |
| 316 base::string16 WebNotificationTray::GetAccessibleNameForTray() { | 312 base::string16 WebNotificationTray::GetAccessibleNameForTray() { |
| 317 return l10n_util::GetStringUTF16( | 313 return l10n_util::GetStringUTF16( |
| 318 IDS_MESSAGE_CENTER_ACCESSIBLE_NAME); | 314 IDS_MESSAGE_CENTER_ACCESSIBLE_NAME); |
| 319 } | 315 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 | 442 |
| 447 message_center::MessagePopupBubble* | 443 message_center::MessagePopupBubble* |
| 448 WebNotificationTray::GetPopupBubbleForTest() { | 444 WebNotificationTray::GetPopupBubbleForTest() { |
| 449 if (!popup_bubble()) | 445 if (!popup_bubble()) |
| 450 return NULL; | 446 return NULL; |
| 451 return static_cast<message_center::MessagePopupBubble*>( | 447 return static_cast<message_center::MessagePopupBubble*>( |
| 452 popup_bubble()->bubble()); | 448 popup_bubble()->bubble()); |
| 453 } | 449 } |
| 454 | 450 |
| 455 } // namespace ash | 451 } // namespace ash |
| OLD | NEW |