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 11 matching lines...) Expand all Loading... |
22 #include "grit/theme_resources.h" | 22 #include "grit/theme_resources.h" |
23 #include "skia/ext/skia_utils_mac.h" | 23 #include "skia/ext/skia_utils_mac.h" |
24 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" | 24 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" |
25 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
26 #include "ui/gfx/canvas_skia_paint.h" | 26 #include "ui/gfx/canvas_skia_paint.h" |
27 #include "ui/gfx/image/image.h" | 27 #include "ui/gfx/image/image.h" |
28 #include "ui/gfx/rect.h" | 28 #include "ui/gfx/rect.h" |
29 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 29 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
30 #include "ui/gfx/size.h" | 30 #include "ui/gfx/size.h" |
31 | 31 |
| 32 using extensions::Extension; |
| 33 |
32 NSString* const kBrowserActionButtonUpdatedNotification = | 34 NSString* const kBrowserActionButtonUpdatedNotification = |
33 @"BrowserActionButtonUpdatedNotification"; | 35 @"BrowserActionButtonUpdatedNotification"; |
34 | 36 |
35 NSString* const kBrowserActionButtonDraggingNotification = | 37 NSString* const kBrowserActionButtonDraggingNotification = |
36 @"BrowserActionButtonDraggingNotification"; | 38 @"BrowserActionButtonDraggingNotification"; |
37 NSString* const kBrowserActionButtonDragEndNotification = | 39 NSString* const kBrowserActionButtonDragEndNotification = |
38 @"BrowserActionButtonDragEndNotification"; | 40 @"BrowserActionButtonDragEndNotification"; |
39 | 41 |
40 static const CGFloat kBrowserActionBadgeOriginYOffset = 5; | 42 static const CGFloat kBrowserActionBadgeOriginYOffset = 5; |
41 | 43 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } | 326 } |
325 | 327 |
326 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { | 328 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { |
327 gfx::ScopedNSGraphicsContextSaveGState scopedGState; | 329 gfx::ScopedNSGraphicsContextSaveGState scopedGState; |
328 [super drawInteriorWithFrame:cellFrame inView:controlView]; | 330 [super drawInteriorWithFrame:cellFrame inView:controlView]; |
329 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; | 331 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; |
330 [self drawBadgeWithinFrame:cellFrame]; | 332 [self drawBadgeWithinFrame:cellFrame]; |
331 } | 333 } |
332 | 334 |
333 @end | 335 @end |
OLD | NEW |