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

Side by Side Diff: ui/base/cocoa/controls/hyperlink_button_cell.mm

Issue 1842663003: Mac: Replace uses of deprecated NSNoUnderlineStyle and NSSingleUnderlineStyle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20160329-Mac-DeploymentTarget
Patch Set: cl format Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/base/cocoa/controls/hyperlink_button_cell.h" 5 #import "ui/base/cocoa/controls/hyperlink_button_cell.h"
6 6
7 using hyperlink_button_cell::UnderlineBehavior; 7 using hyperlink_button_cell::UnderlineBehavior;
8 8
9 @interface HyperlinkButtonCell () 9 @interface HyperlinkButtonCell ()
10 - (void)customizeButtonCell; 10 - (void)customizeButtonCell;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 [self setShowsBorderOnlyWhileMouseInside:YES]; 84 [self setShowsBorderOnlyWhileMouseInside:YES];
85 } 85 }
86 86
87 - (void)setControlSize:(NSControlSize)size { 87 - (void)setControlSize:(NSControlSize)size {
88 [super setControlSize:size]; 88 [super setControlSize:size];
89 [self customizeButtonCell]; // recompute |font|. 89 [self customizeButtonCell]; // recompute |font|.
90 } 90 }
91 91
92 // Creates the NSDictionary of attributes for the attributed string. 92 // Creates the NSDictionary of attributes for the attributed string.
93 - (NSDictionary*)linkAttributes { 93 - (NSDictionary*)linkAttributes {
94 NSUInteger underlineMask = NSNoUnderlineStyle; 94 NSUInteger underlineMask = NSUnderlineStyleNone;
95 if (underlineBehavior_ == UnderlineBehavior::ALWAYS || 95 if (underlineBehavior_ == UnderlineBehavior::ALWAYS ||
96 (mouseIsInside_ && [self isEnabled] && 96 (mouseIsInside_ && [self isEnabled] &&
97 underlineBehavior_ == UnderlineBehavior::ON_HOVER)) { 97 underlineBehavior_ == UnderlineBehavior::ON_HOVER)) {
98 underlineMask = NSUnderlinePatternSolid | NSUnderlineStyleSingle; 98 underlineMask = NSUnderlinePatternSolid | NSUnderlineStyleSingle;
99 } 99 }
100 100
101 base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( 101 base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle(
102 [[NSParagraphStyle defaultParagraphStyle] mutableCopy]); 102 [[NSParagraphStyle defaultParagraphStyle] mutableCopy]);
103 [paragraphStyle setAlignment:[self alignment]]; 103 [paragraphStyle setAlignment:[self alignment]];
104 [paragraphStyle setLineBreakMode:[self lineBreakMode]]; 104 [paragraphStyle setLineBreakMode:[self lineBreakMode]];
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 } 158 }
159 159
160 // Override so that |-sizeToFit| works better with this type of cell. 160 // Override so that |-sizeToFit| works better with this type of cell.
161 - (NSSize)cellSize { 161 - (NSSize)cellSize {
162 NSSize size = [super cellSize]; 162 NSSize size = [super cellSize];
163 size.width += 2; 163 size.width += 2;
164 return size; 164 return size;
165 } 165 }
166 166
167 @end 167 @end
OLDNEW
« no previous file with comments | « ui/app_list/cocoa/app_list_view_controller.mm ('k') | ui/base/cocoa/controls/hyperlink_text_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698