| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/cocoa/download_shelf_controller.h" | 5 #import "chrome/browser/cocoa/download_shelf_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 return self; | 64 return self; |
| 65 } | 65 } |
| 66 | 66 |
| 67 - (void)awakeFromNib { | 67 - (void)awakeFromNib { |
| 68 // Initialize "Show all downloads" link. | 68 // Initialize "Show all downloads" link. |
| 69 | 69 |
| 70 scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( | 70 scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( |
| 71 [[NSParagraphStyle defaultParagraphStyle] mutableCopy]); | 71 [[NSParagraphStyle defaultParagraphStyle] mutableCopy]); |
| 72 [paragraphStyle.get() setAlignment:NSRightTextAlignment]; | 72 [paragraphStyle.get() setAlignment:NSRightTextAlignment]; |
| 73 | 73 |
| 74 NSFont* font = [NSFont systemFontOfSize: |
| 75 [NSFont systemFontSizeForControlSize:NSRegularControlSize]]; |
| 74 NSDictionary* linkAttributes = [NSDictionary dictionaryWithObjectsAndKeys: | 76 NSDictionary* linkAttributes = [NSDictionary dictionaryWithObjectsAndKeys: |
| 75 @"", NSLinkAttributeName, | 77 @"", NSLinkAttributeName, |
| 76 [NSCursor pointingHandCursor], NSCursorAttributeName, | 78 [NSCursor pointingHandCursor], NSCursorAttributeName, |
| 77 paragraphStyle.get(), NSParagraphStyleAttributeName, | 79 paragraphStyle.get(), NSParagraphStyleAttributeName, |
| 80 font, NSFontAttributeName, |
| 78 nil]; | 81 nil]; |
| 79 NSString* text = | 82 NSString* text = |
| 80 base::SysWideToNSString(l10n_util::GetString(IDS_SHOW_ALL_DOWNLOADS)); | 83 base::SysWideToNSString(l10n_util::GetString(IDS_SHOW_ALL_DOWNLOADS)); |
| 81 scoped_nsobject<NSAttributedString> linkText([[NSAttributedString alloc] | 84 scoped_nsobject<NSAttributedString> linkText([[NSAttributedString alloc] |
| 82 initWithString:text attributes:linkAttributes]); | 85 initWithString:text attributes:linkAttributes]); |
| 83 | 86 |
| 84 [[showAllDownloadsLink_ textStorage] setAttributedString:linkText.get()]; | 87 [[showAllDownloadsLink_ textStorage] setAttributedString:linkText.get()]; |
| 85 [showAllDownloadsLink_ setDelegate:self]; | 88 [showAllDownloadsLink_ setDelegate:self]; |
| 86 | 89 |
| 87 [self resizeDownloadLinkToFit]; | 90 [self resizeDownloadLinkToFit]; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 if (isTransferDone && | 278 if (isTransferDone && |
| 276 [itemController download]->safety_state() != DownloadItem::DANGEROUS) { | 279 [itemController download]->safety_state() != DownloadItem::DANGEROUS) { |
| 277 [self remove:itemController]; | 280 [self remove:itemController]; |
| 278 } else { | 281 } else { |
| 279 ++i; | 282 ++i; |
| 280 } | 283 } |
| 281 } | 284 } |
| 282 } | 285 } |
| 283 | 286 |
| 284 @end | 287 @end |
| OLD | NEW |