Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5471)

Unified Diff: ash/focus_cycler.h

Issue 9295049: Allow focus to be sent between browser window and launcher/status window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix special index Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash.gyp ('k') | ash/focus_cycler.cc » ('j') | ash/focus_cycler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/focus_cycler.h
diff --git a/ash/focus_cycler.h b/ash/focus_cycler.h
new file mode 100644
index 0000000000000000000000000000000000000000..544896357ea12a252f054bc4fdb12222a8077a15
--- /dev/null
+++ b/ash/focus_cycler.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef FOCUS_CYCLER_H_
+#define FOCUS_CYCLER_H_
+#pragma once
+
+#include "ash/accelerators/accelerator_controller.h"
sky 2012/01/31 16:38:15 Include ui/base/accelerators/accelerator instead.
Zachary Kuznia 2012/01/31 17:57:42 Done.
+
+#include <vector>
sky 2012/01/31 16:38:15 vector should be the first include.
Zachary Kuznia 2012/01/31 17:57:42 Done.
+
+namespace views {
+class Widget;
+} // namespace views
+
+namespace ash {
+
sky 2012/01/31 16:38:15 If this class isn't needed outside of ash, put it
Zachary Kuznia 2012/01/31 17:57:42 Done.
+// This class handles moving focus between a set of widgets and the main browser
+// window.
+class FocusCycler : public ui::AcceleratorTarget {
+ public:
+ FocusCycler();
+ ~FocusCycler();
sky 2012/01/31 16:38:15 virtual
Zachary Kuznia 2012/01/31 17:57:42 Done.
+
+ // Add a widget to the focus cycle and set up accelerators. The widget needs
+ // to have an AccessiblePaneView as the content view.
+ void AddWidget(views::Widget* widget);
+
+ // Move focus to the next widget.
+ void RotateFocus(bool forwards);
sky 2012/01/31 16:38:15 Use an enum to make it clear what true/value mean.
Zachary Kuznia 2012/01/31 17:57:42 Done.
+
+ // ui::AcceleratorTarget overrides
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
+ virtual bool CanHandleAccelerators() const OVERRIDE;
+
+ private:
+ ui::Accelerator ctrl_forward_key_;
sky 2012/01/31 16:38:15 Do these really need to exist as members? Can AddW
Zachary Kuznia 2012/01/31 17:57:42 Done.
+ ui::Accelerator ctrl_back_key_;
+
+ std::vector<views::Widget*> widgets_;
+
+ DISALLOW_COPY_AND_ASSIGN(FocusCycler);
+};
+
+} // namespace ash
+
+#endif // FOCUS_CYCLER_H_
« no previous file with comments | « ash/ash.gyp ('k') | ash/focus_cycler.cc » ('j') | ash/focus_cycler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698