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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_notification_controller.mm

Issue 1364113003: Only (and always) put URLs in NSLinkAttributeName. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@infobar1
Patch Set: stray deletion Created 5 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/ui/cocoa/autofill/autofill_notification_controller.h" 5 #import "chrome/browser/ui/cocoa/autofill/autofill_notification_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 gfx::SkColorToCalibratedNSColor(notification->GetBorderColor())]; 79 gfx::SkColorToCalibratedNSColor(notification->GetBorderColor())];
80 [self setView:view]; 80 [self setView:view];
81 81
82 textview_.reset([[HyperlinkTextView alloc] initWithFrame:NSZeroRect]); 82 textview_.reset([[HyperlinkTextView alloc] initWithFrame:NSZeroRect]);
83 NSColor* textColor = 83 NSColor* textColor =
84 gfx::SkColorToCalibratedNSColor(notification->GetTextColor()); 84 gfx::SkColorToCalibratedNSColor(notification->GetTextColor());
85 [textview_ setMessage:base::SysUTF16ToNSString(notification->display_text()) 85 [textview_ setMessage:base::SysUTF16ToNSString(notification->display_text())
86 withFont:[NSFont labelFontOfSize:[[textview_ font] pointSize]] 86 withFont:[NSFont labelFontOfSize:[[textview_ font] pointSize]]
87 messageColor:textColor]; 87 messageColor:textColor];
88 if (!notification->link_range().is_empty()) { 88 if (!notification->link_range().is_empty()) {
89 linkURL_ = notification->link_url();
89 [textview_ setDelegate:self]; 90 [textview_ setDelegate:self];
90 [textview_ addLinkRange:notification->link_range().ToNSRange() 91 [textview_ addLinkRange:notification->link_range().ToNSRange()
91 withName:self 92 withURL:base::SysUTF8ToNSString(linkURL_.spec())
92 linkColor:[NSColor blueColor]]; 93 linkColor:[NSColor blueColor]];
93 linkURL_ = notification->link_url();
94 } 94 }
95 95
96 tooltipController_.reset([[AutofillTooltipController alloc] 96 tooltipController_.reset([[AutofillTooltipController alloc]
97 initWithArrowLocation:info_bubble::kTopRight]); 97 initWithArrowLocation:info_bubble::kTopRight]);
98 [tooltipController_ setImage: 98 [tooltipController_ setImage:
99 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( 99 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(
100 IDR_AUTOFILL_TOOLTIP_ICON).ToNSImage()]; 100 IDR_AUTOFILL_TOOLTIP_ICON).ToNSImage()];
101 [tooltipController_ setMessage: 101 [tooltipController_ setMessage:
102 base::SysUTF16ToNSString(notification->tooltip_text())]; 102 base::SysUTF16ToNSString(notification->tooltip_text())];
103 [[tooltipController_ view] setHidden: 103 [[tooltipController_ view] setHidden:
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 181
182 - (BOOL)textView:(NSTextView *)textView 182 - (BOOL)textView:(NSTextView *)textView
183 clickedOnLink:(id)link 183 clickedOnLink:(id)link
184 atIndex:(NSUInteger)charIndex { 184 atIndex:(NSUInteger)charIndex {
185 delegate_->LinkClicked(linkURL_); 185 delegate_->LinkClicked(linkURL_);
186 return YES; 186 return YES;
187 } 187 }
188 188
189 @end 189 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698