Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Unified Diff: chrome/browser/ui/cocoa/hover_close_button.mm

Issue 2898343002: [Mac] Update tab close button when user drags outside (Closed)
Patch Set: Add retain, comment on key events. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/cocoa/hover_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/hover_close_button.mm
diff --git a/chrome/browser/ui/cocoa/hover_close_button.mm b/chrome/browser/ui/cocoa/hover_close_button.mm
index f025a588d8a0e66fcc21c1e5632edd1532124ed4..973ef4ff3b15314ac7ef512d32141b784f28ab9c 100644
--- a/chrome/browser/ui/cocoa/hover_close_button.mm
+++ b/chrome/browser/ui/cocoa/hover_close_button.mm
@@ -59,16 +59,18 @@ const SkColor kDefaultIconColor = SkColorSetARGB(0xA0, 0x00, 0x00, 0x00);
gTooltip = [l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_CLOSE_TAB) copy];
}
-- (id)initWithFrame:(NSRect)frameRect {
- if ((self = [super initWithFrame:frameRect])) {
- [self commonInit];
- }
- return self;
-}
+- (void)commonInit {
+ [super commonInit];
+
+ [self setAccessibilityTitle:nil];
+
+ // Add a tooltip. Using 'owner:self' means that
+ // -view:stringForToolTip:point:userData: will be called to provide the
+ // tooltip contents immediately before showing it.
+ [self addToolTipRect:[self bounds] owner:self userData:NULL];
-- (void)awakeFromNib {
- [super awakeFromNib];
- [self commonInit];
+ previousState_ = kHoverStateNone;
+ iconColor_ = kDefaultIconColor;
}
- (void)removeFromSuperview {
@@ -198,18 +200,6 @@ const SkColor kDefaultIconColor = SkColorSetARGB(0xA0, 0x00, 0x00, 0x00);
}
}
-- (void)commonInit {
- [self setAccessibilityTitle:nil];
-
- // Add a tooltip. Using 'owner:self' means that
- // -view:stringForToolTip:point:userData: will be called to provide the
- // tooltip contents immediately before showing it.
- [self addToolTipRect:[self bounds] owner:self userData:NULL];
-
- previousState_ = kHoverStateNone;
- iconColor_ = kDefaultIconColor;
-}
-
// Called each time a tooltip is about to be shown.
- (NSString*)view:(NSView*)view
stringForToolTip:(NSToolTipTag)tag
« no previous file with comments | « no previous file | ui/base/cocoa/hover_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698