summaryrefslogtreecommitdiffstats
path: root/ash/accelerators
diff options
context:
space:
mode:
authorvollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-19 18:01:31 +0000
committervollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-19 18:01:31 +0000
commitcde5121d3738127628fa92cf270c45bd07f85f4c (patch)
treed35c1c67f462acaf0c7515b80dffe62a204e0f51 /ash/accelerators
parent60cbfff44305b419aa22d91be11f5fa991589ab9 (diff)
downloadchromium_src-cde5121d3738127628fa92cf270c45bd07f85f4c.zip
chromium_src-cde5121d3738127628fa92cf270c45bd07f85f4c.tar.gz
chromium_src-cde5121d3738127628fa92cf270c45bd07f85f4c.tar.bz2
Let shift globally trigger slow animation mode.
A long time ago, we'd used an accelerator to link shift with slow animation mode, but this affected real key combos so a more piecemeal approach was taken, disabling/enabling slow animation modes for common ui operations. The problem with this approach is that it didn't catch many important UI animations. The fading in and fading out of context menus for example. This CL hooks into the keyboard event stream at a very high level to enable/disable slow animation mode. This has its downsides, too -- mainly that we end up with a specific bit of business littering some very general code. BUG=None Review URL: https://chromiumcodereview.appspot.com/11415050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168552 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/accelerators')
-rw-r--r--ash/accelerators/accelerator_filter.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/ash/accelerators/accelerator_filter.cc b/ash/accelerators/accelerator_filter.cc
index 69ba103..04f9fcc 100644
--- a/ash/accelerators/accelerator_filter.cc
+++ b/ash/accelerators/accelerator_filter.cc
@@ -11,6 +11,7 @@
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/accelerators/accelerator_manager.h"
#include "ui/base/events/event.h"
+#include "ui/base/keycodes/keyboard_codes_posix.h"
namespace ash {
namespace {
@@ -69,6 +70,8 @@ AcceleratorFilter::~AcceleratorFilter() {
ui::EventResult AcceleratorFilter::OnKeyEvent(ui::KeyEvent* event) {
const ui::EventType type = event->type();
+ if (event->key_code() == ui::VKEY_SHIFT)
+ ui::LayerAnimator::set_slow_animation_mode(type == ui::ET_KEY_PRESSED);
if (type != ui::ET_KEY_PRESSED && type != ui::ET_KEY_RELEASED)
return ui::ER_UNHANDLED;
if (event->is_char())