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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/browser_action_button.mm

Issue 9839012: Correct Mac browser icon rendering regressions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | « no previous file | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/browser_action_button.h" 5 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 311
312 @end 312 @end
313 313
314 @implementation BrowserActionCell 314 @implementation BrowserActionCell
315 315
316 @synthesize tabId = tabId_; 316 @synthesize tabId = tabId_;
317 @synthesize extensionAction = extensionAction_; 317 @synthesize extensionAction = extensionAction_;
318 318
319 - (void)drawBadgeWithinFrame:(NSRect)frame { 319 - (void)drawBadgeWithinFrame:(NSRect)frame {
320 gfx::CanvasSkiaPaint canvas(frame, false); 320 gfx::CanvasSkiaPaint canvas(frame, false);
321 canvas.sk_canvas()->clear(SkColorSetARGB(0, 0, 0, 0));
321 canvas.set_composite_alpha(true); 322 canvas.set_composite_alpha(true);
322 gfx::Rect boundingRect(NSRectToCGRect(frame)); 323 gfx::Rect boundingRect(NSRectToCGRect(frame));
323 extensionAction_->PaintBadge(&canvas, boundingRect, tabId_); 324 extensionAction_->PaintBadge(&canvas, boundingRect, tabId_);
324 } 325 }
325 326
326 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { 327 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
327 gfx::ScopedNSGraphicsContextSaveGState scopedGState; 328 gfx::ScopedNSGraphicsContextSaveGState scopedGState;
328 [super drawInteriorWithFrame:cellFrame inView:controlView]; 329 [super drawInteriorWithFrame:cellFrame inView:controlView];
329 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; 330 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset;
330 [self drawBadgeWithinFrame:cellFrame]; 331 [self drawBadgeWithinFrame:cellFrame];
331 } 332 }
332 333
333 @end 334 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698