summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/drag_util.h
blob: 04a0932d334359f5038e0c046c40e9c1c4ee3d47 (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
// Copyright (c) 2011 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.

#ifndef CHROME_BROWSER_UI_COCOA_DRAG_UTIL_H_
#define CHROME_BROWSER_UI_COCOA_DRAG_UTIL_H_

#import <Cocoa/Cocoa.h>

#include "base/strings/string16.h"

class GURL;
class Profile;

namespace drag_util {

// Returns the first file URL from |info|, if there is one. If |info| doesn't
// contain any file URLs, an empty |GURL| is returned.
GURL GetFileURLFromDropData(id<NSDraggingInfo> info);

// Determines whether the given drag and drop operation contains content that
// is supported by the web view. In particular, if the content is a local file
// URL, this checks if it is of a type that can be shown in the tab contents.
BOOL IsUnsupportedDropData(Profile* profile, id<NSDraggingInfo> info);

// Returns a drag image for a bookmark.
NSImage* DragImageForBookmark(NSImage* favicon,
                              const base::string16& title,
                              CGFloat title_width);

}  // namespace drag_util

#endif  // CHROME_BROWSER_UI_COCOA_DRAG_UTIL_H_