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

Side by Side Diff: chrome/browser/cocoa/download_item_mac.mm

Issue 2835036: Mac: Add tooltip to download item. (Closed)
Patch Set: nits Created 10 years, 5 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 | « chrome/browser/cocoa/download_item_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/cocoa/download_item_mac.h" 5 #include "chrome/browser/cocoa/download_item_mac.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #import "chrome/browser/cocoa/download_item_controller.h" 9 #import "chrome/browser/cocoa/download_item_controller.h"
10 #include "chrome/browser/cocoa/download_util_mac.h" 10 #include "chrome/browser/cocoa/download_util_mac.h"
11 #include "chrome/browser/download/download_item_model.h" 11 #include "chrome/browser/download/download_item_model.h"
(...skipping 20 matching lines...) Expand all
32 // We have been approved. 32 // We have been approved.
33 [item_controller_ clearDangerousMode]; 33 [item_controller_ clearDangerousMode];
34 } 34 }
35 35
36 if (download->full_path() != lastFilePath_) { 36 if (download->full_path() != lastFilePath_) {
37 // Turns out the file path is "unconfirmed %d.download" for dangerous 37 // Turns out the file path is "unconfirmed %d.download" for dangerous
38 // downloads. When the download is confirmed, the file is renamed on 38 // downloads. When the download is confirmed, the file is renamed on
39 // another thread, so reload the icon if the download filename changes. 39 // another thread, so reload the icon if the download filename changes.
40 LoadIcon(); 40 LoadIcon();
41 lastFilePath_ = download->full_path(); 41 lastFilePath_ = download->full_path();
42
43 [item_controller_ updateToolTip];
42 } 44 }
43 45
44 switch (download->state()) { 46 switch (download->state()) {
45 case DownloadItem::REMOVING: 47 case DownloadItem::REMOVING:
46 [item_controller_ remove]; // We're deleted now! 48 [item_controller_ remove]; // We're deleted now!
47 break; 49 break;
48 case DownloadItem::COMPLETE: 50 case DownloadItem::COMPLETE:
49 if (download->auto_opened()) { 51 if (download->auto_opened()) {
50 [item_controller_ remove]; // We're deleted now! 52 [item_controller_ remove]; // We're deleted now!
51 return; 53 return;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 86 }
85 87
86 void DownloadItemMac::OnExtractIconComplete(IconManager::Handle handle, 88 void DownloadItemMac::OnExtractIconComplete(IconManager::Handle handle,
87 SkBitmap* icon_bitmap) { 89 SkBitmap* icon_bitmap) {
88 if (!icon_bitmap) 90 if (!icon_bitmap)
89 return; 91 return;
90 92
91 NSImage* icon = gfx::SkBitmapToNSImage(*icon_bitmap); 93 NSImage* icon = gfx::SkBitmapToNSImage(*icon_bitmap);
92 [item_controller_ setIcon:icon]; 94 [item_controller_ setIcon:icon];
93 } 95 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/download_item_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698