OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/extensions/browser_action_button.h" | 5 #import "chrome/browser/cocoa/extensions/browser_action_button.h" |
6 | 6 |
7 #include "app/gfx/canvas_paint.h" | |
8 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
9 #include "chrome/browser/cocoa/extensions/extension_action_context_menu.h" | 8 #include "chrome/browser/cocoa/extensions/extension_action_context_menu.h" |
10 #include "chrome/browser/extensions/image_loading_tracker.h" | 9 #include "chrome/browser/extensions/image_loading_tracker.h" |
11 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
12 #include "chrome/common/notification_observer.h" | 11 #include "chrome/common/notification_observer.h" |
13 #include "chrome/common/notification_registrar.h" | 12 #include "chrome/common/notification_registrar.h" |
14 #include "chrome/common/notification_source.h" | 13 #include "chrome/common/notification_source.h" |
15 #include "chrome/common/notification_type.h" | 14 #include "chrome/common/notification_type.h" |
| 15 #include "gfx/canvas_paint.h" |
16 #include "gfx/rect.h" | 16 #include "gfx/rect.h" |
17 #include "gfx/size.h" | 17 #include "gfx/size.h" |
18 #include "skia/ext/skia_utils_mac.h" | 18 #include "skia/ext/skia_utils_mac.h" |
19 | 19 |
20 static const CGFloat kBrowserActionBadgeOriginYOffset = 5; | 20 static const CGFloat kBrowserActionBadgeOriginYOffset = 5; |
21 | 21 |
22 // Since the container is the maximum height of the toolbar, we have to move the | 22 // Since the container is the maximum height of the toolbar, we have to move the |
23 // buttons up by this amount in order to have them look vertically centered | 23 // buttons up by this amount in order to have them look vertically centered |
24 // within the toolbar. | 24 // within the toolbar. |
25 static const CGFloat kBrowserActionOriginYOffset = 5; | 25 static const CGFloat kBrowserActionOriginYOffset = 5; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 extensionAction_->PaintBadge(&canvas, boundingRect, tabId_); | 188 extensionAction_->PaintBadge(&canvas, boundingRect, tabId_); |
189 } | 189 } |
190 | 190 |
191 [NSGraphicsContext restoreGraphicsState]; | 191 [NSGraphicsContext restoreGraphicsState]; |
192 } | 192 } |
193 | 193 |
194 @synthesize tabId = tabId_; | 194 @synthesize tabId = tabId_; |
195 @synthesize extensionAction = extensionAction_; | 195 @synthesize extensionAction = extensionAction_; |
196 | 196 |
197 @end | 197 @end |
OLD | NEW |