summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 14:18:11 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 14:18:11 +0000
commit05125cc97d3bfcbac8dedb13b5ec8816aababf1e (patch)
tree0548a740201c954229882f095a1fb0f36f33bb2a /chrome
parent2fed40dca785c74127c812cb45f0a2227414813e (diff)
downloadchromium_src-05125cc97d3bfcbac8dedb13b5ec8816aababf1e.zip
chromium_src-05125cc97d3bfcbac8dedb13b5ec8816aababf1e.tar.gz
chromium_src-05125cc97d3bfcbac8dedb13b5ec8816aababf1e.tar.bz2
Show keyboard focus on toolbar buttons.
BUG=52536 TEST=as in bug Review URL: http://codereview.chromium.org/3151023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56526 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/gradient_button_cell.mm15
1 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/cocoa/gradient_button_cell.mm b/chrome/browser/cocoa/gradient_button_cell.mm
index cdeafbb..ed8408e 100644
--- a/chrome/browser/cocoa/gradient_button_cell.mm
+++ b/chrome/browser/cocoa/gradient_button_cell.mm
@@ -522,23 +522,30 @@ static const NSTimeInterval kAnimationContinuousCycleDuration = 0.4;
ThemeProvider* themeProvider = [window themeProvider];
BOOL active = [window isKeyWindow] || [window isMainWindow];
- // Stroke the borders and appropriate fill gradient. If we're borderless,
- // the only time we want to draw the inner gradient is if we're highlighted.
+ // Stroke the borders and appropriate fill gradient. If we're borderless, the
+ // only time we want to draw the inner gradient is if we're highlighted or if
+ // we're the first responder (when "Full Keyboard Access" is turned on).
if (([self isBordered] && ![self showsBorderOnlyWhileMouseInside]) ||
pressed ||
[self isMouseInside] ||
- [self isContinuousPulsing]) {
+ [self isContinuousPulsing] ||
+ [self showsFirstResponder]) {
// When pulsing we want the bookmark to stand out a little more.
BOOL showClickedGradient = pressed ||
(pulseState_ == gradient_button_cell::kPulsingContinuous);
+ // When first responder, turn the hover alpha all the way up.
+ CGFloat hoverAlpha = [self hoverAlpha];
+ if ([self showsFirstResponder])
+ hoverAlpha = 1.0;
+
[self drawBorderAndFillForTheme:themeProvider
controlView:controlView
innerPath:innerPath
showClickedGradient:showClickedGradient
showHighlightGradient:[self isHighlighted]
- hoverAlpha:[self hoverAlpha]
+ hoverAlpha:hoverAlpha
active:active
cellFrame:cellFrame
defaultGradient:nil];