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/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "ash/rotator/screen_rotation.h" | 26 #include "ash/rotator/screen_rotation.h" |
27 #include "ash/screenshot_delegate.h" | 27 #include "ash/screenshot_delegate.h" |
28 #include "ash/shell.h" | 28 #include "ash/shell.h" |
29 #include "ash/shell_delegate.h" | 29 #include "ash/shell_delegate.h" |
30 #include "ash/shell_window_ids.h" | 30 #include "ash/shell_window_ids.h" |
31 #include "ash/system/brightness/brightness_control_delegate.h" | 31 #include "ash/system/brightness/brightness_control_delegate.h" |
32 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h" | 32 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h" |
33 #include "ash/system/status_area_widget.h" | 33 #include "ash/system/status_area_widget.h" |
34 #include "ash/system/tray/system_tray.h" | 34 #include "ash/system/tray/system_tray.h" |
35 #include "ash/system/tray/system_tray_delegate.h" | 35 #include "ash/system/tray/system_tray_delegate.h" |
| 36 #include "ash/system/web_notification/web_notification_tray.h" |
36 #include "ash/touch/touch_observer_hud.h" | 37 #include "ash/touch/touch_observer_hud.h" |
37 #include "ash/volume_control_delegate.h" | 38 #include "ash/volume_control_delegate.h" |
38 #include "ash/wm/partial_screenshot_view.h" | 39 #include "ash/wm/partial_screenshot_view.h" |
39 #include "ash/wm/power_button_controller.h" | 40 #include "ash/wm/power_button_controller.h" |
40 #include "ash/wm/property_util.h" | 41 #include "ash/wm/property_util.h" |
41 #include "ash/wm/window_cycle_controller.h" | 42 #include "ash/wm/window_cycle_controller.h" |
42 #include "ash/wm/window_util.h" | 43 #include "ash/wm/window_util.h" |
43 #include "ash/wm/workspace/snap_sizer.h" | 44 #include "ash/wm/workspace/snap_sizer.h" |
44 #include "base/bind.h" | 45 #include "base/bind.h" |
45 #include "base/command_line.h" | 46 #include "base/command_line.h" |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 break; | 625 break; |
625 case SHOW_SYSTEM_TRAY_BUBBLE: { | 626 case SHOW_SYSTEM_TRAY_BUBBLE: { |
626 internal::RootWindowController* controller = | 627 internal::RootWindowController* controller = |
627 Shell::IsLauncherPerDisplayEnabled() ? | 628 Shell::IsLauncherPerDisplayEnabled() ? |
628 internal::RootWindowController::ForActiveRootWindow() : | 629 internal::RootWindowController::ForActiveRootWindow() : |
629 Shell::GetPrimaryRootWindowController(); | 630 Shell::GetPrimaryRootWindowController(); |
630 if (!controller->GetSystemTray()->HasSystemBubble()) | 631 if (!controller->GetSystemTray()->HasSystemBubble()) |
631 controller->GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); | 632 controller->GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); |
632 break; | 633 break; |
633 } | 634 } |
| 635 case SHOW_MESSAGE_CENTER_BUBBLE: { |
| 636 internal::RootWindowController* controller = |
| 637 Shell::IsLauncherPerDisplayEnabled() ? |
| 638 internal::RootWindowController::ForActiveRootWindow() : |
| 639 Shell::GetPrimaryRootWindowController(); |
| 640 internal::StatusAreaWidget* status_area_widget = |
| 641 controller->status_area_widget(); |
| 642 if (status_area_widget) { |
| 643 WebNotificationTray* notification_tray = |
| 644 status_area_widget->web_notification_tray(); |
| 645 if (notification_tray->visible()) |
| 646 notification_tray->ShowMessageCenterBubble(); |
| 647 } |
| 648 break; |
| 649 } |
634 case SHOW_TASK_MANAGER: | 650 case SHOW_TASK_MANAGER: |
635 Shell::GetInstance()->delegate()->ShowTaskManager(); | 651 Shell::GetInstance()->delegate()->ShowTaskManager(); |
636 return true; | 652 return true; |
637 case NEXT_IME: | 653 case NEXT_IME: |
638 // This check is necessary e.g. not to process the Shift+Alt+ | 654 // This check is necessary e.g. not to process the Shift+Alt+ |
639 // ET_KEY_RELEASED accelerator for Chrome OS (see ash/accelerators/ | 655 // ET_KEY_RELEASED accelerator for Chrome OS (see ash/accelerators/ |
640 // accelerator_controller.cc) when Shift+Alt+Tab is pressed and then Tab | 656 // accelerator_controller.cc) when Shift+Alt+Tab is pressed and then Tab |
641 // is released. | 657 // is released. |
642 if (previous_event_type == ui::ET_KEY_RELEASED && | 658 if (previous_event_type == ui::ET_KEY_RELEASED && |
643 // Workaround for crbug.com/139556. CJK IME users tend to press | 659 // Workaround for crbug.com/139556. CJK IME users tend to press |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 keyboard_brightness_control_delegate) { | 859 keyboard_brightness_control_delegate) { |
844 keyboard_brightness_control_delegate_ = | 860 keyboard_brightness_control_delegate_ = |
845 keyboard_brightness_control_delegate.Pass(); | 861 keyboard_brightness_control_delegate.Pass(); |
846 } | 862 } |
847 | 863 |
848 bool AcceleratorController::CanHandleAccelerators() const { | 864 bool AcceleratorController::CanHandleAccelerators() const { |
849 return true; | 865 return true; |
850 } | 866 } |
851 | 867 |
852 } // namespace ash | 868 } // namespace ash |
OLD | NEW |