| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ui/cocoa/autofill/down_arrow_popup_menu_cell.h" | 5 #include "chrome/browser/ui/cocoa/autofill/down_arrow_popup_menu_cell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h" | 9 #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h" |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 NSRect imageRect, titleRect; | 34 NSRect imageRect, titleRect; |
| 35 NSRect contentRect = NSInsetRect(cellFrame, kSidePadding, 0); | 35 NSRect contentRect = NSInsetRect(cellFrame, kSidePadding, 0); |
| 36 NSDivideRect( | 36 NSDivideRect( |
| 37 contentRect, &imageRect, &titleRect, [self imageSize].width, NSMaxXEdge); | 37 contentRect, &imageRect, &titleRect, [self imageSize].width, NSMaxXEdge); |
| 38 [super drawImageWithFrame:imageRect inView:controlView]; | 38 [super drawImageWithFrame:imageRect inView:controlView]; |
| 39 | 39 |
| 40 NSAttributedString* title = [self attributedTitle]; | 40 NSAttributedString* title = [self attributedTitle]; |
| 41 if ([title length]) | 41 if ([title length]) |
| 42 [self drawTitle:title withFrame:titleRect inView:controlView]; | 42 [self drawTitle:title withFrame:titleRect inView:controlView]; |
| 43 | 43 |
| 44 // Only draw custom focus ring if the 10.7 focus ring APIs are not available. | 44 [self drawFocusRingWithFrame:cellFrame inView:controlView]; |
| 45 // TODO(groby): Remove once we build against the 10.7 SDK. | |
| 46 if (![self respondsToSelector:@selector(drawFocusRingMaskWithFrame:inView:)]) | |
| 47 [super drawFocusRingWithFrame:cellFrame inView:controlView]; | |
| 48 } | 45 } |
| 49 | 46 |
| 50 @end | 47 @end |
| 51 | 48 |
| OLD | NEW |