OLD | NEW |
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 Loading... |
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 |
OLD | NEW |