| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/hover_close_button.h" | 5 #import "chrome/browser/ui/cocoa/hover_close_button.h" |
| 6 | 6 |
| 7 #include "chrome/grit/generated_resources.h" | 7 #include "chrome/grit/generated_resources.h" |
| 8 #include "grit/theme_resources.h" | 8 #include "grit/theme_resources.h" |
| 9 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMKeyValueAnimation.h" | 9 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMKeyValueAnimation.h" |
| 10 #include "ui/base/cocoa/animation_utils.h" | 10 #include "ui/base/cocoa/animation_utils.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // which will clean up the animation. | 177 // which will clean up the animation. |
| 178 [fadeOutAnimation_ stopAnimation]; | 178 [fadeOutAnimation_ stopAnimation]; |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 | 182 |
| 183 - (void)commonInit { | 183 - (void)commonInit { |
| 184 // Set accessibility description. | 184 // Set accessibility description. |
| 185 NSCell* cell = [self cell]; | 185 NSCell* cell = [self cell]; |
| 186 [cell accessibilitySetOverrideValue:gDescription | 186 [cell accessibilitySetOverrideValue:gDescription |
| 187 forAttribute:NSAccessibilityDescriptionAttribute]; | 187 forAttribute:NSAccessibilityTitleAttribute]; |
| 188 | 188 |
| 189 // Add a tooltip. Using 'owner:self' means that | 189 // Add a tooltip. Using 'owner:self' means that |
| 190 // -view:stringForToolTip:point:userData: will be called to provide the | 190 // -view:stringForToolTip:point:userData: will be called to provide the |
| 191 // tooltip contents immediately before showing it. | 191 // tooltip contents immediately before showing it. |
| 192 [self addToolTipRect:[self bounds] owner:self userData:NULL]; | 192 [self addToolTipRect:[self bounds] owner:self userData:NULL]; |
| 193 | 193 |
| 194 // Initialize previousState. | 194 // Initialize previousState. |
| 195 previousState_ = kHoverStateNone; | 195 previousState_ = kHoverStateNone; |
| 196 } | 196 } |
| 197 | 197 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 228 break; | 228 break; |
| 229 case kHoverStateMouseDown: | 229 case kHoverStateMouseDown: |
| 230 imageID = IDR_CLOSE_DIALOG_P; | 230 imageID = IDR_CLOSE_DIALOG_P; |
| 231 break; | 231 break; |
| 232 } | 232 } |
| 233 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 233 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| 234 return bundle.GetNativeImageNamed(imageID).ToNSImage(); | 234 return bundle.GetNativeImageNamed(imageID).ToNSImage(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 @end | 237 @end |
| OLD | NEW |