| Index: chrome/browser/cocoa/download_item_controller.mm
|
| diff --git a/chrome/browser/cocoa/download_item_controller.mm b/chrome/browser/cocoa/download_item_controller.mm
|
| index 02dcd66036c93163a98bbae8905b4c80d50e1f16..ccc27704e2703de89d4dc3a26e42561ec97f924b 100644
|
| --- a/chrome/browser/cocoa/download_item_controller.mm
|
| +++ b/chrome/browser/cocoa/download_item_controller.mm
|
| @@ -36,6 +36,10 @@ const int kTextWidth = 140; // Pixels
|
| // dangerous download message.
|
| const int kFileNameMaxLength = 20;
|
|
|
| +// The maximum width in pixels for the file name tooltip.
|
| +const int kToolTipMaxWidth = 900;
|
| +
|
| +
|
| // Helper to widen a view.
|
| void WidenView(NSView* view, CGFloat widthChange) {
|
| // If it is an NSBox, the autoresize of the contentView is the issue.
|
| @@ -150,6 +154,7 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
|
| [image_ setImage:alertIcon];
|
|
|
| bridge_->LoadIcon();
|
| + [self updateToolTip];
|
| }
|
|
|
| - (void)setStateFromDownload:(BaseDownloadItemModel*)downloadModel {
|
| @@ -254,6 +259,13 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
|
| return bridge_->download_model()->download();
|
| }
|
|
|
| +- (void)updateToolTip {
|
| + std::wstring elidedFilename = gfx::ElideFilename(
|
| + [self download]->GetFileName(),
|
| + gfx::Font(), kToolTipMaxWidth);
|
| + [progressView_ setToolTip:base::SysWideToNSString(elidedFilename)];
|
| +}
|
| +
|
| - (void)clearDangerousMode {
|
| [self setState:kNormal];
|
| // The state change hide the dangerouse download view and is now showing the
|
|
|