| 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 #import "chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.h" | 5 #import "chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "chrome/browser/cocoa/image_utils.h" | 8 #import "chrome/browser/cocoa/image_utils.h" |
| 9 #import "chrome/browser/cocoa/location_bar/location_bar_decoration.h" | 9 #import "chrome/browser/cocoa/location_bar/location_bar_decoration.h" |
| 10 | 10 |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 return NSZeroRect; | 443 return NSZeroRect; |
| 444 | 444 |
| 445 for (AutocompleteTextFieldIcon* icon in [self layedOutIcons:cellFrame]) { | 445 for (AutocompleteTextFieldIcon* icon in [self layedOutIcons:cellFrame]) { |
| 446 if (view == [icon view]) | 446 if (view == [icon view]) |
| 447 return [icon rect]; | 447 return [icon rect]; |
| 448 } | 448 } |
| 449 NOTREACHED(); | 449 NOTREACHED(); |
| 450 return NSZeroRect; | 450 return NSZeroRect; |
| 451 } | 451 } |
| 452 | 452 |
| 453 - (NSRect)pageActionFrameForExtensionAction:(ExtensionAction*)action | |
| 454 inFrame:(NSRect)cellFrame { | |
| 455 const size_t pageActionCount = [self pageActionCount]; | |
| 456 size_t pos = 0; | |
| 457 while (pos < pageActionCount && | |
| 458 action != page_action_views_->ViewAt(pos)->page_action()) | |
| 459 ++pos; | |
| 460 return (pos == pageActionCount) ? NSZeroRect : | |
| 461 [self pageActionFrameForIndex:pos inFrame:cellFrame]; | |
| 462 } | |
| 463 | |
| 464 - (void)drawHintWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { | 453 - (void)drawHintWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { |
| 465 DCHECK(hintString_); | 454 DCHECK(hintString_); |
| 466 | 455 |
| 467 NSRect textFrame = [self textFrameForFrame:cellFrame]; | 456 NSRect textFrame = [self textFrameForFrame:cellFrame]; |
| 468 NSRect infoFrame(NSMakeRect(NSMaxX(textFrame), | 457 NSRect infoFrame(NSMakeRect(NSMaxX(textFrame), |
| 469 cellFrame.origin.y + kHintYOffset, | 458 cellFrame.origin.y + kHintYOffset, |
| 470 ceil([hintString_ size].width), | 459 ceil([hintString_ size].width), |
| 471 cellFrame.size.height - kHintYOffset)); | 460 cellFrame.size.height - kHintYOffset)); |
| 472 [hintString_.get() drawInRect:infoFrame]; | 461 [hintString_.get() drawInRect:infoFrame]; |
| 473 } | 462 } |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 } | 677 } |
| 689 | 678 |
| 690 return YES; | 679 return YES; |
| 691 } | 680 } |
| 692 | 681 |
| 693 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { | 682 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { |
| 694 return NSDragOperationCopy; | 683 return NSDragOperationCopy; |
| 695 } | 684 } |
| 696 | 685 |
| 697 @end | 686 @end |
| OLD | NEW |