| 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)); | |
| 322 canvas.set_composite_alpha(true); | 321 canvas.set_composite_alpha(true); |
| 323 gfx::Rect boundingRect(NSRectToCGRect(frame)); | 322 gfx::Rect boundingRect(NSRectToCGRect(frame)); |
| 324 extensionAction_->PaintBadge(&canvas, boundingRect, tabId_); | 323 extensionAction_->PaintBadge(&canvas, boundingRect, tabId_); |
| 325 } | 324 } |
| 326 | 325 |
| 327 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { | 326 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { |
| 328 gfx::ScopedNSGraphicsContextSaveGState scopedGState; | 327 gfx::ScopedNSGraphicsContextSaveGState scopedGState; |
| 329 [super drawInteriorWithFrame:cellFrame inView:controlView]; | 328 [super drawInteriorWithFrame:cellFrame inView:controlView]; |
| 330 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; | 329 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; |
| 331 [self drawBadgeWithinFrame:cellFrame]; | 330 [self drawBadgeWithinFrame:cellFrame]; |
| 332 } | 331 } |
| 333 | 332 |
| 334 @end | 333 @end |
| OLD | NEW |