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

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

Issue 3127008: Preliminary work on resuming downloads whose connections have expired.
Patch Set: Waiting to send download automation error message until after other downloads are canceled. Created 10 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) 2010 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"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 [item_controller_ remove]; // We're deleted now! 49 [item_controller_ remove]; // We're deleted now!
50 break; 50 break;
51 case DownloadItem::COMPLETE: 51 case DownloadItem::COMPLETE:
52 if (download->auto_opened()) { 52 if (download->auto_opened()) {
53 [item_controller_ remove]; // We're deleted now! 53 [item_controller_ remove]; // We're deleted now!
54 return; 54 return;
55 } 55 }
56 download_util::NotifySystemOfDownloadComplete(download->full_path()); 56 download_util::NotifySystemOfDownloadComplete(download->full_path());
57 // fall through 57 // fall through
58 case DownloadItem::IN_PROGRESS: 58 case DownloadItem::IN_PROGRESS:
59 case DownloadItem::INTERRUPTED:
59 case DownloadItem::CANCELLED: 60 case DownloadItem::CANCELLED:
60 [item_controller_ setStateFromDownload:download_model_.get()]; 61 [item_controller_ setStateFromDownload:download_model_.get()];
61 break; 62 break;
62 default: 63 default:
63 NOTREACHED(); 64 NOTREACHED();
64 } 65 }
65 } 66 }
66 67
67 void DownloadItemMac::LoadIcon() { 68 void DownloadItemMac::LoadIcon() {
68 IconManager* icon_manager = g_browser_process->icon_manager(); 69 IconManager* icon_manager = g_browser_process->icon_manager();
(...skipping 18 matching lines...) Expand all
87 } 88 }
88 89
89 void DownloadItemMac::OnExtractIconComplete(IconManager::Handle handle, 90 void DownloadItemMac::OnExtractIconComplete(IconManager::Handle handle,
90 SkBitmap* icon_bitmap) { 91 SkBitmap* icon_bitmap) {
91 if (!icon_bitmap) 92 if (!icon_bitmap)
92 return; 93 return;
93 94
94 NSImage* icon = gfx::SkBitmapToNSImage(*icon_bitmap); 95 NSImage* icon = gfx::SkBitmapToNSImage(*icon_bitmap);
95 [item_controller_ setIcon:icon]; 96 [item_controller_ setIcon:icon];
96 } 97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698