summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-21 21:59:58 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-21 21:59:58 +0000
commitceb85cf6abb1550d3e592b44c0f2cf8455063cfa (patch)
treee548414d475b8f548112946f730eafb464ec8215 /ash
parent522cc1421dfe54e0153ba20c2266246bd84f5ac6 (diff)
downloadchromium_src-ceb85cf6abb1550d3e592b44c0f2cf8455063cfa.zip
chromium_src-ceb85cf6abb1550d3e592b44c0f2cf8455063cfa.tar.gz
chromium_src-ceb85cf6abb1550d3e592b44c0f2cf8455063cfa.tar.bz2
Ash: Add window rotation hotkey for testing
BUG=none TEST=none TBR=gspencer@chromium.org Review URL: http://codereview.chromium.org/9812018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128064 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/accelerators/accelerator_controller.cc13
-rw-r--r--ash/accelerators/accelerator_table.cc2
-rw-r--r--ash/accelerators/accelerator_table.h1
3 files changed, 16 insertions, 0 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 993978d6..24017e03 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -58,6 +58,17 @@ bool HandleExit() {
return true;
}
+// Rotates the default window container.
+bool HandleRotateWindows() {
+ aura::Window* target = ash::Shell::GetInstance()->GetContainer(
+ ash::internal::kShellWindowId_DefaultContainer);
+ scoped_ptr<ui::LayerAnimationSequence> screen_rotation(
+ new ui::LayerAnimationSequence(new ui::ScreenRotation(360)));
+ target->layer()->GetAnimator()->StartAnimation(
+ screen_rotation.release());
+ return true;
+}
+
#if !defined(NDEBUG)
// Rotates the screen.
bool HandleRotateScreen() {
@@ -309,6 +320,8 @@ bool AcceleratorController::AcceleratorPressed(
case SELECT_LAST_WIN:
SwitchToWindow(-1);
break;
+ case ROTATE_WINDOWS:
+ return HandleRotateWindows();
#if !defined(NDEBUG)
case ROTATE_SCREEN:
return HandleRotateScreen();
diff --git a/ash/accelerators/accelerator_table.cc b/ash/accelerators/accelerator_table.cc
index 98b5d48..668198d 100644
--- a/ash/accelerators/accelerator_table.cc
+++ b/ash/accelerators/accelerator_table.cc
@@ -86,6 +86,8 @@ const AcceleratorData kAcceleratorData[] = {
SELECT_WIN_7 },
{ ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_9, false, false, true,
SELECT_LAST_WIN },
+ { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_F3, true, true, true,
+ ROTATE_WINDOWS },
#if !defined(NDEBUG)
{ ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_HOME, false, true, false,
ROTATE_SCREEN },
diff --git a/ash/accelerators/accelerator_table.h b/ash/accelerators/accelerator_table.h
index d9fcdc0..21aabab 100644
--- a/ash/accelerators/accelerator_table.h
+++ b/ash/accelerators/accelerator_table.h
@@ -39,6 +39,7 @@ enum AcceleratorAction {
SELECT_WIN_6,
SELECT_WIN_7,
SELECT_LAST_WIN,
+ ROTATE_WINDOWS,
#if !defined(NDEBUG)
PRINT_LAYER_HIERARCHY,
PRINT_WINDOW_HIERARCHY,