| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gfx/canvas_paint.h" | 7 #include "app/gfx/canvas_paint.h" |
| 8 #include "app/gfx/text_elider.h" | 8 #include "app/gfx/text_elider.h" |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 rightRoundedPath:radius inRect:dropdownDrawRect]; | 326 rightRoundedPath:radius inRect:dropdownDrawRect]; |
| 327 NSBezierPath* dropdownOuterPath = [self | 327 NSBezierPath* dropdownOuterPath = [self |
| 328 rightRoundedPath:(radius + 1) | 328 rightRoundedPath:(radius + 1) |
| 329 inRect:NSInsetRect(dropdownDrawRect, -1, -1)]; | 329 inRect:NSInsetRect(dropdownDrawRect, -1, -1)]; |
| 330 | 330 |
| 331 // Stroke the borders and appropriate fill gradient. | 331 // Stroke the borders and appropriate fill gradient. |
| 332 [self drawBorderAndFillForTheme:theme | 332 [self drawBorderAndFillForTheme:theme |
| 333 controlView:controlView | 333 controlView:controlView |
| 334 outerPath:buttonOuterPath | 334 outerPath:buttonOuterPath |
| 335 innerPath:buttonInnerPath | 335 innerPath:buttonInnerPath |
| 336 showHighlightGradient:[self isMouseOverButtonPart] |
| 336 showClickedGradient:[self isButtonPartPressed] | 337 showClickedGradient:[self isButtonPartPressed] |
| 337 showHighlightGradient:[self isMouseOverButtonPart] | |
| 338 hoverAlpha:0.0 | |
| 339 active:active | 338 active:active |
| 340 cellFrame:cellFrame]; | 339 cellFrame:cellFrame]; |
| 341 | 340 |
| 342 [self drawBorderAndFillForTheme: theme | 341 [self drawBorderAndFillForTheme: theme |
| 343 controlView:controlView | 342 controlView:controlView |
| 344 outerPath:dropdownOuterPath | 343 outerPath:dropdownOuterPath |
| 345 innerPath:dropdownInnerPath | 344 innerPath:dropdownInnerPath |
| 345 showHighlightGradient:[self isMouseOverDropdownPart] |
| 346 showClickedGradient:[self isDropdownPartPressed] | 346 showClickedGradient:[self isDropdownPartPressed] |
| 347 showHighlightGradient:[self isMouseOverDropdownPart] | |
| 348 hoverAlpha:0.0 | |
| 349 active:active | 347 active:active |
| 350 cellFrame:cellFrame]; | 348 cellFrame:cellFrame]; |
| 351 | 349 |
| 352 [self drawInteriorWithFrame:innerFrame inView:controlView]; | 350 [self drawInteriorWithFrame:innerFrame inView:controlView]; |
| 353 } | 351 } |
| 354 | 352 |
| 355 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { | 353 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { |
| 356 // Draw title | 354 // Draw title |
| 357 [self elideTitle:cellFrame.size.width - | 355 [self elideTitle:cellFrame.size.width - |
| 358 (kTextPosLeft + kTextPaddingRight + kDropdownAreaWidth)]; | 356 (kTextPosLeft + kTextPaddingRight + kDropdownAreaWidth)]; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 } | 505 } |
| 508 return self; | 506 return self; |
| 509 } | 507 } |
| 510 | 508 |
| 511 - (void)setCurrentProgress:(NSAnimationProgress)progress { | 509 - (void)setCurrentProgress:(NSAnimationProgress)progress { |
| 512 [super setCurrentProgress:progress]; | 510 [super setCurrentProgress:progress]; |
| 513 [cell_ animation:self progressed:progress]; | 511 [cell_ animation:self progressed:progress]; |
| 514 } | 512 } |
| 515 | 513 |
| 516 @end | 514 @end |
| OLD | NEW |