OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_cell.h" | 5 #import "chrome/browser/ui/cocoa/download/download_item_cell.h" |
6 | 6 |
7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
8 #include "chrome/browser/download/download_item_model.h" | 8 #include "chrome/browser/download/download_item_model.h" |
9 #include "chrome/browser/download/download_util.h" | 9 #include "chrome/browser/download/download_util.h" |
10 #import "chrome/browser/themes/theme_service.h" | 10 #import "chrome/browser/themes/theme_service.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 radius:radius]; | 329 radius:radius]; |
330 [path appendBezierPathWithArcFromPoint:topRight | 330 [path appendBezierPathWithArcFromPoint:topRight |
331 toPoint:topLeft | 331 toPoint:topLeft |
332 radius:radius]; | 332 radius:radius]; |
333 [path lineToPoint:topLeft]; | 333 [path lineToPoint:topLeft]; |
334 return path; | 334 return path; |
335 } | 335 } |
336 | 336 |
337 - (NSString*)elideTitle:(int)availableWidth { | 337 - (NSString*)elideTitle:(int)availableWidth { |
338 NSFont* font = [self font]; | 338 NSFont* font = [self font]; |
339 gfx::Font font_chr(base::SysNSStringToUTF16([font fontName]), | 339 gfx::Font font_chr(base::SysNSStringToUTF8([font fontName]), |
340 [font pointSize]); | 340 [font pointSize]); |
341 | 341 |
342 return base::SysUTF16ToNSString( | 342 return base::SysUTF16ToNSString( |
343 ui::ElideFilename(downloadPath_, font_chr, availableWidth)); | 343 ui::ElideFilename(downloadPath_, font_chr, availableWidth)); |
344 } | 344 } |
345 | 345 |
346 - (NSString*)elideStatus:(int)availableWidth { | 346 - (NSString*)elideStatus:(int)availableWidth { |
347 NSFont* font = [self secondaryFont]; | 347 NSFont* font = [self secondaryFont]; |
348 gfx::Font font_chr(base::SysNSStringToUTF16([font fontName]), | 348 gfx::Font font_chr(base::SysNSStringToUTF8([font fontName]), |
349 [font pointSize]); | 349 [font pointSize]); |
350 | 350 |
351 return base::SysUTF16ToNSString(ui::ElideText( | 351 return base::SysUTF16ToNSString(ui::ElideText( |
352 base::SysNSStringToUTF16([self secondaryTitle]), | 352 base::SysNSStringToUTF16([self secondaryTitle]), |
353 font_chr, | 353 font_chr, |
354 availableWidth, | 354 availableWidth, |
355 false)); | 355 false)); |
356 } | 356 } |
357 | 357 |
358 - (ui::ThemeProvider*)backgroundThemeWrappingProvider: | 358 - (ui::ThemeProvider*)backgroundThemeWrappingProvider: |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 } | 684 } |
685 return self; | 685 return self; |
686 } | 686 } |
687 | 687 |
688 - (void)setCurrentProgress:(NSAnimationProgress)progress { | 688 - (void)setCurrentProgress:(NSAnimationProgress)progress { |
689 [super setCurrentProgress:progress]; | 689 [super setCurrentProgress:progress]; |
690 [cell_ animation:self progressed:progress]; | 690 [cell_ animation:self progressed:progress]; |
691 } | 691 } |
692 | 692 |
693 @end | 693 @end |
OLD | NEW |