| 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/ui/cocoa/find_bar/find_bar_text_field_cell.h" | 5 #import "chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return 4.0; | 50 return 4.0; |
| 51 } | 51 } |
| 52 | 52 |
| 53 - (rect_path_utils::RoundedCornerFlags)roundedCornerFlags { | 53 - (rect_path_utils::RoundedCornerFlags)roundedCornerFlags { |
| 54 return rect_path_utils::RoundedCornerLeft; | 54 return rect_path_utils::RoundedCornerLeft; |
| 55 } | 55 } |
| 56 | 56 |
| 57 // Convenience for the attributes used in the right-justified info | 57 // Convenience for the attributes used in the right-justified info |
| 58 // cells. Sets the background color to red if |foundMatches| is YES. | 58 // cells. Sets the background color to red if |foundMatches| is YES. |
| 59 - (NSDictionary*)resultsAttributes:(BOOL)foundMatches { | 59 - (NSDictionary*)resultsAttributes:(BOOL)foundMatches { |
| 60 scoped_nsobject<NSMutableParagraphStyle> style( | 60 base::scoped_nsobject<NSMutableParagraphStyle> style( |
| 61 [[NSMutableParagraphStyle alloc] init]); | 61 [[NSMutableParagraphStyle alloc] init]); |
| 62 [style setAlignment:NSRightTextAlignment]; | 62 [style setAlignment:NSRightTextAlignment]; |
| 63 | 63 |
| 64 return [NSDictionary dictionaryWithObjectsAndKeys: | 64 return [NSDictionary dictionaryWithObjectsAndKeys: |
| 65 [self font], NSFontAttributeName, | 65 [self font], NSFontAttributeName, |
| 66 [NSColor lightGrayColor], NSForegroundColorAttributeName, | 66 [NSColor lightGrayColor], NSForegroundColorAttributeName, |
| 67 [NSColor whiteColor], NSBackgroundColorAttributeName, | 67 [NSColor whiteColor], NSBackgroundColorAttributeName, |
| 68 style.get(), NSParagraphStyleAttributeName, | 68 style.get(), NSParagraphStyleAttributeName, |
| 69 nil]; | 69 nil]; |
| 70 } | 70 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 [resultsString_.get() drawInRect:infoFrame]; | 111 [resultsString_.get() drawInRect:infoFrame]; |
| 112 } | 112 } |
| 113 | 113 |
| 114 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { | 114 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { |
| 115 if (resultsString_) | 115 if (resultsString_) |
| 116 [self drawResultsWithFrame:cellFrame inView:controlView]; | 116 [self drawResultsWithFrame:cellFrame inView:controlView]; |
| 117 [super drawInteriorWithFrame:cellFrame inView:controlView]; | 117 [super drawInteriorWithFrame:cellFrame inView:controlView]; |
| 118 } | 118 } |
| 119 | 119 |
| 120 @end | 120 @end |
| OLD | NEW |