| 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 "chrome/browser/ui/cocoa/hyperlink_text_view.h" | 5 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" |
| 6 | 6 |
| 7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #include "chrome/browser/ui/cocoa/nsview_additions.h" | 8 #include "chrome/browser/ui/cocoa/nsview_additions.h" |
| 9 | 9 |
| 10 // The baseline shift for text in the NSTextView. | 10 // The baseline shift for text in the NSTextView. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 81 } |
| 82 | 82 |
| 83 - (void)configureTextView { | 83 - (void)configureTextView { |
| 84 [self setEditable:NO]; | 84 [self setEditable:NO]; |
| 85 [self setDrawsBackground:NO]; | 85 [self setDrawsBackground:NO]; |
| 86 [self setHorizontallyResizable:NO]; | 86 [self setHorizontallyResizable:NO]; |
| 87 [self setVerticallyResizable:NO]; | 87 [self setVerticallyResizable:NO]; |
| 88 | 88 |
| 89 // When text is rendered, linkTextAttributes override anything set via | 89 // When text is rendered, linkTextAttributes override anything set via |
| 90 // addAttributes for text that has NSLinkAttributeName. Set to nil to allow | 90 // addAttributes for text that has NSLinkAttributeName. Set to nil to allow |
| 91 // custom attributes to take precendence. | 91 // custom attributes to take precedence. |
| 92 [self setLinkTextAttributes:nil]; | 92 [self setLinkTextAttributes:nil]; |
| 93 [self setDisplaysLinkToolTips:NO]; | 93 [self setDisplaysLinkToolTips:NO]; |
| 94 | 94 |
| 95 acceptsFirstResponder_ = YES; | 95 acceptsFirstResponder_ = YES; |
| 96 drawsBackgroundUsingSuperview_ = NO; | 96 drawsBackgroundUsingSuperview_ = NO; |
| 97 } | 97 } |
| 98 | 98 |
| 99 - (void)fixupCursor { | 99 - (void)fixupCursor { |
| 100 if ([[NSCursor currentCursor] isEqual:[NSCursor IBeamCursor]]) | 100 if ([[NSCursor currentCursor] isEqual:[NSCursor IBeamCursor]]) |
| 101 [[NSCursor arrowCursor] set]; | 101 [[NSCursor arrowCursor] set]; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 [[self textStorage] addAttributes:attributes range:range]; | 151 [[self textStorage] addAttributes:attributes range:range]; |
| 152 } | 152 } |
| 153 | 153 |
| 154 - (void)setAcceptsFirstResponder:(BOOL)acceptsFirstResponder { | 154 - (void)setAcceptsFirstResponder:(BOOL)acceptsFirstResponder { |
| 155 acceptsFirstResponder_ = acceptsFirstResponder; | 155 acceptsFirstResponder_ = acceptsFirstResponder; |
| 156 } | 156 } |
| 157 | 157 |
| 158 @end | 158 @end |
| OLD | NEW |