Enable right clicking on the applist doodle web contents and log the data.
[chromium-blink-merge.git] / ui / base / cocoa / hover_image_button.mm
blob3cdf509122e261023cab1bb464dc87d68214c2ef
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 "ui/base/cocoa/hover_image_button.h"
7 @implementation HoverImageButton
9 - (void)drawRect:(NSRect)rect {
10   if (hoverState_ == kHoverStateMouseDown && pressedImage_) {
11     [super setImage:pressedImage_.get()];
12   } else if (hoverState_ == kHoverStateMouseOver && hoverImage_) {
13     [super setImage:hoverImage_.get()];
14   } else {
15     [super setImage:defaultImage_.get()];
16   }
18   [super drawRect:rect];
21 - (void)setDefaultImage:(NSImage*)image {
22   defaultImage_.reset([image retain]);
25 - (void)setHoverImage:(NSImage*)image {
26   hoverImage_.reset([image retain]);
29 - (void)setPressedImage:(NSImage*)image {
30   pressedImage_.reset([image retain]);
33 @end