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/autocomplete_text_field_cell.h" | 5 #import "chrome/browser/cocoa/autocomplete_text_field_cell.h" |
6 | 6 |
7 #include "app/gfx/font.h" | 7 #include "app/gfx/font.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #import "third_party/GTM/AppKit/GTMTheme.h" | 10 #import "third_party/GTM/AppKit/GTMTheme.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 return [self rightJustifyImage:[icon size] | 336 return [self rightJustifyImage:[icon size] |
337 inRect:cellFrame | 337 inRect:cellFrame |
338 withMargin:widthUsed]; | 338 withMargin:widthUsed]; |
339 } | 339 } |
340 | 340 |
341 - (NSString*)pageActionToolTipForIndex:(size_t)index { | 341 - (NSString*)pageActionToolTipForIndex:(size_t)index { |
342 return page_action_views_->ViewAt(index)->GetToolTip(); | 342 return page_action_views_->ViewAt(index)->GetToolTip(); |
343 } | 343 } |
344 | 344 |
| 345 - (ExtensionAction*)pageActionForIndex:(size_t)index { |
| 346 return page_action_views_->ViewAt(index)->page_action(); |
| 347 } |
| 348 |
345 - (void)drawHintWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { | 349 - (void)drawHintWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { |
346 DCHECK(hintString_); | 350 DCHECK(hintString_); |
347 | 351 |
348 NSRect textFrame = [self textFrameForFrame:cellFrame]; | 352 NSRect textFrame = [self textFrameForFrame:cellFrame]; |
349 NSRect infoFrame(NSMakeRect(NSMaxX(textFrame), | 353 NSRect infoFrame(NSMakeRect(NSMaxX(textFrame), |
350 cellFrame.origin.y + kHintYOffset, | 354 cellFrame.origin.y + kHintYOffset, |
351 ceil([hintString_ size].width), | 355 ceil([hintString_ size].width), |
352 cellFrame.size.height - kHintYOffset)); | 356 cellFrame.size.height - kHintYOffset)); |
353 [hintString_.get() drawInRect:infoFrame]; | 357 [hintString_.get() drawInRect:infoFrame]; |
354 } | 358 } |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 inFrame:[self pageActionFrameForIndex:i inFrame:cellFrame] | 434 inFrame:[self pageActionFrameForIndex:i inFrame:cellFrame] |
431 inView:controlView]; | 435 inView:controlView]; |
432 } | 436 } |
433 } | 437 } |
434 } | 438 } |
435 | 439 |
436 [super drawInteriorWithFrame:cellFrame inView:controlView]; | 440 [super drawInteriorWithFrame:cellFrame inView:controlView]; |
437 } | 441 } |
438 | 442 |
439 @end | 443 @end |
OLD | NEW |