| 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 <cmath> | 5 #include <cmath> |
| 6 | 6 |
| 7 #import "chrome/browser/ui/cocoa/location_bar/image_decoration.h" | 7 #import "chrome/browser/ui/cocoa/location_bar/image_decoration.h" |
| 8 | 8 |
| 9 // The amount of horizontal padding around the image. | 9 // The amount of horizontal padding around the image. |
| 10 const CGFloat kImageHorizontalPadding = 9.0; | 10 const CGFloat kImageHorizontalPadding = 10.0; |
| 11 | 11 |
| 12 ImageDecoration::ImageDecoration() { | 12 ImageDecoration::ImageDecoration() { |
| 13 } | 13 } |
| 14 | 14 |
| 15 ImageDecoration::~ImageDecoration() { | 15 ImageDecoration::~ImageDecoration() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 NSImage* ImageDecoration::GetImage() { | 18 NSImage* ImageDecoration::GetImage() { |
| 19 return image_; | 19 return image_; |
| 20 } | 20 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 void ImageDecoration::DrawInFrame(NSRect frame, NSView* control_view) { | 49 void ImageDecoration::DrawInFrame(NSRect frame, NSView* control_view) { |
| 50 [GetImage() drawInRect:GetDrawRectInFrame(frame) | 50 [GetImage() drawInRect:GetDrawRectInFrame(frame) |
| 51 fromRect:NSZeroRect // Entire image | 51 fromRect:NSZeroRect // Entire image |
| 52 operation:NSCompositeSourceOver | 52 operation:NSCompositeSourceOver |
| 53 fraction:1.0 | 53 fraction:1.0 |
| 54 respectFlipped:YES | 54 respectFlipped:YES |
| 55 hints:nil]; | 55 hints:nil]; |
| 56 } | 56 } |
| OLD | NEW |