blob: 81e55e64e8e414f73fb19b60d3b777f92b91dfa8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "chrome/browser/cocoa/bookmark_drag_source.h"
#include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/tab_contents/tab_contents_view_mac.h"
@implementation BookmarkDragSource
- (id)initWithContentsView:(TabContentsViewCocoa*)contentsView
dropData:
(const std::vector<BookmarkDragData::Element>&)dropData
profile:(Profile*)profile
pasteboard:(NSPasteboard*)pboard
dragOperationMask:(NSDragOperation)dragOperationMask {
self = [super initWithContentsView:contentsView
pasteboard:pboard
dragOperationMask:dragOperationMask];
if (self) {
dropData_ = dropData;
profile_ = profile;
}
return self;
}
- (void)fillPasteboard {
bookmark_pasteboard_helper_mac::WriteToDragClipboard(dropData_,
profile_->GetPath().value());
}
- (NSImage*)dragImage {
// TODO(feldstein): Do something better than this. Should have badging
// and a single drag image.
// http://crbug.com/37264
return [NSImage imageNamed:NSImageNameMultipleDocuments];
}
@end // @implementation BookmarkDragSource
|