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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 const ui::Event& event) { | 457 const ui::Event& event) { |
458 DCHECK_EQ(button_, sender); | 458 DCHECK_EQ(button_, sender); |
459 PerformAction(event); | 459 PerformAction(event); |
460 } | 460 } |
461 | 461 |
462 void WebNotificationTray::OnMessageCenterTrayChanged() { | 462 void WebNotificationTray::OnMessageCenterTrayChanged() { |
463 // Do not update the tray contents directly. Multiple change events can happen | 463 // Do not update the tray contents directly. Multiple change events can happen |
464 // consecutively, and calling Update in the middle of those events will show | 464 // consecutively, and calling Update in the middle of those events will show |
465 // intermediate unread counts for a moment. | 465 // intermediate unread counts for a moment. |
466 should_update_tray_content_ = true; | 466 should_update_tray_content_ = true; |
467 MessageLoop::current()->PostTask( | 467 base::MessageLoop::current()->PostTask( |
468 FROM_HERE, | 468 FROM_HERE, |
469 base::Bind(&WebNotificationTray::UpdateTrayContent, AsWeakPtr())); | 469 base::Bind(&WebNotificationTray::UpdateTrayContent, AsWeakPtr())); |
470 } | 470 } |
471 | 471 |
472 void WebNotificationTray::UpdateTrayContent() { | 472 void WebNotificationTray::UpdateTrayContent() { |
473 if (!should_update_tray_content_) | 473 if (!should_update_tray_content_) |
474 return; | 474 return; |
475 should_update_tray_content_ = false; | 475 should_update_tray_content_ = false; |
476 | 476 |
477 message_center::MessageCenter* message_center = | 477 message_center::MessageCenter* message_center = |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 | 516 |
517 message_center::MessagePopupBubble* | 517 message_center::MessagePopupBubble* |
518 WebNotificationTray::GetPopupBubbleForTest() { | 518 WebNotificationTray::GetPopupBubbleForTest() { |
519 if (!popup_bubble()) | 519 if (!popup_bubble()) |
520 return NULL; | 520 return NULL; |
521 return static_cast<message_center::MessagePopupBubble*>( | 521 return static_cast<message_center::MessagePopupBubble*>( |
522 popup_bubble()->bubble()); | 522 popup_bubble()->bubble()); |
523 } | 523 } |
524 | 524 |
525 } // namespace ash | 525 } // namespace ash |
OLD | NEW |