OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_text_view.h" | 5 #import "ui/base/cocoa/controls/hyperlink_text_view.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "ui/base/cocoa/nsview_additions.h" | 9 #include "ui/base/cocoa/nsview_additions.h" |
10 | 10 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 isValidLink_ = YES; | 155 isValidLink_ = YES; |
156 } else { | 156 } else { |
157 url = @""; | 157 url = @""; |
158 isValidLink_ = NO; | 158 isValidLink_ = NO; |
159 } | 159 } |
160 NSDictionary* attributes = @{ | 160 NSDictionary* attributes = @{ |
161 NSForegroundColorAttributeName : linkColor, | 161 NSForegroundColorAttributeName : linkColor, |
162 NSUnderlineStyleAttributeName : @(YES), | 162 NSUnderlineStyleAttributeName : @(YES), |
163 NSCursorAttributeName : [NSCursor pointingHandCursor], | 163 NSCursorAttributeName : [NSCursor pointingHandCursor], |
164 NSLinkAttributeName : url, | 164 NSLinkAttributeName : url, |
165 NSUnderlineStyleAttributeName : @(NSSingleUnderlineStyle) | 165 NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle) |
166 }; | 166 }; |
167 | 167 |
168 [[self textStorage] addAttributes:attributes range:range]; | 168 [[self textStorage] addAttributes:attributes range:range]; |
169 } | 169 } |
170 | 170 |
171 - (void)setRefusesFirstResponder:(BOOL)refusesFirstResponder { | 171 - (void)setRefusesFirstResponder:(BOOL)refusesFirstResponder { |
172 refusesFirstResponder_ = refusesFirstResponder; | 172 refusesFirstResponder_ = refusesFirstResponder; |
173 } | 173 } |
174 | 174 |
175 @end | 175 @end |
OLD | NEW |