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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_layout_manager_observer.h" | 10 #include "ash/shelf/shelf_layout_manager_observer.h" |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 ->session_state_delegate() | 451 ->session_state_delegate() |
452 ->IsInSecondaryLoginScreen(); | 452 ->IsInSecondaryLoginScreen(); |
453 | 453 |
454 SetVisible((status_area_widget()->login_status() != user::LOGGED_IN_NONE) && | 454 SetVisible((status_area_widget()->login_status() != user::LOGGED_IN_NONE) && |
455 (status_area_widget()->login_status() != user::LOGGED_IN_LOCKED) && | 455 (status_area_widget()->login_status() != user::LOGGED_IN_LOCKED) && |
456 !userAddingRunning && (message_center->NotificationCount() > 0)); | 456 !userAddingRunning && (message_center->NotificationCount() > 0)); |
457 Layout(); | 457 Layout(); |
458 SchedulePaint(); | 458 SchedulePaint(); |
459 } | 459 } |
460 | 460 |
461 bool WebNotificationTray::ClickedOutsideBubble() { | 461 void WebNotificationTray::ClickedOutsideBubble() { |
462 // Only hide the message center | 462 // Only hide the message center |
463 if (!message_center_bubble()) | 463 if (!message_center_bubble()) |
464 return false; | 464 return; |
465 | 465 |
466 message_center_tray_->HideMessageCenterBubble(); | 466 message_center_tray_->HideMessageCenterBubble(); |
467 return true; | |
468 } | 467 } |
469 | 468 |
470 message_center::MessageCenter* WebNotificationTray::message_center() const { | 469 message_center::MessageCenter* WebNotificationTray::message_center() const { |
471 return message_center_tray_->message_center(); | 470 return message_center_tray_->message_center(); |
472 } | 471 } |
473 | 472 |
474 // Methods for testing | 473 // Methods for testing |
475 | 474 |
476 bool WebNotificationTray::IsPopupVisible() const { | 475 bool WebNotificationTray::IsPopupVisible() const { |
477 return message_center_tray_->popups_visible(); | 476 return message_center_tray_->popups_visible(); |
478 } | 477 } |
479 | 478 |
480 message_center::MessageCenterBubble* | 479 message_center::MessageCenterBubble* |
481 WebNotificationTray::GetMessageCenterBubbleForTest() { | 480 WebNotificationTray::GetMessageCenterBubbleForTest() { |
482 if (!message_center_bubble()) | 481 if (!message_center_bubble()) |
483 return NULL; | 482 return NULL; |
484 return static_cast<message_center::MessageCenterBubble*>( | 483 return static_cast<message_center::MessageCenterBubble*>( |
485 message_center_bubble()->bubble()); | 484 message_center_bubble()->bubble()); |
486 } | 485 } |
487 | 486 |
488 } // namespace ash | 487 } // namespace ash |
OLD | NEW |