| OLD | NEW |
| 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/string16.h" | 10 #include "base/string16.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 DCHECK(dangerousWarning); | 189 DCHECK(dangerousWarning); |
| 190 [dangerousDownloadLabel_ setStringValue:dangerousWarning]; | 190 [dangerousDownloadLabel_ setStringValue:dangerousWarning]; |
| 191 DCHECK(confirmButtonTitle); | 191 DCHECK(confirmButtonTitle); |
| 192 [dangerousDownloadConfirmButton_ setTitle:confirmButtonTitle]; | 192 [dangerousDownloadConfirmButton_ setTitle:confirmButtonTitle]; |
| 193 return; | 193 return; |
| 194 } | 194 } |
| 195 | 195 |
| 196 // Set correct popup menu. Also, set draggable download on completion. | 196 // Set correct popup menu. Also, set draggable download on completion. |
| 197 if (downloadModel->download()->IsComplete()) { | 197 if (downloadModel->download()->IsComplete()) { |
| 198 [progressView_ setMenu:completeDownloadMenu_]; | 198 [progressView_ setMenu:completeDownloadMenu_]; |
| 199 [progressView_ setDownload:downloadModel->download()->GetFullPath()]; | 199 [progressView_ setDownload:downloadModel->download()->GetTargetFilePath()]; |
| 200 } else { | 200 } else { |
| 201 [progressView_ setMenu:activeDownloadMenu_]; | 201 [progressView_ setMenu:activeDownloadMenu_]; |
| 202 } | 202 } |
| 203 | 203 |
| 204 [cell_ setStateFromDownload:downloadModel]; | 204 [cell_ setStateFromDownload:downloadModel]; |
| 205 } | 205 } |
| 206 | 206 |
| 207 - (void)setIcon:(NSImage*)icon { | 207 - (void)setIcon:(NSImage*)icon { |
| 208 [cell_ setImage:icon]; | 208 [cell_ setImage:icon]; |
| 209 } | 209 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 [sender setTitle:l10n_util::GetNSStringWithFixup( | 372 [sender setTitle:l10n_util::GetNSStringWithFixup( |
| 373 IDS_DOWNLOAD_MENU_PAUSE_ITEM)]; | 373 IDS_DOWNLOAD_MENU_PAUSE_ITEM)]; |
| 374 } else { | 374 } else { |
| 375 [sender setTitle:l10n_util::GetNSStringWithFixup( | 375 [sender setTitle:l10n_util::GetNSStringWithFixup( |
| 376 IDS_DOWNLOAD_MENU_RESUME_ITEM)]; | 376 IDS_DOWNLOAD_MENU_RESUME_ITEM)]; |
| 377 } | 377 } |
| 378 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::TOGGLE_PAUSE); | 378 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::TOGGLE_PAUSE); |
| 379 } | 379 } |
| 380 | 380 |
| 381 @end | 381 @end |
| OLD | NEW |