| 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/styled_text_field_cell.h" | 5 #import "chrome/browser/cocoa/styled_text_field_cell.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/browser_theme_provider.h" | 9 #include "chrome/browser/browser_theme_provider.h" |
| 10 #import "chrome/browser/cocoa/themed_window.h" | 10 #import "chrome/browser/cocoa/themed_window.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 return [super drawingRectForBounds:[self textFrameForFrame:theRect]]; | 43 return [super drawingRectForBounds:[self textFrameForFrame:theRect]]; |
| 44 } | 44 } |
| 45 | 45 |
| 46 // TODO(shess): This code is manually drawing the cell's border area, | 46 // TODO(shess): This code is manually drawing the cell's border area, |
| 47 // but otherwise the cell assumes -setBordered:YES for purposes of | 47 // but otherwise the cell assumes -setBordered:YES for purposes of |
| 48 // calculating things like the editing area. This is probably | 48 // calculating things like the editing area. This is probably |
| 49 // incorrect. I know that this affects -drawingRectForBounds:. | 49 // incorrect. I know that this affects -drawingRectForBounds:. |
| 50 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { | 50 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { |
| 51 DCHECK([controlView isFlipped]); | 51 DCHECK([controlView isFlipped]); |
| 52 | 52 |
| 53 // TODO(shess): This inset is also reflected in ToolbarController | 53 // TODO(shess): This inset is also reflected by |kFieldVisualInset| |
| 54 // -autocompletePopupPosition. | 54 // in autocomplete_popup_view_mac.mm. |
| 55 NSRect frame = NSInsetRect(cellFrame, 0, 1); | 55 NSRect frame = NSInsetRect(cellFrame, 0, 1); |
| 56 NSRect midFrame = NSInsetRect(frame, 0.5, 0.5); | 56 NSRect midFrame = NSInsetRect(frame, 0.5, 0.5); |
| 57 NSRect innerFrame = NSInsetRect(frame, 1, 1); | 57 NSRect innerFrame = NSInsetRect(frame, 1, 1); |
| 58 | 58 |
| 59 // Paint button background image if there is one (otherwise the border won't | 59 // Paint button background image if there is one (otherwise the border won't |
| 60 // look right). | 60 // look right). |
| 61 ThemeProvider* themeProvider = [[controlView window] themeProvider]; | 61 ThemeProvider* themeProvider = [[controlView window] themeProvider]; |
| 62 NSColor* backgroundImageColor = nil; | 62 NSColor* backgroundImageColor = nil; |
| 63 if (themeProvider) { | 63 if (themeProvider) { |
| 64 backgroundImageColor = | 64 backgroundImageColor = |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 if ([self showsFirstResponder]) { | 100 if ([self showsFirstResponder]) { |
| 101 [[[NSColor keyboardFocusIndicatorColor] colorWithAlphaComponent:0.5] set]; | 101 [[[NSColor keyboardFocusIndicatorColor] colorWithAlphaComponent:0.5] set]; |
| 102 NSFrameRectWithWidthUsingOperation(NSInsetRect(frame, 0, 0), 2, | 102 NSFrameRectWithWidthUsingOperation(NSInsetRect(frame, 0, 0), 2, |
| 103 NSCompositeSourceOver); | 103 NSCompositeSourceOver); |
| 104 } | 104 } |
| 105 | 105 |
| 106 [self drawInteriorWithFrame:cellFrame inView:controlView]; | 106 [self drawInteriorWithFrame:cellFrame inView:controlView]; |
| 107 } | 107 } |
| 108 | 108 |
| 109 @end | 109 @end |
| OLD | NEW |