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

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

Issue 3066009: Use a PDF for the upgrade dot.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 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
« no previous file with comments | « chrome/app/theme/upgrade_dot.pdf ('k') | chrome/chrome_dll.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/toolbar_controller.h" 5 #import "chrome/browser/cocoa/toolbar_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util_mac.h" 9 #include "app/l10n_util_mac.h"
10 #include "app/menus/accelerator_cocoa.h" 10 #include "app/menus/accelerator_cocoa.h"
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 [wrenchMenuController_ setModel:wrenchMenuModel_.get()]; 555 [wrenchMenuController_ setModel:wrenchMenuModel_.get()];
556 [wrenchMenuController_ setUseWithPopUpButtonCell:YES]; 556 [wrenchMenuController_ setUseWithPopUpButtonCell:YES];
557 [wrenchButton_ setAttachedMenu:[wrenchMenuController_ menu]]; 557 [wrenchButton_ setAttachedMenu:[wrenchMenuController_ menu]];
558 } 558 }
559 559
560 - (WrenchMenuController*)wrenchMenuController { 560 - (WrenchMenuController*)wrenchMenuController {
561 return wrenchMenuController_; 561 return wrenchMenuController_;
562 } 562 }
563 563
564 - (void)badgeWrenchMenu { 564 - (void)badgeWrenchMenu {
565 // The wrench menu gets an upgrade dot. This gets ugly because we only have a
566 // PNG so we need to position it. TODO(avi): Get a PDF version, one ready for
567 // overlaying. http://crbug.com/49668
568 //
569 // In the Windows version, the ball doesn't actually pulsate, and is always 565 // In the Windows version, the ball doesn't actually pulsate, and is always
570 // drawn with the inactive image. Why? (We follow suit, though not on the 566 // drawn with the inactive image. Why? (We follow suit, though not on the
571 // weird positioning they do that overlaps the button border.) 567 // weird positioning they do that overlaps the button border.)
572 ThemeProvider* theme_provider = profile_->GetThemeProvider(); 568 NSImage* badge = nsimage_cache::ImageNamed(@"upgrade_dot.pdf");
573 NSImage* badge = theme_provider->GetNSImageNamed(IDR_UPGRADE_DOT_INACTIVE,
574 true);
575
576 NSImage* wrenchImage = nsimage_cache::ImageNamed(kWrenchButtonImageName); 569 NSImage* wrenchImage = nsimage_cache::ImageNamed(kWrenchButtonImageName);
577 NSSize wrenchImageSize = [wrenchImage size]; 570 NSSize wrenchImageSize = [wrenchImage size];
578 571
579 scoped_nsobject<NSImage> overlayImage( 572 scoped_nsobject<NSImage> overlayImage(
580 [[NSImage alloc] initWithSize:wrenchImageSize]); 573 [[NSImage alloc] initWithSize:wrenchImageSize]);
581 574
582 [overlayImage lockFocus]; 575 [overlayImage lockFocus];
583 [badge drawAtPoint:NSZeroPoint 576 [badge drawAtPoint:NSZeroPoint
584 fromRect:NSZeroRect 577 fromRect:NSZeroRect
585 operation:NSCompositeSourceOver 578 operation:NSCompositeSourceOver
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { 793 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point {
801 // Do nothing. 794 // Do nothing.
802 } 795 }
803 796
804 // (URLDropTargetController protocol) 797 // (URLDropTargetController protocol)
805 - (void)hideDropURLsIndicatorInView:(NSView*)view { 798 - (void)hideDropURLsIndicatorInView:(NSView*)view {
806 // Do nothing. 799 // Do nothing.
807 } 800 }
808 801
809 @end 802 @end
OLDNEW
« no previous file with comments | « chrome/app/theme/upgrade_dot.pdf ('k') | chrome/chrome_dll.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698