Index: ash/accelerators/accelerator_controller_delegate_aura.cc |
diff --git a/ash/accelerators/accelerator_controller_delegate_aura.cc b/ash/accelerators/accelerator_controller_delegate_aura.cc |
index 520cad357c76507681515856031965afd39b5941..1e211befdafc6cdf73c8e0efa60828f37baeeb2c 100644 |
--- a/ash/accelerators/accelerator_controller_delegate_aura.cc |
+++ b/ash/accelerators/accelerator_controller_delegate_aura.cc |
@@ -68,6 +68,9 @@ |
#include "ui/message_center/notifier_settings.h" |
#if defined(OS_CHROMEOS) |
+#include "ash/common/palette_delegate.h" |
James Cook
2016/08/26 01:05:51
Since this code is in ash/common you should be abl
jdufault
2016/08/26 02:44:56
Done.
|
+#include "ash/common/system/chromeos/palette/palette_tray.h" |
+#include "ash/common/system/chromeos/palette/palette_utils.h" |
#include "ash/display/display_configuration_controller.h" |
#include "base/sys_info.h" |
#endif // defined(OS_CHROMEOS) |
@@ -321,6 +324,27 @@ bool CanHandleUnpin() { |
} |
#if defined(OS_CHROMEOS) |
+bool CanHandleShowStylusTools() { |
+ RootWindowController* controller = |
+ RootWindowController::ForTargetRootWindow(); |
+ StatusAreaWidget* status_area_widget = |
+ controller->shelf_widget()->status_area_widget(); |
+ return status_area_widget && ash::IsPaletteFeatureEnabled() && |
James Cook
2016/08/26 01:05:51
nit: StatusAreaWidget is created in the SHelfWidge
jdufault
2016/08/26 02:44:56
Done.
|
+ WmShell::Get()->palette_delegate()->ShouldShowPalette(); |
+} |
+ |
+void HandleShowStylusTools() { |
+ base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools")); |
+ RootWindowController* controller = |
+ RootWindowController::ForTargetRootWindow(); |
+ StatusAreaWidget* status_area_widget = |
+ controller->shelf_widget()->status_area_widget(); |
+ if (status_area_widget) { |
James Cook
2016/08/26 01:05:51
ditto
jdufault
2016/08/26 02:44:56
Done.
|
+ PaletteTray* palette_tray = status_area_widget->palette_tray(); |
+ palette_tray->OpenBubble(); |
+ } |
+} |
+ |
void HandleSwapPrimaryDisplay() { |
base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display")); |
Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId( |
@@ -403,6 +427,7 @@ bool AcceleratorControllerDelegateAura::HandlesAction( |
case LOCK_RELEASED: |
case POWER_PRESSED: |
case POWER_RELEASED: |
+ case SHOW_STYLUS_TOOLS: |
case SWAP_PRIMARY_DISPLAY: |
case TOGGLE_MIRROR_MODE: |
case TOUCH_HUD_CLEAR: |
@@ -465,6 +490,8 @@ bool AcceleratorControllerDelegateAura::CanPerformAction( |
case DEBUG_TOGGLE_UNIFIED_DESKTOP: |
return debug::DebugAcceleratorsEnabled(); |
+ case SHOW_STYLUS_TOOLS: |
+ return CanHandleShowStylusTools(); |
case SWAP_PRIMARY_DISPLAY: |
return display::Screen::GetScreen()->GetNumDisplays() > 1; |
case TOUCH_HUD_CLEAR: |
@@ -609,6 +636,9 @@ void AcceleratorControllerDelegateAura::PerformAction( |
// D-BUS), but we consume them to prevent them from getting |
// passed to apps -- see http://crbug.com/146609. |
break; |
+ case SHOW_STYLUS_TOOLS: |
+ HandleShowStylusTools(); |
+ break; |
case SWAP_PRIMARY_DISPLAY: |
HandleSwapPrimaryDisplay(); |
break; |