| 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/mac_util.h" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/sys_string_conversions.h" | 14 #include "base/sys_string_conversions.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/browser/download/download_item.h" | 16 #include "chrome/browser/download/download_item.h" |
| 17 #include "chrome/browser/download/download_item_model.h" | 17 #include "chrome/browser/download/download_item_model.h" |
| 18 #include "chrome/browser/download/download_shelf.h" | 18 #include "chrome/browser/download/download_shelf.h" |
| 19 #include "chrome/browser/download/download_util.h" | 19 #include "chrome/browser/download/download_util.h" |
| 20 #import "chrome/browser/themes/browser_theme_provider.h" | 20 #import "chrome/browser/themes/browser_theme_provider.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 - (void)setState:(DownoadItemState)state; | 91 - (void)setState:(DownoadItemState)state; |
| 92 @end | 92 @end |
| 93 | 93 |
| 94 // Implementation of DownloadItemController | 94 // Implementation of DownloadItemController |
| 95 | 95 |
| 96 @implementation DownloadItemController | 96 @implementation DownloadItemController |
| 97 | 97 |
| 98 - (id)initWithModel:(BaseDownloadItemModel*)downloadModel | 98 - (id)initWithModel:(BaseDownloadItemModel*)downloadModel |
| 99 shelf:(DownloadShelfController*)shelf { | 99 shelf:(DownloadShelfController*)shelf { |
| 100 if ((self = [super initWithNibName:@"DownloadItem" | 100 if ((self = [super initWithNibName:@"DownloadItem" |
| 101 bundle:mac_util::MainAppBundle()])) { | 101 bundle:base::mac::MainAppBundle()])) { |
| 102 // Must be called before [self view], so that bridge_ is set in awakeFromNib | 102 // Must be called before [self view], so that bridge_ is set in awakeFromNib |
| 103 bridge_.reset(new DownloadItemMac(downloadModel, self)); | 103 bridge_.reset(new DownloadItemMac(downloadModel, self)); |
| 104 menuBridge_.reset(new DownloadShelfContextMenuMac(downloadModel)); | 104 menuBridge_.reset(new DownloadShelfContextMenuMac(downloadModel)); |
| 105 | 105 |
| 106 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; | 106 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; |
| 107 [defaultCenter addObserver:self | 107 [defaultCenter addObserver:self |
| 108 selector:@selector(themeDidChangeNotification:) | 108 selector:@selector(themeDidChangeNotification:) |
| 109 name:kBrowserThemeDidChangeNotification | 109 name:kBrowserThemeDidChangeNotification |
| 110 object:nil]; | 110 object:nil]; |
| 111 | 111 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 [sender setTitle:l10n_util::GetNSStringWithFixup( | 392 [sender setTitle:l10n_util::GetNSStringWithFixup( |
| 393 IDS_DOWNLOAD_MENU_PAUSE_ITEM)]; | 393 IDS_DOWNLOAD_MENU_PAUSE_ITEM)]; |
| 394 } else { | 394 } else { |
| 395 [sender setTitle:l10n_util::GetNSStringWithFixup( | 395 [sender setTitle:l10n_util::GetNSStringWithFixup( |
| 396 IDS_DOWNLOAD_MENU_RESUME_ITEM)]; | 396 IDS_DOWNLOAD_MENU_RESUME_ITEM)]; |
| 397 } | 397 } |
| 398 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::TOGGLE_PAUSE); | 398 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::TOGGLE_PAUSE); |
| 399 } | 399 } |
| 400 | 400 |
| 401 @end | 401 @end |
| OLD | NEW |