OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 location:position | 72 location:position |
73 modifierFlags:NSLeftMouseDraggedMask | 73 modifierFlags:NSLeftMouseDraggedMask |
74 timestamp:event_time | 74 timestamp:event_time |
75 windowNumber:[window windowNumber] | 75 windowNumber:[window windowNumber] |
76 context:nil | 76 context:nil |
77 eventNumber:0 | 77 eventNumber:0 |
78 clickCount:1 | 78 clickCount:1 |
79 pressure:1.0]; | 79 pressure:1.0]; |
80 | 80 |
81 // TODO(avi): Do better than this offset. | 81 // TODO(avi): Do better than this offset. |
82 NSImage* drag_image = MakeDragImage( | 82 NSImage* drag_image = |
83 BookmarkModelFactory::GetForProfile(profile), nodes); | 83 MakeDragImage(BookmarkModelFactory::GetForBrowserContext(profile), nodes); |
84 NSSize image_size = [drag_image size]; | 84 NSSize image_size = [drag_image size]; |
85 position.x -= std::floor(image_size.width / 2); | 85 position.x -= std::floor(image_size.width / 2); |
86 position.y -= std::floor(image_size.height / 5); | 86 position.y -= std::floor(image_size.height / 5); |
87 [window dragImage:drag_image | 87 [window dragImage:drag_image |
88 at:position | 88 at:position |
89 offset:NSZeroSize | 89 offset:NSZeroSize |
90 event:drag_event | 90 event:drag_event |
91 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] | 91 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] |
92 source:nil | 92 source:nil |
93 slideBack:YES]; | 93 slideBack:YES]; |
94 } | 94 } |
95 | 95 |
96 } // namespace chrome | 96 } // namespace chrome |
OLD | NEW |