diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-26 21:26:06 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-26 21:26:06 +0000 |
commit | 0634f5e4af77b4452adf3c82830b316b220b670e (patch) | |
tree | 32ee3a668a6ea5d159719430c0720df28e0e58d2 /ash/focus_cycler.cc | |
parent | 687853ca42589575a5f90006deb3cf702bf77ee3 (diff) | |
download | chromium_src-0634f5e4af77b4452adf3c82830b316b220b670e.zip chromium_src-0634f5e4af77b4452adf3c82830b316b220b670e.tar.gz chromium_src-0634f5e4af77b4452adf3c82830b316b220b670e.tar.bz2 |
ash: Focus tray with shift-alt-s
BUG=120177
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9855029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129008 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/focus_cycler.cc')
-rw-r--r-- | ash/focus_cycler.cc | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/ash/focus_cycler.cc b/ash/focus_cycler.cc index 9c4dab1..242aab4 100644 --- a/ash/focus_cycler.cc +++ b/ash/focus_cycler.cc @@ -6,6 +6,7 @@ #include "ash/shell.h" #include "ash/shell_delegate.h" +#include "ash/system/tray/system_tray.h" #include "ui/views/widget/widget.h" #include "ui/views/focus/focus_search.h" #include "ui/aura/window.h" @@ -71,21 +72,25 @@ void FocusCycler::RotateFocus(Direction direction) { break; } } else { - views::Widget* widget = widgets_[index]; - - views::AccessiblePaneView* view = - static_cast<views::AccessiblePaneView*>(widget->GetContentsView()); - if (view->SetPaneFocusAndFocusDefault()) { - widget_activating_ = widget; - widget->Activate(); - widget_activating_ = NULL; - if (widget->IsActive()) - break; - } + if (FocusWidget(widgets_[index])) + break; } } } +bool FocusCycler::FocusWidget(views::Widget* widget) { + views::AccessiblePaneView* view = + static_cast<views::AccessiblePaneView*>(widget->GetContentsView()); + if (view->SetPaneFocusAndFocusDefault()) { + widget_activating_ = widget; + widget->Activate(); + widget_activating_ = NULL; + if (widget->IsActive()) + return true; + } + return false; +} + bool FocusCycler::AcceleratorPressed(const ui::Accelerator& accelerator) { switch (accelerator.key_code()) { case ui::VKEY_F1: @@ -95,6 +100,7 @@ bool FocusCycler::AcceleratorPressed(const ui::Accelerator& accelerator) { RotateFocus(FORWARD); return true; default: + NOTREACHED(); return false; } } |