| 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 #include "chrome/browser/cocoa/gradient_button_cell.h" | 5 #include "chrome/browser/cocoa/gradient_button_cell.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "base/scoped_nsobject.h" | 8 #import "base/scoped_nsobject.h" |
| 9 #import "chrome/browser/browser_theme_provider.h" | 9 #import "chrome/browser/browser_theme_provider.h" |
| 10 #import "chrome/browser/cocoa/image_utils.h" | 10 #import "chrome/browser/cocoa/image_utils.h" |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 572 |
| 573 BrowserThemeProvider* themeProvider = static_cast<BrowserThemeProvider*>( | 573 BrowserThemeProvider* themeProvider = static_cast<BrowserThemeProvider*>( |
| 574 [[controlView window] themeProvider]); | 574 [[controlView window] themeProvider]); |
| 575 NSColor* color = themeProvider ? | 575 NSColor* color = themeProvider ? |
| 576 themeProvider->GetNSColorTint(BrowserThemeProvider::TINT_BUTTONS, | 576 themeProvider->GetNSColorTint(BrowserThemeProvider::TINT_BUTTONS, |
| 577 true) : | 577 true) : |
| 578 [NSColor blackColor]; | 578 [NSColor blackColor]; |
| 579 | 579 |
| 580 if (isTemplate && themeProvider && themeProvider->UsingDefaultTheme()) { | 580 if (isTemplate && themeProvider && themeProvider->UsingDefaultTheme()) { |
| 581 scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); | 581 scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); |
| 582 [shadow setShadowColor:themeProvider->GetNSColor( | 582 [shadow.get() setShadowColor:themeProvider->GetNSColor( |
| 583 BrowserThemeProvider::COLOR_TOOLBAR_BEZEL, true)]; | 583 BrowserThemeProvider::COLOR_TOOLBAR_BEZEL, true)]; |
| 584 [shadow setShadowOffset:NSMakeSize(0.0, -1.0)]; | 584 [shadow.get() setShadowOffset:NSMakeSize(0.0, -1.0)]; |
| 585 [shadow setShadowBlurRadius:1.0]; | 585 [shadow setShadowBlurRadius:1.0]; |
| 586 [shadow set]; | 586 [shadow set]; |
| 587 } | 587 } |
| 588 | 588 |
| 589 CGContextBeginTransparencyLayer(context, 0); | 589 CGContextBeginTransparencyLayer(context, 0); |
| 590 NSRect imageRect = NSZeroRect; | 590 NSRect imageRect = NSZeroRect; |
| 591 imageRect.size = [[self image] size]; | 591 imageRect.size = [[self image] size]; |
| 592 NSRect drawRect = [self imageRectForBounds:cellFrame]; | 592 NSRect drawRect = [self imageRectForBounds:cellFrame]; |
| 593 [[self image] drawInRect:drawRect | 593 [[self image] drawInRect:drawRect |
| 594 fromRect:imageRect | 594 fromRect:imageRect |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 NSBezierPath* boundingPath = nil; | 699 NSBezierPath* boundingPath = nil; |
| 700 [self getDrawParamsForFrame:cellFrame | 700 [self getDrawParamsForFrame:cellFrame |
| 701 inView:controlView | 701 inView:controlView |
| 702 innerFrame:NULL | 702 innerFrame:NULL |
| 703 innerPath:NULL | 703 innerPath:NULL |
| 704 clipPath:&boundingPath]; | 704 clipPath:&boundingPath]; |
| 705 return boundingPath; | 705 return boundingPath; |
| 706 } | 706 } |
| 707 | 707 |
| 708 @end | 708 @end |
| OLD | NEW |