| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 : owner_(owner), | 52 : owner_(owner), |
| 53 browser_action_([[owner cell] extensionAction]), | 53 browser_action_([[owner cell] extensionAction]), |
| 54 icon_factory_(profile, extension, browser_action_, this) { | 54 icon_factory_(profile, extension, browser_action_, this) { |
| 55 registrar_.Add( | 55 registrar_.Add( |
| 56 this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, | 56 this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, |
| 57 content::Source<ExtensionAction>(browser_action_)); | 57 content::Source<ExtensionAction>(browser_action_)); |
| 58 } | 58 } |
| 59 | 59 |
| 60 virtual ~ExtensionActionIconFactoryBridge() {} | 60 virtual ~ExtensionActionIconFactoryBridge() {} |
| 61 | 61 |
| 62 // ImageLoadingTracker::Observer implementation. | 62 // ExtensionActionIconFactory::Observer implementation. |
| 63 void OnIconUpdated() OVERRIDE { | 63 void OnIconUpdated() OVERRIDE { |
| 64 [owner_ updateState]; | 64 [owner_ updateState]; |
| 65 } | 65 } |
| 66 | 66 |
| 67 // Overridden from content::NotificationObserver. | 67 // Overridden from content::NotificationObserver. |
| 68 void Observe(int type, | 68 void Observe(int type, |
| 69 const content::NotificationSource& source, | 69 const content::NotificationSource& source, |
| 70 const content::NotificationDetails& details) { | 70 const content::NotificationDetails& details) { |
| 71 if (type == chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED) | 71 if (type == chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED) |
| 72 [owner_ updateState]; | 72 [owner_ updateState]; |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 operation:NSCompositeSourceOver | 328 operation:NSCompositeSourceOver |
| 329 fraction:enabled ? 1.0 : 0.4 | 329 fraction:enabled ? 1.0 : 0.4 |
| 330 respectFlipped:YES | 330 respectFlipped:YES |
| 331 hints:nil]; | 331 hints:nil]; |
| 332 | 332 |
| 333 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; | 333 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; |
| 334 [self drawBadgeWithinFrame:cellFrame]; | 334 [self drawBadgeWithinFrame:cellFrame]; |
| 335 } | 335 } |
| 336 | 336 |
| 337 @end | 337 @end |
| OLD | NEW |