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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 return NO; | 680 return NO; |
681 } | 681 } |
682 | 682 |
683 return YES; | 683 return YES; |
684 } | 684 } |
685 | 685 |
686 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { | 686 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { |
687 return NSDragOperationCopy; | 687 return NSDragOperationCopy; |
688 } | 688 } |
689 | 689 |
| 690 - (void)updateToolTipsInRect:(NSRect)cellFrame |
| 691 ofView:(AutocompleteTextField*)controlView { |
| 692 std::vector<LocationBarDecoration*> decorations; |
| 693 std::vector<NSRect> decorationFrames; |
| 694 NSRect textFrame; |
| 695 CalculatePositionsInFrame(cellFrame, leftDecorations_, rightDecorations_, |
| 696 &decorations, &decorationFrames, &textFrame); |
| 697 |
| 698 for (size_t i = 0; i < decorations.size(); ++i) { |
| 699 NSString* tooltip = decorations[i]->GetToolTip(); |
| 700 if ([tooltip length] > 0) |
| 701 [controlView addToolTip:tooltip forRect:decorationFrames[i]]; |
| 702 } |
| 703 } |
| 704 |
690 @end | 705 @end |
OLD | NEW |