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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
620 break; | 621 break; |
621 case SHOW_SYSTEM_TRAY_BUBBLE: { | 622 case SHOW_SYSTEM_TRAY_BUBBLE: { |
622 internal::RootWindowController* controller = | 623 internal::RootWindowController* controller = |
623 Shell::IsLauncherPerDisplayEnabled() ? | 624 Shell::IsLauncherPerDisplayEnabled() ? |
624 internal::RootWindowController::ForActiveRootWindow() : | 625 internal::RootWindowController::ForActiveRootWindow() : |
625 Shell::GetPrimaryRootWindowController(); | 626 Shell::GetPrimaryRootWindowController(); |
626 if (!controller->GetSystemTray()->HasSystemBubble()) | 627 if (!controller->GetSystemTray()->HasSystemBubble()) |
627 controller->GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); | 628 controller->GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); |
628 break; | 629 break; |
629 } | 630 } |
631 case TOGGLE_MESSAGE_CENTER_BUBBLE: { | |
632 internal::RootWindowController* controller = | |
633 Shell::IsLauncherPerDisplayEnabled() ? | |
634 internal::RootWindowController::ForActiveRootWindow() : | |
635 Shell::GetPrimaryRootWindowController(); | |
stevenjb
2013/01/28 23:46:56
Any reason we can't put this logic in RootWindowCo
| |
636 internal::StatusAreaWidget* status_area_widget = | |
637 controller->status_area_widget(); | |
638 if (status_area_widget) { | |
639 WebNotificationTray* notification_tray = | |
640 status_area_widget->web_notification_tray(); | |
641 if (notification_tray->visible()) | |
stevenjb
2013/01/28 23:46:56
Won't this test fail if the launcher is auto-hidde
| |
642 notification_tray->ToggleMessageCenterBubble(); | |
643 } | |
644 break; | |
645 } | |
630 case SHOW_TASK_MANAGER: | 646 case SHOW_TASK_MANAGER: |
631 Shell::GetInstance()->delegate()->ShowTaskManager(); | 647 Shell::GetInstance()->delegate()->ShowTaskManager(); |
632 return true; | 648 return true; |
633 case NEXT_IME: | 649 case NEXT_IME: |
634 // This check is necessary e.g. not to process the Shift+Alt+ | 650 // This check is necessary e.g. not to process the Shift+Alt+ |
635 // ET_KEY_RELEASED accelerator for Chrome OS (see ash/accelerators/ | 651 // ET_KEY_RELEASED accelerator for Chrome OS (see ash/accelerators/ |
636 // accelerator_controller.cc) when Shift+Alt+Tab is pressed and then Tab | 652 // accelerator_controller.cc) when Shift+Alt+Tab is pressed and then Tab |
637 // is released. | 653 // is released. |
638 if (previous_event_type == ui::ET_KEY_RELEASED && | 654 if (previous_event_type == ui::ET_KEY_RELEASED && |
639 // Workaround for crbug.com/139556. CJK IME users tend to press | 655 // Workaround for crbug.com/139556. CJK IME users tend to press |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
839 keyboard_brightness_control_delegate) { | 855 keyboard_brightness_control_delegate) { |
840 keyboard_brightness_control_delegate_ = | 856 keyboard_brightness_control_delegate_ = |
841 keyboard_brightness_control_delegate.Pass(); | 857 keyboard_brightness_control_delegate.Pass(); |
842 } | 858 } |
843 | 859 |
844 bool AcceleratorController::CanHandleAccelerators() const { | 860 bool AcceleratorController::CanHandleAccelerators() const { |
845 return true; | 861 return true; |
846 } | 862 } |
847 | 863 |
848 } // namespace ash | 864 } // namespace ash |
OLD | NEW |