| 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 | 520 |
| 521 bool WebNotificationTray::ShowNotifierSettings() { | 521 bool WebNotificationTray::ShowNotifierSettings() { |
| 522 if (message_center_bubble()) { | 522 if (message_center_bubble()) { |
| 523 static_cast<message_center::MessageCenterBubble*>( | 523 static_cast<message_center::MessageCenterBubble*>( |
| 524 message_center_bubble()->bubble())->SetSettingsVisible(); | 524 message_center_bubble()->bubble())->SetSettingsVisible(); |
| 525 return true; | 525 return true; |
| 526 } | 526 } |
| 527 return ShowMessageCenterInternal(true /* show_settings */); | 527 return ShowMessageCenterInternal(true /* show_settings */); |
| 528 } | 528 } |
| 529 | 529 |
| 530 bool WebNotificationTray::IsContextMenuEnabled() const { |
| 531 user::LoginStatus login_status = status_area_widget()->login_status(); |
| 532 return login_status != user::LOGGED_IN_NONE |
| 533 && login_status != user::LOGGED_IN_LOCKED; |
| 534 } |
| 535 |
| 530 message_center::MessageCenterTray* WebNotificationTray::GetMessageCenterTray() { | 536 message_center::MessageCenterTray* WebNotificationTray::GetMessageCenterTray() { |
| 531 return message_center_tray_.get(); | 537 return message_center_tray_.get(); |
| 532 } | 538 } |
| 533 | 539 |
| 534 bool WebNotificationTray::IsCommandIdChecked(int command_id) const { | 540 bool WebNotificationTray::IsCommandIdChecked(int command_id) const { |
| 535 if (command_id != kToggleQuietMode) | 541 if (command_id != kToggleQuietMode) |
| 536 return false; | 542 return false; |
| 537 return message_center()->IsQuietMode(); | 543 return message_center()->IsQuietMode(); |
| 538 } | 544 } |
| 539 | 545 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 621 |
| 616 message_center::MessageCenterBubble* | 622 message_center::MessageCenterBubble* |
| 617 WebNotificationTray::GetMessageCenterBubbleForTest() { | 623 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 618 if (!message_center_bubble()) | 624 if (!message_center_bubble()) |
| 619 return NULL; | 625 return NULL; |
| 620 return static_cast<message_center::MessageCenterBubble*>( | 626 return static_cast<message_center::MessageCenterBubble*>( |
| 621 message_center_bubble()->bubble()); | 627 message_center_bubble()->bubble()); |
| 622 } | 628 } |
| 623 | 629 |
| 624 } // namespace ash | 630 } // namespace ash |
| OLD | NEW |