| 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/cocoa/download_item_cell.h" | 5 #import "chrome/browser/cocoa/download_item_cell.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/text_elider.h" | 8 #include "app/text_elider.h" |
| 9 #include "base/mac_util.h" | 9 #include "base/mac_util.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 radius:radius]; | 388 radius:radius]; |
| 389 [path appendBezierPathWithArcFromPoint:topRight | 389 [path appendBezierPathWithArcFromPoint:topRight |
| 390 toPoint:topLeft | 390 toPoint:topLeft |
| 391 radius:radius]; | 391 radius:radius]; |
| 392 [path lineToPoint:topLeft]; | 392 [path lineToPoint:topLeft]; |
| 393 return path; | 393 return path; |
| 394 } | 394 } |
| 395 | 395 |
| 396 - (NSString*)elideTitle:(int)availableWidth { | 396 - (NSString*)elideTitle:(int)availableWidth { |
| 397 NSFont* font = [self font]; | 397 NSFont* font = [self font]; |
| 398 gfx::Font font_chr = | 398 gfx::Font font_chr(base::SysNSStringToWide([font fontName]), |
| 399 gfx::Font::CreateFont(base::SysNSStringToWide([font fontName]), | 399 [font pointSize]); |
| 400 [font pointSize]); | |
| 401 | 400 |
| 402 return base::SysWideToNSString( | 401 return base::SysWideToNSString( |
| 403 ElideFilename(downloadPath_, font_chr, availableWidth)); | 402 ElideFilename(downloadPath_, font_chr, availableWidth)); |
| 404 } | 403 } |
| 405 | 404 |
| 406 - (NSString*)elideStatus:(int)availableWidth { | 405 - (NSString*)elideStatus:(int)availableWidth { |
| 407 NSFont* font = [self secondaryFont]; | 406 NSFont* font = [self secondaryFont]; |
| 408 gfx::Font font_chr = | 407 gfx::Font font_chr(base::SysNSStringToWide([font fontName]), |
| 409 gfx::Font::CreateFont(base::SysNSStringToWide([font fontName]), | 408 [font pointSize]); |
| 410 [font pointSize]); | |
| 411 | 409 |
| 412 return base::SysWideToNSString(ElideText( | 410 return base::SysWideToNSString(ElideText( |
| 413 base::SysNSStringToWide([self secondaryTitle]), | 411 base::SysNSStringToWide([self secondaryTitle]), |
| 414 font_chr, | 412 font_chr, |
| 415 availableWidth, | 413 availableWidth, |
| 416 false)); | 414 false)); |
| 417 } | 415 } |
| 418 | 416 |
| 419 - (ThemeProvider*)backgroundThemeWrappingProvider:(ThemeProvider*)provider { | 417 - (ThemeProvider*)backgroundThemeWrappingProvider:(ThemeProvider*)provider { |
| 420 if (!themeProvider_.get()) { | 418 if (!themeProvider_.get()) { |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 } | 699 } |
| 702 return self; | 700 return self; |
| 703 } | 701 } |
| 704 | 702 |
| 705 - (void)setCurrentProgress:(NSAnimationProgress)progress { | 703 - (void)setCurrentProgress:(NSAnimationProgress)progress { |
| 706 [super setCurrentProgress:progress]; | 704 [super setCurrentProgress:progress]; |
| 707 [cell_ animation:self progressed:progress]; | 705 [cell_ animation:self progressed:progress]; |
| 708 } | 706 } |
| 709 | 707 |
| 710 @end | 708 @end |
| OLD | NEW |