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

Unified Diff: chrome/browser/chromeos/status/status_area_view.cc

Issue 9570013: Activate the status area only when it's focused using the keyboard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new FocusCycler tests Created 8 years, 9 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
Index: chrome/browser/chromeos/status/status_area_view.cc
diff --git a/chrome/browser/chromeos/status/status_area_view.cc b/chrome/browser/chromeos/status/status_area_view.cc
index 98d8f056b48f71fc8f2077893095f71d8f5a4cea..def986ad03e498f41402a6d8e50daf9c3cf70e9a 100644
--- a/chrome/browser/chromeos/status/status_area_view.cc
+++ b/chrome/browser/chromeos/status/status_area_view.cc
@@ -13,8 +13,9 @@
#include "ui/gfx/canvas.h"
#include "ui/views/border.h"
-#if defined(USE_AURA)
-#include "ui/views/widget/widget.h"
+#if defined(USE_ASH)
+#include "ash/focus_cycler.h"
+#include "ash/shell.h"
#endif
// Number of pixels to separate each icon.
@@ -103,6 +104,26 @@ void StatusAreaView::ChildPreferredSizeChanged(View* child) {
PreferredSizeChanged();
}
+bool StatusAreaView::CanActivate() const {
+#if defined(USE_ASH)
+ // We don't want mouse clicks to activate us, but we need to allow
+ // activation when the user is using the keyboard (FocusCycler).
+ ash::internal::FocusCycler* focus_cycler =
+ ash::Shell::GetInstance()->focus_cycler();
+ return focus_cycler->widget_activating() == GetWidget();
+#else
+ return false;
+#endif
+}
+
+views::Widget* StatusAreaView::GetWidget() {
+ return View::GetWidget();
+}
+
+const views::Widget* StatusAreaView::GetWidget() const {
+ return View::GetWidget();
+}
+
void StatusAreaView::MakeButtonsActive(bool active) {
for (std::list<StatusAreaButton*>::iterator iter = buttons_.begin();
iter != buttons_.end(); ++iter) {
« no previous file with comments | « chrome/browser/chromeos/status/status_area_view.h ('k') | chrome/browser/ui/views/ash/status_area_host_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698