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

Side by Side Diff: chrome/browser/ui/cocoa/download/download_item_controller.mm

Issue 16018005: Use DownloadItem::GetState() in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stopping complete_animation_ when download is cancelled Created 7 years, 6 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) 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 #import "chrome/browser/ui/cocoa/download/download_item_controller.h" 5 #import "chrome/browser/ui/cocoa/download/download_item_controller.h"
6 6
7 #include "base/mac/bundle_locations.h" 7 #include "base/mac/bundle_locations.h"
8 #include "base/mac/mac_util.h" 8 #include "base/mac/mac_util.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 DCHECK(alertIcon); 188 DCHECK(alertIcon);
189 [image_ setImage:alertIcon]; 189 [image_ setImage:alertIcon];
190 DCHECK(dangerousWarning); 190 DCHECK(dangerousWarning);
191 [dangerousDownloadLabel_ setStringValue:dangerousWarning]; 191 [dangerousDownloadLabel_ setStringValue:dangerousWarning];
192 DCHECK(confirmButtonTitle); 192 DCHECK(confirmButtonTitle);
193 [dangerousDownloadConfirmButton_ setTitle:confirmButtonTitle]; 193 [dangerousDownloadConfirmButton_ setTitle:confirmButtonTitle];
194 return; 194 return;
195 } 195 }
196 196
197 // Set correct popup menu. Also, set draggable download on completion. 197 // Set correct popup menu. Also, set draggable download on completion.
198 if (downloadModel->download()->IsComplete()) { 198 if (downloadModel->download()->GetState() == DownloadItem::COMPLETE) {
199 [progressView_ setMenu:completeDownloadMenu_]; 199 [progressView_ setMenu:completeDownloadMenu_];
200 [progressView_ setDownload:downloadModel->download()->GetTargetFilePath()]; 200 [progressView_ setDownload:downloadModel->download()->GetTargetFilePath()];
201 } else { 201 } else {
202 [progressView_ setMenu:activeDownloadMenu_]; 202 [progressView_ setMenu:activeDownloadMenu_];
203 } 203 }
204 204
205 [cell_ setStateFromDownload:downloadModel]; 205 [cell_ setStateFromDownload:downloadModel];
206 } 206 }
207 207
208 - (void)setIcon:(NSImage*)icon { 208 - (void)setIcon:(NSImage*)icon {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 [sender setTitle:l10n_util::GetNSStringWithFixup( 371 [sender setTitle:l10n_util::GetNSStringWithFixup(
372 IDS_DOWNLOAD_MENU_PAUSE_ITEM)]; 372 IDS_DOWNLOAD_MENU_PAUSE_ITEM)];
373 } else { 373 } else {
374 [sender setTitle:l10n_util::GetNSStringWithFixup( 374 [sender setTitle:l10n_util::GetNSStringWithFixup(
375 IDS_DOWNLOAD_MENU_RESUME_ITEM)]; 375 IDS_DOWNLOAD_MENU_RESUME_ITEM)];
376 } 376 }
377 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::TOGGLE_PAUSE, 0); 377 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::TOGGLE_PAUSE, 0);
378 } 378 }
379 379
380 @end 380 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698