OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |