OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/autofill/password_generation_popup_view_cocoa.h
" | 5 #import "chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.h
" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 [divider_ setBoxType:NSBoxCustom]; | 100 [divider_ setBoxType:NSBoxCustom]; |
101 [divider_ setBorderType:NSLineBorder]; | 101 [divider_ setBorderType:NSLineBorder]; |
102 [divider_ setBorderColor:DividerColor()]; | 102 [divider_ setBorderColor:DividerColor()]; |
103 [self addSubview:divider_]; | 103 [self addSubview:divider_]; |
104 | 104 |
105 helpTextView_.reset([[HyperlinkTextView alloc] initWithFrame:NSZeroRect]); | 105 helpTextView_.reset([[HyperlinkTextView alloc] initWithFrame:NSZeroRect]); |
106 [helpTextView_ setMessage:base::SysUTF16ToNSString(controller_->HelpText()) | 106 [helpTextView_ setMessage:base::SysUTF16ToNSString(controller_->HelpText()) |
107 withFont:[self textFont] | 107 withFont:[self textFont] |
108 messageColor:HelpTextColor()]; | 108 messageColor:HelpTextColor()]; |
109 [helpTextView_ addLinkRange:controller_->HelpTextLinkRange().ToNSRange() | 109 [helpTextView_ addLinkRange:controller_->HelpTextLinkRange().ToNSRange() |
110 withName:@"" | 110 withURL:@"about:blank" // using a link here is bad ui |
111 linkColor:HelpLinkColor()]; | 111 linkColor:HelpLinkColor()]; |
112 [helpTextView_ setDelegate:self]; | 112 [helpTextView_ setDelegate:self]; |
113 [helpTextView_ setDrawsBackground:YES]; | 113 [helpTextView_ setDrawsBackground:YES]; |
114 [helpTextView_ setBackgroundColor:HelpTextBackgroundColor()]; | 114 [helpTextView_ setBackgroundColor:HelpTextBackgroundColor()]; |
115 [helpTextView_ | 115 [helpTextView_ |
116 setTextContainerInset:NSMakeSize(controller_->kHorizontalPadding, | 116 setTextContainerInset:NSMakeSize(controller_->kHorizontalPadding, |
117 controller_->kHelpVerticalPadding)]; | 117 controller_->kHelpVerticalPadding)]; |
118 // Remove the underlining. | 118 // Remove the underlining. |
119 NSTextStorage* text = [helpTextView_ textStorage]; | 119 NSTextStorage* text = [helpTextView_ textStorage]; |
120 [text addAttribute:NSUnderlineStyleAttributeName | 120 [text addAttribute:NSUnderlineStyleAttributeName |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 350 |
351 - (NSFont*)boldFont { | 351 - (NSFont*)boldFont { |
352 return [NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]]; | 352 return [NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]]; |
353 } | 353 } |
354 | 354 |
355 - (NSFont*)textFont { | 355 - (NSFont*)textFont { |
356 return [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; | 356 return [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; |
357 } | 357 } |
358 | 358 |
359 @end | 359 @end |
OLD | NEW |