| 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" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 NSWindow* window = [[self delegate] browserWindow]; | 67 NSWindow* window = [[self delegate] browserWindow]; |
| 68 visibilityDelegate_ = | 68 visibilityDelegate_ = |
| 69 [BrowserWindowController browserWindowControllerForWindow:window]; | 69 [BrowserWindowController browserWindowControllerForWindow:window]; |
| 70 [visibilityDelegate_ lockBarVisibilityForOwner:self | 70 [visibilityDelegate_ lockBarVisibilityForOwner:self |
| 71 withAnimation:NO | 71 withAnimation:NO |
| 72 delay:NO]; | 72 delay:NO]; |
| 73 } | 73 } |
| 74 | 74 |
| 75 CGFloat yAt = [self bounds].size.height; | 75 CGFloat yAt = [self bounds].size.height; |
| 76 NSSize dragOffset = NSMakeSize(0.0, 0.0); | 76 NSSize dragOffset = NSMakeSize(0.0, 0.0); |
| 77 [self dragImage:[self dragImage] at:NSMakePoint(0, yAt) offset:dragOffset | 77 NSImage* buttonImage = [self dragImage]; |
| 78 [self setHidden:YES]; |
| 79 [self dragImage:buttonImage at:NSMakePoint(0, yAt) offset:dragOffset |
| 78 event:event pasteboard:pboard source:self slideBack:YES]; | 80 event:event pasteboard:pboard source:self slideBack:YES]; |
| 81 [self setHidden:NO]; |
| 79 | 82 |
| 80 // And we're done. | 83 // And we're done. |
| 81 [self autorelease]; | 84 [self autorelease]; |
| 82 } else { | 85 } else { |
| 83 // Avoid blowing up, but we really shouldn't get here. | 86 // Avoid blowing up, but we really shouldn't get here. |
| 84 NOTREACHED(); | 87 NOTREACHED(); |
| 85 } | 88 } |
| 86 } | 89 } |
| 87 | 90 |
| 88 // Overridden to release bar visibility. | 91 // Overridden to release bar visibility. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 [image drawAtPoint:NSMakePoint(0, 0) | 147 [image drawAtPoint:NSMakePoint(0, 0) |
| 145 fromRect:NSMakeRect(0, 0, NSWidth(bounds), NSHeight(bounds)) | 148 fromRect:NSMakeRect(0, 0, NSWidth(bounds), NSHeight(bounds)) |
| 146 operation:NSCompositeSourceOver | 149 operation:NSCompositeSourceOver |
| 147 fraction:kDragImageOpacity]; | 150 fraction:kDragImageOpacity]; |
| 148 | 151 |
| 149 [dragImage unlockFocus]; | 152 [dragImage unlockFocus]; |
| 150 return dragImage; | 153 return dragImage; |
| 151 } | 154 } |
| 152 | 155 |
| 153 @end // @implementation BookmarkButton(Private) | 156 @end // @implementation BookmarkButton(Private) |
| OLD | NEW |