OLD | NEW |
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 #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 "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "app/text_elider.h" | 9 #include "app/text_elider.h" |
10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 235 |
236 - (void)updateVisibility:(id)sender { | 236 - (void)updateVisibility:(id)sender { |
237 if ([[self view] window]) | 237 if ([[self view] window]) |
238 [self updateTheme:[[[self view] window] themeProvider]]; | 238 [self updateTheme:[[[self view] window] themeProvider]]; |
239 | 239 |
240 NSView* view = [self view]; | 240 NSView* view = [self view]; |
241 NSRect containerFrame = [[view superview] frame]; | 241 NSRect containerFrame = [[view superview] frame]; |
242 [view setHidden:(NSMaxX([view frame]) > NSWidth(containerFrame))]; | 242 [view setHidden:(NSMaxX([view frame]) > NSWidth(containerFrame))]; |
243 } | 243 } |
244 | 244 |
| 245 - (void)downloadWasOpened { |
| 246 [shelf_ downloadWasOpened:self]; |
| 247 } |
| 248 |
245 - (IBAction)handleButtonClick:(id)sender { | 249 - (IBAction)handleButtonClick:(id)sender { |
246 NSEvent* event = [NSApp currentEvent]; | 250 NSEvent* event = [NSApp currentEvent]; |
247 if ([event modifierFlags] & NSCommandKeyMask) { | 251 if ([event modifierFlags] & NSCommandKeyMask) { |
248 // Let cmd-click show the file in Finder, like e.g. in Safari and Spotlight. | 252 // Let cmd-click show the file in Finder, like e.g. in Safari and Spotlight. |
249 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::SHOW_IN_FOLDER); | 253 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::SHOW_IN_FOLDER); |
250 } else { | 254 } else { |
251 DownloadItem* download = bridge_->download_model()->download(); | 255 DownloadItem* download = bridge_->download_model()->download(); |
252 download->OpenDownload(); | 256 download->OpenDownload(); |
253 } | 257 } |
254 } | 258 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 [sender setTitle:l10n_util::GetNSStringWithFixup( | 392 [sender setTitle:l10n_util::GetNSStringWithFixup( |
389 IDS_DOWNLOAD_MENU_PAUSE_ITEM)]; | 393 IDS_DOWNLOAD_MENU_PAUSE_ITEM)]; |
390 } else { | 394 } else { |
391 [sender setTitle:l10n_util::GetNSStringWithFixup( | 395 [sender setTitle:l10n_util::GetNSStringWithFixup( |
392 IDS_DOWNLOAD_MENU_RESUME_ITEM)]; | 396 IDS_DOWNLOAD_MENU_RESUME_ITEM)]; |
393 } | 397 } |
394 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::TOGGLE_PAUSE); | 398 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::TOGGLE_PAUSE); |
395 } | 399 } |
396 | 400 |
397 @end | 401 @end |
OLD | NEW |