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

Unified Diff: ash/launcher/launcher_button.cc

Issue 10449077: Set "Hover" status during focus for accessibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 6 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/launcher/launcher_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/launcher_button.cc
diff --git a/ash/launcher/launcher_button.cc b/ash/launcher/launcher_button.cc
index 95e6c7797b16c8562480208aa5ef1276054c9f5b..1f4750b42ca8e51e597d5c6e82d70d1c86dd739d 100644
--- a/ash/launcher/launcher_button.cc
+++ b/ash/launcher/launcher_button.cc
@@ -42,7 +42,8 @@ const int kAttentionThrobDurationMS = 2000;
bool ShouldHop(int state) {
return state & ash::internal::LauncherButton::STATE_HOVERED ||
- state & ash::internal::LauncherButton::STATE_ACTIVE;
+ state & ash::internal::LauncherButton::STATE_ACTIVE ||
+ state & ash::internal::LauncherButton::STATE_FOCUSED;
}
} // namespace
@@ -397,6 +398,14 @@ bool LauncherButton::GetTooltipText(
return true;
}
+void LauncherButton::OnFocus() {
+ AddState(STATE_FOCUSED);
+}
+
+void LauncherButton::OnBlur() {
+ ClearState(STATE_FOCUSED);
+}
+
void LauncherButton::Init() {
icon_view_ = CreateIconView();
// TODO: refactor the layers so each button doesn't require 2.
@@ -427,7 +436,7 @@ void LauncherButton::UpdateState() {
if (state_ & STATE_ACTIVE || state_ & STATE_ATTENTION) {
bar_id = IsShelfHorizontal() ? IDR_AURA_LAUNCHER_UNDERLINE_ACTIVE :
IDR_AURA_LAUNCHER_UNDERLINE_VERTICAL_ACTIVE;
- } else if (state_ & STATE_HOVERED) {
+ } else if (state_ & STATE_HOVERED || state_ & STATE_FOCUSED) {
bar_id = IsShelfHorizontal() ? IDR_AURA_LAUNCHER_UNDERLINE_HOVER :
IDR_AURA_LAUNCHER_UNDERLINE_VERTICAL_HOVER;
} else {
« no previous file with comments | « ash/launcher/launcher_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698