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/bookmark_button.h" | 5 #import "chrome/browser/cocoa/bookmark_button.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #import "base/scoped_nsobject.h" | 7 #import "base/scoped_nsobject.h" |
8 #include "chrome/browser/bookmarks/bookmark_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_model.h" |
9 #import "chrome/browser/cocoa/bookmark_button_cell.h" | 9 #import "chrome/browser/cocoa/bookmark_button_cell.h" |
10 #import "chrome/browser/cocoa/browser_window_controller.h" | 10 #import "chrome/browser/cocoa/browser_window_controller.h" |
11 #import "chrome/browser/cocoa/view_id_util.h" | 11 #import "chrome/browser/cocoa/view_id_util.h" |
12 | 12 |
13 // The opacity of the bookmark button drag image. | 13 // The opacity of the bookmark button drag image. |
14 static const CGFloat kDragImageOpacity = 0.7; | 14 static const CGFloat kDragImageOpacity = 0.7; |
15 | 15 |
16 | 16 |
17 namespace bookmark_button { | 17 namespace bookmark_button { |
18 | 18 |
19 const NSString* kPulseBookmarkButtonNotification = | 19 NSString* const kPulseBookmarkButtonNotification = |
20 @"PulseBookmarkButtonNotification"; | 20 @"PulseBookmarkButtonNotification"; |
21 const NSString* kBookmarkKey = @"BookmarkKey"; | 21 NSString* const kBookmarkKey = @"BookmarkKey"; |
22 const NSString* kBookmarkPulseFlagKey = @"BookmarkPulseFlagKey"; | 22 NSString* const kBookmarkPulseFlagKey = @"BookmarkPulseFlagKey"; |
23 | 23 |
24 }; | 24 }; |
25 | 25 |
26 @interface BookmarkButton(Private) | 26 @interface BookmarkButton(Private) |
27 | 27 |
28 // Make a drag image for the button. | 28 // Make a drag image for the button. |
29 - (NSImage*)dragImage; | 29 - (NSImage*)dragImage; |
30 | 30 |
31 @end // @interface BookmarkButton(Private) | 31 @end // @interface BookmarkButton(Private) |
32 | 32 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 [image drawAtPoint:NSMakePoint(0, 0) | 179 [image drawAtPoint:NSMakePoint(0, 0) |
180 fromRect:NSMakeRect(0, 0, NSWidth(bounds), NSHeight(bounds)) | 180 fromRect:NSMakeRect(0, 0, NSWidth(bounds), NSHeight(bounds)) |
181 operation:NSCompositeSourceOver | 181 operation:NSCompositeSourceOver |
182 fraction:kDragImageOpacity]; | 182 fraction:kDragImageOpacity]; |
183 | 183 |
184 [dragImage unlockFocus]; | 184 [dragImage unlockFocus]; |
185 return dragImage; | 185 return dragImage; |
186 } | 186 } |
187 | 187 |
188 @end // @implementation BookmarkButton(Private) | 188 @end // @implementation BookmarkButton(Private) |
OLD | NEW |