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

Side by Side Diff: chrome/browser/ui/cocoa/tab_contents/sad_tab_view_cocoa.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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/cocoa/tab_contents/sad_tab_view_cocoa.h" 5 #include "chrome/browser/ui/cocoa/tab_contents/sad_tab_view_cocoa.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 // Get the help text and link. 174 // Get the help text and link.
175 size_t linkOffset = 0; 175 size_t linkOffset = 0;
176 const base::string16 helpLink = 176 const base::string16 helpLink =
177 l10n_util::GetStringUTF16(IDS_SAD_TAB_LEARN_MORE_LINK); 177 l10n_util::GetStringUTF16(IDS_SAD_TAB_LEARN_MORE_LINK);
178 NSString* helpMessage(base::SysUTF16ToNSString(helpLink)); 178 NSString* helpMessage(base::SysUTF16ToNSString(helpLink));
179 [help_ setMessage:helpMessage 179 [help_ setMessage:helpMessage
180 withFont:helpFont 180 withFont:helpFont
181 messageColor:[message_ textColor]]; 181 messageColor:[message_ textColor]];
182 [help_ addLinkRange:NSMakeRange(linkOffset, helpLink.length()) 182 [help_ addLinkRange:NSMakeRange(linkOffset, helpLink.length())
183 withName:@(chrome::kCrashReasonURL) 183 withURL:@(chrome::kCrashReasonURL)
184 linkColor:[message_ textColor]]; 184 linkColor:[message_ textColor]];
185 [help_ setAlignment:NSLeftTextAlignment]; 185 [help_ setAlignment:NSLeftTextAlignment];
186 [help_ sizeToFit]; 186 [help_ sizeToFit];
187 } 187 }
188 188
189 // Called when someone clicks on the embedded link. 189 // Called when someone clicks on the embedded link.
190 - (BOOL)textView:(NSTextView*)textView 190 - (BOOL)textView:(NSTextView*)textView
191 clickedOnLink:(id)link 191 clickedOnLink:(id)link
192 atIndex:(NSUInteger)charIndex { 192 atIndex:(NSUInteger)charIndex {
193 [NSApp sendAction:@selector(openLearnMoreAboutCrashLink:) to:nil from:self]; 193 [NSApp sendAction:@selector(openLearnMoreAboutCrashLink:) to:nil from:self];
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 floor((NSWidth(bounds) - frameSize.width) / 2), 239 floor((NSWidth(bounds) - frameSize.width) / 2),
240 std::min(kMaxTopMargin, std::max(kTabMargin, 240 std::min(kMaxTopMargin, std::max(kTabMargin,
241 NSHeight(bounds) - [container_ contentHeight] - kTabMargin)))]; 241 NSHeight(bounds) - [container_ contentHeight] - kTabMargin)))];
242 } 242 }
243 243
244 - (NSButton*)reloadButton { 244 - (NSButton*)reloadButton {
245 return [container_ reloadButton]; 245 return [container_ reloadButton];
246 } 246 }
247 247
248 @end 248 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698