| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, | 61 this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, |
| 62 content::Source<ExtensionAction>(browser_action_)); | 62 content::Source<ExtensionAction>(browser_action_)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 ~ExtensionImageTrackerBridge() {} | 65 ~ExtensionImageTrackerBridge() {} |
| 66 | 66 |
| 67 // ImageLoadingTracker::Observer implementation. | 67 // ImageLoadingTracker::Observer implementation. |
| 68 void OnImageLoaded(const gfx::Image& image, | 68 void OnImageLoaded(const gfx::Image& image, |
| 69 const std::string& extension_id, | 69 const std::string& extension_id, |
| 70 int index) OVERRIDE { | 70 int index) OVERRIDE { |
| 71 browser_action_->CacheIcon(browser_action_->default_icon_path(), image); | 71 browser_action_->CacheIcon(image); |
| 72 [owner_ updateState]; | 72 [owner_ updateState]; |
| 73 } | 73 } |
| 74 | 74 |
| 75 // Overridden from content::NotificationObserver. | 75 // Overridden from content::NotificationObserver. |
| 76 void Observe(int type, | 76 void Observe(int type, |
| 77 const content::NotificationSource& source, | 77 const content::NotificationSource& source, |
| 78 const content::NotificationDetails& details) { | 78 const content::NotificationDetails& details) { |
| 79 if (type == chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED) | 79 if (type == chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED) |
| 80 [owner_ updateState]; | 80 [owner_ updateState]; |
| 81 else | 81 else |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 operation:NSCompositeSourceOver | 321 operation:NSCompositeSourceOver |
| 322 fraction:1.0 | 322 fraction:1.0 |
| 323 respectFlipped:YES | 323 respectFlipped:YES |
| 324 hints:nil]; | 324 hints:nil]; |
| 325 | 325 |
| 326 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; | 326 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; |
| 327 [self drawBadgeWithinFrame:cellFrame]; | 327 [self drawBadgeWithinFrame:cellFrame]; |
| 328 } | 328 } |
| 329 | 329 |
| 330 @end | 330 @end |
| OLD | NEW |