1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_view_cocoa.h"
7 #import "chrome/browser/ui/cocoa/view_id_util.h"
8 #import "ui/base/cocoa/nsview_additions.h"
10 @implementation ToolbarView
12 @synthesize dividerOpacity = dividerOpacity_;
14 // Prevent mouse down events from moving the parent window around.
15 - (BOOL)mouseDownCanMoveWindow {
19 - (void)drawRect:(NSRect)dirtyRect {
20 [self drawBackground:dirtyRect];
23 // Override of |-[BackgroundGradientView strokeColor]|; make it respect opacity.
24 - (NSColor*)strokeColor {
25 return [[super strokeColor] colorWithAlphaComponent:[self dividerOpacity]];
28 - (BOOL)accessibilityIsIgnored {
32 - (id)accessibilityAttributeValue:(NSString*)attribute {
33 if ([attribute isEqual:NSAccessibilityRoleAttribute])
34 return NSAccessibilityToolbarRole;
36 return [super accessibilityAttributeValue:attribute];
40 return VIEW_ID_TOOLBAR;
47 // ThemedWindowDrawing overrides.
49 - (void)windowDidChangeActive {
50 // Need to redraw the omnibox and toolbar buttons as well.
51 [self cr_recursivelySetNeedsDisplay:YES];