Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / toolbar / toolbar_view_cocoa.mm
blob049e53c1bc3292db8e57609b2707dcb77d966504
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 {
16   return NO;
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 {
29   return NO;
32 - (id)accessibilityAttributeValue:(NSString*)attribute {
33   if ([attribute isEqual:NSAccessibilityRoleAttribute])
34     return NSAccessibilityToolbarRole;
36   return [super accessibilityAttributeValue:attribute];
39 - (ViewID)viewID {
40   return VIEW_ID_TOOLBAR;
43 - (BOOL)isOpaque {
44   return YES;
47 // ThemedWindowDrawing overrides.
49 - (void)windowDidChangeActive {
50   // Need to redraw the omnibox and toolbar buttons as well.
51   [self cr_recursivelySetNeedsDisplay:YES];
54 @end