| 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 "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/sys_string_conversions.h" | 11 #include "base/sys_string_conversions.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/download/download_item.h" | 13 #include "chrome/browser/download/download_item.h" |
| 14 #include "chrome/browser/download/download_item_model.h" | 14 #include "chrome/browser/download/download_item_model.h" |
| 15 #include "chrome/browser/download/download_shelf.h" | 15 #include "chrome/browser/download/download_shelf.h" |
| 16 #include "chrome/browser/download/download_util.h" | 16 #include "chrome/browser/download/download_util.h" |
| 17 #import "chrome/browser/themes/browser_theme_provider.h" | 17 #import "chrome/browser/themes/browser_theme_provider.h" |
| 18 #import "chrome/browser/ui/cocoa/download/download_item_button.h" | 18 #import "chrome/browser/ui/cocoa/download/download_item_button.h" |
| 19 #import "chrome/browser/ui/cocoa/download/download_item_cell.h" | 19 #import "chrome/browser/ui/cocoa/download/download_item_cell.h" |
| 20 #include "chrome/browser/ui/cocoa/download/download_item_mac.h" | 20 #include "chrome/browser/ui/cocoa/download/download_item_mac.h" |
| 21 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" | 21 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
| 22 #import "chrome/browser/ui/cocoa/themed_window.h" | 22 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 23 #import "chrome/browser/ui/cocoa/ui_localizer.h" | 23 #import "chrome/browser/ui/cocoa/ui_localizer.h" |
| 24 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| 25 #include "grit/theme_resources.h" | 25 #include "grit/theme_resources.h" |
| 26 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 26 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
| 27 #include "ui/base/l10n/l10n_util_mac.h" | 27 #include "ui/base/l10n/l10n_util_mac.h" |
| 28 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
| 29 #include "ui/base/text/text_elider.h" | 29 #include "ui/base/text/text_elider.h" |
| 30 #include "ui/gfx/image.h" |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| 32 | 33 |
| 33 // NOTE: Mac currently doesn't use this like Windows does. Mac uses this to | 34 // NOTE: Mac currently doesn't use this like Windows does. Mac uses this to |
| 34 // control the min size on the dangerous download text. TVL sent a query off to | 35 // control the min size on the dangerous download text. TVL sent a query off to |
| 35 // UX to fully spec all the the behaviors of download items and truncations | 36 // UX to fully spec all the the behaviors of download items and truncations |
| 36 // rules so all platforms can get inline in the future. | 37 // rules so all platforms can get inline in the future. |
| 37 const int kTextWidth = 140; // Pixels | 38 const int kTextWidth = 140; // Pixels |
| 38 | 39 |
| 39 // The maximum number of characters we show in a file name when displaying the | 40 // The maximum number of characters we show in a file name when displaying the |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 [sender setTitle:l10n_util::GetNSStringWithFixup( | 393 [sender setTitle:l10n_util::GetNSStringWithFixup( |
| 393 IDS_DOWNLOAD_MENU_PAUSE_ITEM)]; | 394 IDS_DOWNLOAD_MENU_PAUSE_ITEM)]; |
| 394 } else { | 395 } else { |
| 395 [sender setTitle:l10n_util::GetNSStringWithFixup( | 396 [sender setTitle:l10n_util::GetNSStringWithFixup( |
| 396 IDS_DOWNLOAD_MENU_RESUME_ITEM)]; | 397 IDS_DOWNLOAD_MENU_RESUME_ITEM)]; |
| 397 } | 398 } |
| 398 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::TOGGLE_PAUSE); | 399 menuBridge_->ExecuteCommand(DownloadShelfContextMenuMac::TOGGLE_PAUSE); |
| 399 } | 400 } |
| 400 | 401 |
| 401 @end | 402 @end |
| OLD | NEW |