| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 Profile* profile, | 45 Profile* profile, |
| 46 const Extension* extension) | 46 const Extension* extension) |
| 47 : owner_(owner), | 47 : owner_(owner), |
| 48 browser_action_([[owner cell] extensionAction]), | 48 browser_action_([[owner cell] extensionAction]), |
| 49 icon_factory_(profile, extension, browser_action_, this) { | 49 icon_factory_(profile, extension, browser_action_, this) { |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual ~ExtensionActionIconFactoryBridge() {} | 52 virtual ~ExtensionActionIconFactoryBridge() {} |
| 53 | 53 |
| 54 // ExtensionActionIconFactory::Observer implementation. | 54 // ExtensionActionIconFactory::Observer implementation. |
| 55 virtual void OnIconUpdated() OVERRIDE { | 55 virtual void OnIconUpdated() override { |
| 56 [owner_ updateState]; | 56 [owner_ updateState]; |
| 57 } | 57 } |
| 58 | 58 |
| 59 gfx::Image GetIcon(int tabId) { | 59 gfx::Image GetIcon(int tabId) { |
| 60 return icon_factory_.GetIcon(tabId); | 60 return icon_factory_.GetIcon(tabId); |
| 61 } | 61 } |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 // Weak. Owns us. | 64 // Weak. Owns us. |
| 65 BrowserActionButton* owner_; | 65 BrowserActionButton* owner_; |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 operation:NSCompositeSourceOver | 331 operation:NSCompositeSourceOver |
| 332 fraction:enabled ? 1.0 : 0.4 | 332 fraction:enabled ? 1.0 : 0.4 |
| 333 respectFlipped:YES | 333 respectFlipped:YES |
| 334 hints:nil]; | 334 hints:nil]; |
| 335 | 335 |
| 336 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; | 336 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; |
| 337 [self drawBadgeWithinFrame:cellFrame]; | 337 [self drawBadgeWithinFrame:cellFrame]; |
| 338 } | 338 } |
| 339 | 339 |
| 340 @end | 340 @end |
| OLD | NEW |