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

Side by Side Diff: chrome/browser/ui/cocoa/dock_icon.mm

Issue 9240004: Transition to base/mac/bundle_locations.h step 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 8 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
« no previous file with comments | « chrome/browser/shell_integration_mac.mm ('k') | chrome/common/chrome_version_info_mac.mm » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/cocoa/dock_icon.h" 5 #import "chrome/browser/ui/cocoa/dock_icon.h"
6 6
7 #include "base/mac/bundle_locations.h"
7 #include "base/memory/scoped_nsobject.h" 8 #include "base/memory/scoped_nsobject.h"
8 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" 9 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
9 10
10 // The fraction of the size of the dock icon that the badge is. 11 // The fraction of the size of the dock icon that the badge is.
11 static const float kBadgeFraction = 0.4f; 12 static const float kBadgeFraction = 0.4f;
12 13
13 // The indentation of the badge. 14 // The indentation of the badge.
14 static const float kBadgeIndent = 5.0f; 15 static const float kBadgeIndent = 5.0f;
15 16
16 // A view that draws our dock tile. 17 // A view that draws our dock tile.
(...skipping 18 matching lines...) Expand all
35 36
36 @implementation DockTileView 37 @implementation DockTileView
37 38
38 @synthesize downloads = downloads_; 39 @synthesize downloads = downloads_;
39 @synthesize indeterminate = indeterminate_; 40 @synthesize indeterminate = indeterminate_;
40 @synthesize progress = progress_; 41 @synthesize progress = progress_;
41 42
42 - (void)drawRect:(NSRect)dirtyRect { 43 - (void)drawRect:(NSRect)dirtyRect {
43 // Not -[NSApplication applicationIconImage]; that fails to return a pasted 44 // Not -[NSApplication applicationIconImage]; that fails to return a pasted
44 // custom icon. 45 // custom icon.
45 NSString* appPath = [[NSBundle mainBundle] bundlePath]; 46 NSString* appPath = [base::mac::MainBundle() bundlePath];
46 NSImage* appIcon = [[NSWorkspace sharedWorkspace] iconForFile:appPath]; 47 NSImage* appIcon = [[NSWorkspace sharedWorkspace] iconForFile:appPath];
47 [appIcon drawInRect:[self bounds] 48 [appIcon drawInRect:[self bounds]
48 fromRect:NSZeroRect 49 fromRect:NSZeroRect
49 operation:NSCompositeSourceOver 50 operation:NSCompositeSourceOver
50 fraction:1.0]; 51 fraction:1.0];
51 52
52 if (downloads_ == 0) 53 if (downloads_ == 0)
53 return; 54 return;
54 55
55 NSRect badgeRect = [self bounds]; 56 NSRect badgeRect = [self bounds];
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 227 }
227 228
228 - (void)setProgress:(float)progress { 229 - (void)setProgress:(float)progress {
229 NSDockTile* dockTile = [[NSApplication sharedApplication] dockTile]; 230 NSDockTile* dockTile = [[NSApplication sharedApplication] dockTile];
230 DockTileView* dockTileView = (DockTileView*)([dockTile contentView]); 231 DockTileView* dockTileView = (DockTileView*)([dockTile contentView]);
231 232
232 [dockTileView setProgress:progress]; 233 [dockTileView setProgress:progress];
233 } 234 }
234 235
235 @end 236 @end
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration_mac.mm ('k') | chrome/common/chrome_version_info_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698