| 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/common/system/web_notification/web_notification_tray.h" | 5 #include "ash/common/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
| 8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 bool WebNotificationTray::IsCommandIdChecked(int command_id) const { | 441 bool WebNotificationTray::IsCommandIdChecked(int command_id) const { |
| 442 if (command_id != kToggleQuietMode) | 442 if (command_id != kToggleQuietMode) |
| 443 return false; | 443 return false; |
| 444 return message_center()->IsQuietMode(); | 444 return message_center()->IsQuietMode(); |
| 445 } | 445 } |
| 446 | 446 |
| 447 bool WebNotificationTray::IsCommandIdEnabled(int command_id) const { | 447 bool WebNotificationTray::IsCommandIdEnabled(int command_id) const { |
| 448 return true; | 448 return true; |
| 449 } | 449 } |
| 450 | 450 |
| 451 bool WebNotificationTray::GetAcceleratorForCommandId( | |
| 452 int command_id, | |
| 453 ui::Accelerator* accelerator) const { | |
| 454 return false; | |
| 455 } | |
| 456 | |
| 457 void WebNotificationTray::ExecuteCommand(int command_id, int event_flags) { | 451 void WebNotificationTray::ExecuteCommand(int command_id, int event_flags) { |
| 458 if (command_id == kToggleQuietMode) { | 452 if (command_id == kToggleQuietMode) { |
| 459 bool in_quiet_mode = message_center()->IsQuietMode(); | 453 bool in_quiet_mode = message_center()->IsQuietMode(); |
| 460 message_center()->SetQuietMode(!in_quiet_mode); | 454 message_center()->SetQuietMode(!in_quiet_mode); |
| 461 return; | 455 return; |
| 462 } | 456 } |
| 463 base::TimeDelta expires_in = command_id == kEnableQuietModeDay | 457 base::TimeDelta expires_in = command_id == kEnableQuietModeDay |
| 464 ? base::TimeDelta::FromDays(1) | 458 ? base::TimeDelta::FromDays(1) |
| 465 : base::TimeDelta::FromHours(1); | 459 : base::TimeDelta::FromHours(1); |
| 466 message_center()->EnterQuietModeWithExpire(expires_in); | 460 message_center()->EnterQuietModeWithExpire(expires_in); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 | 523 |
| 530 message_center::MessageCenterBubble* | 524 message_center::MessageCenterBubble* |
| 531 WebNotificationTray::GetMessageCenterBubbleForTest() { | 525 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 532 if (!message_center_bubble()) | 526 if (!message_center_bubble()) |
| 533 return NULL; | 527 return NULL; |
| 534 return static_cast<message_center::MessageCenterBubble*>( | 528 return static_cast<message_center::MessageCenterBubble*>( |
| 535 message_center_bubble()->bubble()); | 529 message_center_bubble()->bubble()); |
| 536 } | 530 } |
| 537 | 531 |
| 538 } // namespace ash | 532 } // namespace ash |
| OLD | NEW |