Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: chrome/browser/cocoa/autocomplete_text_field_cell.mm

Issue 525098: [Mac] Implements context menus for Page Actions. Introduces a reusable subcla... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Final changes before submit. Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field_cell.h ('k') | chrome/browser/cocoa/autocomplete_text_field_editor.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698