diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-12 04:45:27 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-12 04:45:27 +0000 |
commit | 3422bf1ca45801282f9540a5be2fa350a3f9e349 (patch) | |
tree | 33fef33068b1774598ebef233cdba743af438add | |
parent | ae1a2b0c8a2ef824cb62049315ce26def695ca7c (diff) | |
download | chromium_src-3422bf1ca45801282f9540a5be2fa350a3f9e349.zip chromium_src-3422bf1ca45801282f9540a5be2fa350a3f9e349.tar.gz chromium_src-3422bf1ca45801282f9540a5be2fa350a3f9e349.tar.bz2 |
Adds an ash global shortcut key for message center.
BUG=172705
TEST=on device, login, and press Shift-Alt-n. Also make sure NOT toggling when login/lock-screens.
Review URL: https://chromiumcodereview.appspot.com/12096027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181847 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ash/accelerators/accelerator_controller.cc | 16 | ||||
-rw-r--r-- | ash/accelerators/accelerator_table.cc | 2 | ||||
-rw-r--r-- | ash/accelerators/accelerator_table.h | 1 | ||||
-rw-r--r-- | ash/system/web_notification/web_notification_tray.cc | 5 | ||||
-rw-r--r-- | ash/system/web_notification/web_notification_tray.h | 4 |
5 files changed, 27 insertions, 1 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index d1001f2..de905da 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -33,6 +33,7 @@ #include "ash/system/status_area_widget.h" #include "ash/system/tray/system_tray.h" #include "ash/system/tray/system_tray_delegate.h" +#include "ash/system/web_notification/web_notification_tray.h" #include "ash/touch/touch_observer_hud.h" #include "ash/volume_control_delegate.h" #include "ash/wm/partial_screenshot_view.h" @@ -631,6 +632,21 @@ bool AcceleratorController::PerformAction(int action, controller->GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); break; } + case SHOW_MESSAGE_CENTER_BUBBLE: { + internal::RootWindowController* controller = + Shell::IsLauncherPerDisplayEnabled() ? + internal::RootWindowController::ForActiveRootWindow() : + Shell::GetPrimaryRootWindowController(); + internal::StatusAreaWidget* status_area_widget = + controller->status_area_widget(); + if (status_area_widget) { + WebNotificationTray* notification_tray = + status_area_widget->web_notification_tray(); + if (notification_tray->visible()) + notification_tray->ShowMessageCenterBubble(); + } + break; + } case SHOW_TASK_MANAGER: Shell::GetInstance()->delegate()->ShowTaskManager(); return true; diff --git a/ash/accelerators/accelerator_table.cc b/ash/accelerators/accelerator_table.cc index a807530..e9df3be 100644 --- a/ash/accelerators/accelerator_table.cc +++ b/ash/accelerators/accelerator_table.cc @@ -125,6 +125,8 @@ const AcceleratorData kAcceleratorData[] = { ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, SHOW_KEYBOARD_OVERLAY }, { true, ui::VKEY_F14, ui::EF_NONE, SHOW_KEYBOARD_OVERLAY }, + { true, ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, + SHOW_MESSAGE_CENTER_BUBBLE }, { true, ui::VKEY_BROWSER_BACK, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, SHOW_OAK }, { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, diff --git a/ash/accelerators/accelerator_table.h b/ash/accelerators/accelerator_table.h index 1819052..6ab2948 100644 --- a/ash/accelerators/accelerator_table.h +++ b/ash/accelerators/accelerator_table.h @@ -57,6 +57,7 @@ enum AcceleratorAction { SELECT_WIN_6, SELECT_WIN_7, SHOW_KEYBOARD_OVERLAY, + SHOW_MESSAGE_CENTER_BUBBLE, SHOW_OAK, SHOW_SYSTEM_TRAY_BUBBLE, SHOW_TASK_MANAGER, diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc index 3db837c..7ea81aa 100644 --- a/ash/system/web_notification/web_notification_tray.cc +++ b/ash/system/web_notification/web_notification_tray.cc @@ -249,6 +249,11 @@ bool WebNotificationTray::IsMouseInNotificationBubble() const { Shell::GetScreen()->GetCursorScreenPoint()); } +void WebNotificationTray::ShowMessageCenterBubble() { + if (!IsMessageCenterBubbleVisible()) + message_center_tray_->ShowMessageCenterBubble(); +} + void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) { if (alignment == shelf_alignment()) return; diff --git a/ash/system/web_notification/web_notification_tray.h b/ash/system/web_notification/web_notification_tray.h index 1466c29..8a1a165 100644 --- a/ash/system/web_notification/web_notification_tray.h +++ b/ash/system/web_notification/web_notification_tray.h @@ -63,6 +63,9 @@ class ASH_EXPORT WebNotificationTray // Returns true if the mouse is inside the notification bubble. bool IsMouseInNotificationBubble() const; + // Shows the message center bubble. + void ShowMessageCenterBubble(); + // Overridden from TrayBackgroundView. virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; virtual void AnchorUpdated() OVERRIDE; @@ -119,7 +122,6 @@ class ASH_EXPORT WebNotificationTray // Shows the quiet mode bubble. void ShowQuietModeBubble(); - internal::WebNotificationBubbleWrapper* message_center_bubble() const { return message_center_bubble_.get(); } |