| 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/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" |
| 11 #include "base/sys_string_conversions.h" | 11 #include "base/sys_string_conversions.h" |
| 12 #include "chrome/browser/extensions/image_loading_tracker.h" | 12 #include "chrome/browser/extensions/image_loading_tracker.h" |
| 13 #include "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h" | 13 #include "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h" |
| 14 #import "chrome/browser/ui/cocoa/image_utils.h" | 14 #import "chrome/browser/ui/cocoa/image_utils.h" |
| 15 #include "chrome/common/extensions/extension.h" | 15 #include "chrome/common/extensions/extension.h" |
| 16 #include "chrome/common/extensions/extension_action.h" | 16 #include "chrome/common/extensions/extension_action.h" |
| 17 #include "chrome/common/extensions/extension_resource.h" | 17 #include "chrome/common/extensions/extension_resource.h" |
| 18 #include "chrome/common/notification_observer.h" | 18 #include "chrome/common/notification_observer.h" |
| 19 #include "chrome/common/notification_registrar.h" | 19 #include "chrome/common/notification_registrar.h" |
| 20 #include "chrome/common/notification_source.h" | 20 #include "chrome/common/notification_source.h" |
| 21 #include "chrome/common/notification_type.h" | 21 #include "chrome/common/notification_type.h" |
| 22 #include "gfx/canvas_skia_paint.h" | |
| 23 #include "gfx/rect.h" | |
| 24 #include "gfx/size.h" | |
| 25 #include "skia/ext/skia_utils_mac.h" | 22 #include "skia/ext/skia_utils_mac.h" |
| 26 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" | 23 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" |
| 24 #include "ui/gfx/canvas_skia_paint.h" |
| 25 #include "ui/gfx/rect.h" |
| 26 #include "ui/gfx/size.h" |
| 27 | 27 |
| 28 NSString* const kBrowserActionButtonUpdatedNotification = | 28 NSString* const kBrowserActionButtonUpdatedNotification = |
| 29 @"BrowserActionButtonUpdatedNotification"; | 29 @"BrowserActionButtonUpdatedNotification"; |
| 30 | 30 |
| 31 NSString* const kBrowserActionButtonDraggingNotification = | 31 NSString* const kBrowserActionButtonDraggingNotification = |
| 32 @"BrowserActionButtonDraggingNotification"; | 32 @"BrowserActionButtonDraggingNotification"; |
| 33 NSString* const kBrowserActionButtonDragEndNotification = | 33 NSString* const kBrowserActionButtonDragEndNotification = |
| 34 @"BrowserActionButtonDragEndNotification"; | 34 @"BrowserActionButtonDragEndNotification"; |
| 35 | 35 |
| 36 static const CGFloat kBrowserActionBadgeOriginYOffset = 5; | 36 static const CGFloat kBrowserActionBadgeOriginYOffset = 5; |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { | 324 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { |
| 325 [NSGraphicsContext saveGraphicsState]; | 325 [NSGraphicsContext saveGraphicsState]; |
| 326 [self setIconShadow]; | 326 [self setIconShadow]; |
| 327 [super drawInteriorWithFrame:cellFrame inView:controlView]; | 327 [super drawInteriorWithFrame:cellFrame inView:controlView]; |
| 328 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; | 328 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; |
| 329 [self drawBadgeWithinFrame:cellFrame]; | 329 [self drawBadgeWithinFrame:cellFrame]; |
| 330 [NSGraphicsContext restoreGraphicsState]; | 330 [NSGraphicsContext restoreGraphicsState]; |
| 331 } | 331 } |
| 332 | 332 |
| 333 @end | 333 @end |
| OLD | NEW |