diff options
author | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 07:05:41 +0000 |
---|---|---|
committer | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 07:05:41 +0000 |
commit | ce711ac2f9c0f72b8347a381eea8106f9b57811c (patch) | |
tree | b416b659efe875090302b8e55f2fe7f1cac2cc50 /ash/focus_cycler.h | |
parent | f292c05203ef92c03912031b9193ac5dbbeea241 (diff) | |
download | chromium_src-ce711ac2f9c0f72b8347a381eea8106f9b57811c.zip chromium_src-ce711ac2f9c0f72b8347a381eea8106f9b57811c.tar.gz chromium_src-ce711ac2f9c0f72b8347a381eea8106f9b57811c.tar.bz2 |
Handle Ctrl+F1 and Ctrl+F2 correctly even when no browser window is available.
- Remove accelerators from ash/focus_cycler.cc and chrome/browser/ui/views/accelerator_table.cc. Instead, handle it in ash/accelerator/accelerator_controller.cc.
- Do not try to focus a browser window in ash/focus_cycler.cc when it's not available. Unit tests added.
BUG=129307
TEST=ran aura_shell_unittests + manually checked
Review URL: https://chromiumcodereview.appspot.com/10545132
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142107 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/focus_cycler.h')
-rw-r--r-- | ash/focus_cycler.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/ash/focus_cycler.h b/ash/focus_cycler.h index 36ddc68..b30c370 100644 --- a/ash/focus_cycler.h +++ b/ash/focus_cycler.h @@ -9,8 +9,8 @@ #include <vector> #include "ash/ash_export.h" +#include "base/basictypes.h" #include "base/compiler_specific.h" -#include "ui/base/accelerators/accelerator.h" namespace views { class Widget; @@ -22,7 +22,7 @@ namespace internal { // This class handles moving focus between a set of widgets and the main browser // window. -class ASH_EXPORT FocusCycler : public ui::AcceleratorTarget { +class ASH_EXPORT FocusCycler { public: enum Direction { FORWARD, @@ -30,14 +30,14 @@ class ASH_EXPORT FocusCycler : public ui::AcceleratorTarget { }; FocusCycler(); - virtual ~FocusCycler(); + ~FocusCycler(); // Returns the widget the FocusCycler is attempting to activate or NULL if // FocusCycler is not activating any widgets. const views::Widget* widget_activating() const { return widget_activating_; } - // Add a widget to the focus cycle and set up accelerators. The widget needs - // to have an AccessiblePaneView as the content view. + // Add a widget to the focus cycle. The widget needs to have an + // AccessiblePaneView as the content view. void AddWidget(views::Widget* widget); // Move focus to the next widget. @@ -46,10 +46,6 @@ class ASH_EXPORT FocusCycler : public ui::AcceleratorTarget { // Moves focus the specified widget. Returns true if the widget was activated. bool FocusWidget(views::Widget* widget); - // ui::AcceleratorTarget overrides - virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; - virtual bool CanHandleAccelerators() const OVERRIDE; - private: std::vector<views::Widget*> widgets_; |